300 likes | 501 Views
Parallel ports, power supply, and the clock oscillator. Chapter Three. Outline. Parallel ports Technical challenges Connecting to the parallel port The PIC 16F84A parallel ports Power supply Clock oscillator. Data Transfer.
E N D
Parallel ports, power supply, and the clock oscillator Chapter Three Dr. Gheith Abandah
Outline • Parallel ports • Technical challenges • Connecting to the parallel port • The PIC 16F84A parallel ports • Power supply • Clock oscillator Dr. Gheith Abandah
Data Transfer • Almost any embedded system needs to transfer digital data between its CPU and the outside world. • Direct user interface, including switches, keypads, light-emitting diodes (LEDs) and displays • Input measurement information, from external sensors, possibly being acquired through an analog-to-digital converter • Output control information, for example to motors or other actuators • Bulk data transfer to or from other systems or subsystems, moving in serial or parallel form, for example sending serial data to an external memory. Dr. Gheith Abandah
Output Parallel Ports Dr. Gheith Abandah
Input Parallel Ports Dr. Gheith Abandah
Bi-directional Parallel Ports Dr. Gheith Abandah
Port electrical characteristics Modeling a logic gate output. (a) Generalized model. (b) Model of CMOS logic gate output Dr. Gheith Abandah
Schmitt trigger inputs Schmitt trigger characteristics. (a) Buffer with Schmitt trigger input. (b) Input/output characteristic Dr. Gheith Abandah
The ‘Open Drain’ output • An ‘Open Drain’ output. • Open Drain output driving load resistor. • The ‘Wired-OR’ connection Dr. Gheith Abandah
Connecting to the parallel port(1) Switches • SPDT connection. (b) SPST with pull-up resistor. • (c) SPST with pull-down resistor • Pull-up values in the range 10–100 kΩ Dr. Gheith Abandah
Connecting to the parallel port(2) Light-emitting diodes Dr. Gheith Abandah
Connecting to the parallel port(2) Light-emitting diodes • Driving LEDs from logic gates. • Gate output sourcing current to LED • Gate output sinking current from LED Dr. Gheith Abandah
Connecting to the parallel port(2) Light-emitting diodes Dr. Gheith Abandah
The PIC 16F84A parallel ports • Port A – 5 Bits • RA3:RA0 • RA4/T0CKI • Port B – 8 Bits • RB0/INT • RB3:RB1 • RB7:RB4: Interrupt on change Dr. Gheith Abandah
Port output characteristics -1 VOH vs. IOH (VDD = 3V, −40 to 125◦C) R = 130 Ω Dr. Gheith Abandah
Port output characteristics -2 VOL vs. IOL (VDD = 3V, −40 to 125◦C) R = 36 Ω Dr. Gheith Abandah
The clock oscillator • Faster clock gives faster execution, but more power consumption. • The clock oscillator must give stable and accurate clock signal. • Oscillator types: • Resistor–capacitor (RC) • Not precise • Crystal or ceramic • Precise frequency, fragile, should be near the MC Dr. Gheith Abandah
Oscillator types (a) Resistor–capacitor (RC). (b) Crystal or ceramic Dr. Gheith Abandah
The 16F84A clock oscillator • Types: • XT – crystal: 1-4 MHz • HS – high speed: >= 4 MHz, with ceramic resonators. • LP – low power: <= 200 KHz, e.g., 32.768 kHz (i.e. 215), • RC – resistor-capacitor Dr. Gheith Abandah
(a) Crystal or ceramic, HS, XT or LP. (b) Resistor–capacitor. (c) Externally supplied clock Dr. Gheith Abandah
Data Sheet Information Dr. Gheith Abandah
Power Supply RC Oscillator 100 nF decoupling capacitor Dr. Gheith Abandah
16F84A operating conditions Dr. Gheith Abandah
Summary – 1 • The parallel port allows ready exchange of digital data between the outside world and the controller CPU. • It is important to understand the electrical characteristics of the parallel port and how they interact with external elements. • While there is considerable diversity in the logic design of ports, they tend to follow similar patterns. • The internal circuitry is worth understanding, as it leads to effective use of ports. • The 16F84A has diverse and flexible parallel ports. Dr. Gheith Abandah
Summary – 2 • A microcontroller needs a clock signal in order to operate. The characteristics of the clock oscillator determine speed of operation and timing stability, and strongly influence power consumption. Active elements of the oscillator are usually built in to a microcontroller, but the designer must select the oscillator type, and its frequency and configuration. • A microcontroller needs a power supply in order to operate. The requirements need to be understood and must be met by a supply of the appropriate type. Dr. Gheith Abandah