Architecture of 8031 8051 Microcontroller
Architecture of 8031 8051 Microcontroller
ARCHITECTURE OF 8031/8051
The unit can perform logical operations such as AND, OR; and Exclusive-OR, as well as rotate, clear, and
complement.
The ALU can also manipulate one bit as well as eight-bit data types.
Individual bits may be set, cleared, complemented, tested, and used in logic computation.
2. Accumulator:
It is an 8-bit register.
It holds a data and receives the result of the arithmetic instructions.
3. B register:
An 8-bit general-purpose register.
4. Program Status Word:
Many instructions implicitly or explicitly affect (or are affected by) several status flags, which are grouped
together to form the Program Status Word.
It also used to select the memory bank.
The 16-bit data pointer is used for accessing external data memory.
The contents of data pointer are programmable using instructions.
7. Program Counter (PC):
It is a 16 bit register.
PC is used, as address pointer to access program instructions and it is automatically incremented after
every byte of instruction fetch.
I/O Devices:
The 8051 has four numbers of 8-bit ports namely port-0, port- 1, port-2 and port-3.
Each port has a latch and driver (or buffer).
When external memory is employed the port-0 lines will function as multiplexed low byte address/data
lines and port-2 lines will function as high byte address lines.
Also the port pins P3.7 and P3.6 are used to output read and write control signals respectively.
The port-1 is dedicated I/O port and does not have any alternate function.
The ports are also mapped as internal memory in the controller and so they can be addressed as memory
locations for 8-bit operation.
Memory Organization:
Since the size of address pointers are 16-bit they can address up to 216 = 64kb memory locations.
A microcontroller based system requires both EPROM and RAM. The EPROM is required for permanent
program and permanent data storage. The RAM is required for temporary data storage and stack. The
8031/8051 has 64kb program memory address space and 64kb data memory address space.
The microcontroller can only read from program memory such as ROM/EPROM/ EEPROM and the signal
PSEN (Low) is used as read control for reading program memory.
The microcontroller can read and write with data memory RAM. It has separate read control signal
RD(Low), and write control signal WR(Low) for reading and writing with data memory respectively.
In 8031/8051 based system only memory mapped I/O is possible.
Program Memory:
In 8031 there is no internal ROM/EPROM and so the entire 64 kb program memory space in the range
0000H to FFFFH is external. Therefore in 8031 based systems the pin EA(Low) is always tied low or grounded
(0V).
The 8051 has 4kb internal ROM which can be mapped to first 4kb address space of program memory.
If EA(Low) pin is tied high or tied to VCC (+5V), then the internal 4kb ROM be mapped as program memory
in the address range 0000H to 0FFFH and the external program memory 60kb will have the address range
l000H to FFFFH.
If EA(Low) pin is tied low or grounded (0V), then the internal ROM is ignored or cannot be accessed. The
entire 64 kb program memory address space is external with address range 0000H to FFFFH.
The PSEN (Low) signal is used to activate output enable signal to access the external ROM/EPROM, as
shown.
The port 0 is used as a multiplexed address/bus. It gives lower order 8-bit address in the initial T-cycle and
later it is used as a data bus.
The 8-bit address is latched using external latch and ALE signal generated by 8051.
The port 2 provides the higher order 8-bit address.
The lower part of program memory stores the vector addresses for various interrupt service routines.
Each interrupt is assigned with a fixed location in program memory.
Interrupt/Vector location
Source : http://mediatoget.blogspot.in/2013/03/architecture-of-80318051microcontroller.html