Contents Introduction Block Diagram and Pin Description of
Contents: Introduction Block Diagram and Pin Description of the 8051 Registers Stack in the 8051
Why do we need to learn Microprocessors/controllers? n n n The microprocessor is the core of computer systems. Nowadays many communication, digital entertainment, portable devices, are controlled by them. A designer should know what types of components he needs, ways to reduce production costs and product reliable.
Different aspects of a microprocessor/controller n Hardware : Interface to the real world n Software : order how to deal with inputs
The necessary tools for a microprocessor/controller n n n n CPU: Central Processing Unit I/O: Input /Output Bus: Address bus & Data bus Memory: RAM & ROM Timer Interrupt Serial Port Parallel Port
Microprocessors: General-purpose microprocessor n n n CPU for Computers No RAM, ROM, I/O on CPU chip itself Example:Intel’s x 86, Motorola’s 680 x 0 CPU General. Purpose Microprocessor Many chips on mother’s board Data Bus RAM ROM I/O Port Address Bus General-Purpose Microprocessor System Timer Serial COM Port
Microcontroller : n n n A smaller computer On-chip RAM, ROM, I/O ports. . . Example:Motorola’s 6811, Intel’s 8051, Zilog’s Z 8 and PIC 16 X CPU I/O Port RAM ROM Serial Timer COM Port A single chip Microcontroller
Microprocessor vs. Microcontroller Microprocessor • CPU, RAM, ROM, I/O and n CPU is stand-alone, RAM, timer are all on a single chip ROM, I/O, timer are • fix amount of on-chip ROM, separate RAM, I/O ports n designer can decide on the • for applications in which cost, amount of ROM, RAM and power and space are critical I/O ports. • single-purpose n expansive n versatility n general-purpose
Block Diagram External interrupts Interrupt Control On-chip ROM for program code Timer/Counter On-chip RAM Timer 1 Timer 0 CPU OSC Bus Control 4 I/O Ports P 0 P 1 P 2 P 3 Address/Data Serial Port Tx. D Rx. D Counter Inputs
Pin Description of the 8051 P 1. 0 P 1. 1 P 1. 2 P 1. 3 P 1. 4 P 1. 5 P 1. 6 P 1. 7 RST (RXD)P 3. 0 (TXD)P 3. 1 (INT 0)P 3. 2 (INT 1)P 3. 3 (T 0)P 3. 4 (T 1)P 3. 5 (WR)P 3. 6 (RD)P 3. 7 XTAL 2 XTAL 1 GND 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 8051 (8031) 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 Vcc P 0. 0(AD 0 P ) 0. 1(AD 1) P 0. 2(AD 2 P ) 0. 3(AD 3) P 0. 4(AD 4) P 0. 5(AD 5) P 0. 6(AD 6) P 0. 7(AD 7) EA/VPP ALE/PROG PSEN P 2. 7(A 15) P 2. 6(A 14) P 2. 5(A 13) P 2. 4(A 12) P 2. 3(A 11) P 2. 2(A 10) P 2. 1(A 9) P 2. 0(A 8)
Figure (b). Power-On RESET Circuit Vcc + 10 u. F 31 30 p. F 8. 2 K 30 p. F 11. 0592 MHz 19 18 EA/VPP X 1 X 2 9 RST
Port 0 with Pull-Up Resistors Vcc Port 0 P 0. 0 DS 5000 P 0. 1 P 0. 2 8751 P 0. 3 P 0. 4 8951 P 0. 5 P 0. 6 P 0. 7 10 K
Registers A B R 0 DPTR DPH DPL R 1 R 2 PC PC R 3 R 4 R 5 R 6 R 7 Some 8 -bitt Registers of the 8051 Some 8051 16 -bit Register
Stack in the 8051 7 FH n The register used to access the stack is called SP (stack pointer) register. 30 H Scratch pad RAM 2 FH n The stack pointer in the 20 H 8051 is only 8 bits wide, 1 FH which means that it can 18 H 17 H take value 00 to FFH. 10 H When 8051 powered up, 0 FH 08 H the SP register contains 07 H 00 H value 07. Bit-Addressable RAM Register Bank 3 Register Bank 2 (Stack) Register Bank 1 Register Bank 0
- Slides: 14