Architecture of 8051 & Their Pin Details
Total Page:16
File Type:pdf, Size:1020Kb
SESHASAYEE INSTITUTE OF TECHNOLOGY ARIYAMANGALAM , TRICHY – 620 010 ARCHITECTURE OF 8051 & THEIR PIN DETAILS UNIT I WELCOME ARCHITECTURE OF 8051 & THEIR PIN DETAILS U1.1 : Introduction to microprocessor & microcontroller : Architecture of 8085 -Functions of each block. Comparison of Microprocessor & Microcontroller - Features of microcontroller -Advantages of microcontroller -Applications Of microcontroller -Manufactures of microcontroller. U1.2 : Architecture of 8051 : Block diagram of Microcontroller – Functions of each block. Pin details of 8051 -Oscillator and Clock -Clock Cycle -State - Machine Cycle -Instruction cycle –Reset - Power on Reset - Special function registers :Program Counter -PSW register -Stack - I/O Ports . U1.3 : Memory Organisation & I/O port configuration: ROM RAM - Memory Organization of 8051,Interfacing external memory to 8051 Microcontroller vs. Microprocessors 1. CPU for Computers 1. A smaller computer 2. No RAM, ROM, I/O on CPU chip 2. On-chip RAM, ROM, I/O itself ports... 3. Example:Intel’s x86, Motorola’s 3. Example:Motorola’s 6811, 680x0 Intel’s 8051, Zilog’s Z8 and PIC Microcontroller vs. Microprocessors Microprocessor Microcontroller 1. CPU is stand-alone, RAM, ROM, I/O, timer are separate 1. CPU, RAM, ROM, I/O and timer are all on a single 2. designer can decide on the chip amount of ROM, RAM and I/O ports. 2. fix amount of on-chip ROM, RAM, I/O ports 3. expansive 3. for applications in which 4. versatility cost, power and space are 5. general-purpose critical 4. single-purpose uP vs. uC – cont. Applications – uCs are suitable to control of I/O devices in designs requiring a minimum component – uPs are suitable to processing information in computer systems. uP vs. uC – cont. uC is easy to use and design. – Only single chip can be a complete system – interfacing to other devices, • for example, motors, displays, sensors, and communicate with PC. In contrast, similar system that builds from uP would require a lot of additional units, – such as RAM, UART, I/O , TIMER and etc. Embedded Products Using Microcontrollers Home – Appliances, intercom, telephones, security systems, garage door openers, answering machines, fax machines, home computers, TVs, cable TV tuner, VCR, camcorder, remote controls, video games, cellular phones, musical instruments, sewing machines, lighting control, paging, camera, pinball machines, toys, exercise equipment Embedded Products Using Microcontrollers Office – Telephones, computers, security systems, fax machines, microwave, copier, laser printer, color printer, paging Embedded Products Using Microcontrollers Auto – Trip computer, engine control, air bag, ABS, instrumentation, security system, transmission control, entertainment, climate control, cellular phone, keyless entry Choosing A Microcontroller Computing needs – Speed, packaging, power consumption, RAM, ROM, I/O pins, timers, upgrade to high performance or low-power versions, cost Software development tools – Assembler, debugger, C compiler, emulator, technical support Availability & source Types of microcontrollers ▪ ARM core processors (many vendors) ▪ includes ARM9, ARM Cortex-A8, Sitara ARM Microprocessor ▪ Atmel AVR (8-bit), AVR32 (32-bit), and AT91SAM (32-bit) ▪ Cypress Semiconductor's M8C Core used in their PSoC ▪ Freescale ColdFire (32-bit) and S08 (8-bit) ▪ Freescale 68HC11 (8-bit) ▪ Intel 8051 ▪ Infineon: 8, 16, 32 Bit microcontrollers[9] ▪ MIPS ▪ Microchip Technology PIC, ▪ NXP Semiconductors LPC1000, LPC2000, LPC3000, LPC4000 ▪ Parallax Propeller ▪ PowerPC ISE ▪ Rabbit 2000 (8-bit) ▪ Silicon Laboratories Pipelined 8-bit 8051 Microcontrollers and … ▪ Texas Instruments TI MSP430 (16-bit) ▪ Toshiba TLCS-870 (8-bit/16-bit). Various 8051 Microcontrollers 8751 microcontroller – UV-EPROM AT89C51 from Atmel Corporation – Flash (erase before write) DS5000 from Dallas Semiconductor – NV-RAM (changed one byte at a time), RTC (real-time clock) OTP (one-time-programmable) version of 8051 8051 family from Philips – AD, DA, extended I/O, OTP and flash Companies Producing 8051 Table 1-2:Some Companies Producing a Member of the 8051 Family Company Web Site Intel www.intel.com/design/mcs51 Atmel www.atmel.com Philips/Signetics www.semiconductors.philips.com Siemens www.sci.siemens.com Dallas Semiconductor www.dalsemi.com Inside 8051 Microcontroller Introduced by Intel in 1981 ARCHITECTURE Memory Organization CPU Clock Interrupt Structure Port Structures Timer/Counters Reset Functional Description Of Each Block : • Accumulator: (Acc) Acc is an 8 bit special function register. It acts an operand register. Result is temporarily stored in this register. It is used in parallel I/O transfer. • B Register : B register is 8 bit SFR. It is used during multiply and divide operations. For other operations , it can be used as a scratchpad register. • Program Status Word (PSW) : PSW register is 8 bit SFR. It contains program status information. It is also used to select any one of the required register bank. • Stack Pointer ( SP): It is 8 bit register. It is used to point the stack memory. The stack may reside in anywhere in on-chip memory. It is incremented before data is stored during PUSH & CALL instructions. After reset SP is initialized to 07h. This causes the stack begin at location 08h. • Data Pointer (DPTR) : It is 16 bit register. It may be manipulated as a 16 bit register or as two independent 8 bit registers. Its function is to hold a 16 bit address. This register is used for external reference. CONTINUED.. • Port 0 to Port 3 : Each port contains separate address. Using this address,User can communicate with these ports. Each port contains latch,output driver & input buffer. • Serial Data Buffer : Serial data buffer contains two independent registers of a transmit buffer register and a receiver buffer register. – Transmit buffer is a parallel in and Serial out register. – Receiver buffer is a Serial in and parallel out register. – When data is moved to SBUF, it goes to transmit buffer . – When data is moved from SBUF, it comes from the receive buffer. • Timer Registers : Register pairs (TH0,TL0) & (TH1,TL1) are the two 16 bit counting registers for Timer/Counter 0 and 1 respectively. CONTINUED… • Control Registers : The special function registers IP,IE , TMOD, TCON SCON and PCON contain control and status information for interrupts, timer/counters and serial port. • Timing & Control Unit : This unit derives an necessary timing and control signals required for the internal operations of the circuit. It derives control signals required for controlling the external system bus. The interrupt, serial port and timer circuits are controlled by the control signals generated by timing & control unit. • Oscillator : This circuit generates the basic timing clock signal for the operation of the circuit using crystal oscillator. • Instruction Register : This register decodes the opcode of an instruction to be executed and gives information to the timing & control unit, and to generate necessary signals for the execution of the instruction. CONTINUED….. • EPROM & Program Address Register : These blocks provide an onchip EPROM and a Mechanism to internally address it. • RAM & RAM address register : These blocks provide an onchip RAM and a mechanism to internally address it. • ALU : The Arithmetic And Logic Unit performs 8 bit arithmetic and logical operations over the operands held by the temporary registers TMP 1 and TMP 2. User cannot access these temporary registers • SFR Register Banks : It is a set of registers, which can be addressed using their respective addresses which lie in the range 80h to FFh. XTAL Connection to 8051 • Find the machine cycle for • (a) XTAL = 11.0592 MHz • (b) XTAL = 16 MHz. • Solution: (a) 11.0592 MHz / 12 = 921.6 kHz; machine cycle = 1 / 921.6 kHz = 1.085 (b) 16 MHz / 12 = 1.333 MHz; machine cycle = 1 / 1.333 MHz = 0.75 s Power-On RESET • RST(pin 9):reset (i) input pin and active high (normally low). • The high pulse must be high at least 2 machine cycles. (ii)power-on reset. Upon applying a high pulse to RST, the microcontroller will reset and all values in registers will be lost. Reset values of some 8051 registers (A) 00 ;(SP) 07 • (iii)power-on reset circuit -as shown in figure PIN DIAGRAM OF 8051 PIN DETAILS • Pins 1 – 8:- Known as Port 1. Unlike other ports, this port does not serve any other functions. Port 1 is an internally pulled up, quasi bi directional I/O port. • Pin 9:- As explained before RESET pin is used to set the 8051 microcontroller to its initial values, while the microcontroller is working or at the initial start of application. To reset the microcontroller ,the reset pin must be set high for 2 machine cycles. CONTD… • Pins 10 – 17:- Known as Port 3. This port also serves some other functions like interrupts, timer input, control signals for external memory interfacing RD and WR , serial communication signals RxD and TxD etc. This is a quasi bi directional port with internal pull up resister. It is also called multifunctional port • Pins 18 and 19:- Used for connecting an crystal externally to provide system clock. • Pin 20:- Named as Vss – it represents ground (0 V) connection. CONTD… • Pins- 21-28:- Known as Port 2 (P 2.0 to P 2.7) – in addition to serving as I/O port, higher order address bus signals are multiplexed with this port. • Pin- 29:- PSEN or Program Store Enable is used to read data from external program memory. • Pin-30:- ALE Address Latch Enable is used to de multiplex the address and data signal of port 0 (for external memory interfacing.) When address moves on port 0,ALE will be high. It is the indication to hold the Address in latch . • Pin-31:- EA External Access input is used to enable or disable external memory interfacing. It is low enable pin. If there is no external memory requirement, this pin is pulled high by connecting it to Vcc. CONTD… • Pins 32-39: Known as Port 0 (P0.0 to P0.7) – In addition to serving as I/O port, lower order address and data are multiplexed with this port (16 bit address is used for the purpose of external memory interfacing).