8051 Microcontroller Architecture
The 8051 is the name of a big family of microcontrollers. The device which we are going to use is 'AT89S52' which is a typical 8051 microcontroller manufactured by Atmel. Note that this part doesn't aim to explain the functioning of the different components of a 'AT89S52' microcontroller, but rather to give a general idea of the organization of the chip and the available features.
It is notice that the 'AT89S52' has 4 different ports, each one having 8 Input/output lines providing a total of 32 I/O lines. Those ports can be used to output DATA and orders to other devices, or to read the state of a sensor, or a switch. Most of the ports of the 'AT89S52' have 'dual function' meaning that they can be used for two different functions: the first one is to perform input/output operations and the second one is used to implement special features of the microcontroller like counting external pulses, interrupting the execution of the program according to external events, performing serial data transfer or connecting the chip to a computer to update the software.
Each port has 8 pins, and will be treated from the software point of view as an 8-bit variable called 'register', each bit being connected to a different Input/Output pin.
There are two different memory types: RAM and EEPROM. Shortly, RAM is used to store variable during program execution, while the EEPROM memory is used to store the program itself, that's why it is often referred to as the 'program memory'. The memory organization will be discussed in detail later.
It is clear that the CPU (Central Processing Unit) is the heart of the microcontrollers, It is the CPU that will Read the program from the FLASH memory and execute it by interacting with the different peripherals.
Note that the pin that have dual functions, can still be used normally as an input/output pin. Unless the program uses their dual functions, All the 32 I/O pins of the microcontroller are configured as input/output pins. Most of the function of the pins of the 'AT89S52' microcontroller will be discussed in detail, except for the pins required to control an external memory, which are the pins number 29, 30 and 31. Since we are not going to use any external memory, pins 29 and 30 will be ignored and pin 31 (EA) always connected to VCC (5 Volts) to enable the micro-controller to use the internal on chip memory rather than an external one (connecting the pin 31 to ground would indicate to the microcontroller that an external memory is to be used instead of the internal one). |
Note that the pin that have dual functions, can still be used normally as an input/output pin. Unless the program uses their dual functions. All the 32 I/O pins of the microcontroller are configured as input/output pins.
Most of the function of the pins of the 'AT89S52' microcontroller will be discussed in detail, except for the pins required to control an external memory, which are the pins number 29, 30 and 31. Since the external memory would not be used, pins 29 and 30 will be ignored throughout and pin 31 (EA) always connected to VCC (5 Volts) to enable the micro-controller to use the internal on chip memory rather than an external one (connecting the pin 31 to ground would indicate to the microcontroller that an external memory is to be used instead of the internal one).
Comments
Post a Comment