Professional Documents
Culture Documents
Study of 8051 Micro Controller Architecture
Study of 8051 Micro Controller Architecture
Ex no:1
Date:
Aim:
PIN1-8:
PIN 9:
Rs logical one on this pin stop microcontroller’s operating and erases the contents
of most registers. By applying the logical zero to the pin, the program starts
execution from the beginning. In other words, a positive voltage pulse on this pin
resets the microcontroller.
PINS 10-17:
Port3 similar to port 1, each of these pins can serve as universal input or output.
Besides, all of them have alternative functions
PIN 10:
PIN 11:
X2, X1 internal oscillator input and output. A quartz crystal is connected to these
pins to generate operating frequency
PIN 21-28:
Port 2 configured as inputs and outputs. In the case of external memory being used
these offer the address A8-A15.
PIN 29:
PSEN if external ROM is used for storing program then it has logic 0 value every
time the microcontroller reads from memory.
PIN 30:
ALE prior to each reading from external memory, the controller will set the low
address on P0 and after that activates the output ALE. In the second part of the
microcontroller machine cycles, a signal stops and P0 is used for data transmission.
PIN 31:
EA by applying logic zero to this pin ,P2 and P3 are used for data and address
transmission with no regard to whether there is internal memory or not. That
means even if program is there on the controller it will not be executed. Applying
logic one to EA the controller will use both the memories.
PIN 32: Port 0 is similar to port 2, if external memory is accessed.P0 provides the
lower address byte (A0-A7).
These registers are a kind of control table used for running and monitoring the
microcontroller operation. There are only 21 registers of this type.
Accumulator:
B register:
R Register (R0-R7):
PSW Registers:
The Program Status Register contain several bits that reflect the current state of the
CPU.
CY AC F0 RS1 RS0 OV - P
CY-carry
AC-Auxillary carry
OV –Over flag
P-Parity.
These are 16-bits wide for external memory addressing. They are divided into DPH
(Data Pointer High) and DPL (Data Pointer Low).
Stack Pointer(SP):
It points to the RAM and permits the stack availability .It is 8-bit wide. After reset
it points to address of 7 of the memory.
The 8051 has 2 timer, each 16-bit wide. their main purpose is for counting
occurrences of external events and measuring the time.
T0: when timer 0 is equal to 0 then both registers will include 0 value.
If the timer register contains a value of then accordingly its value is either used for
counting or for timing.
TMOD Register:
Writing into these will select the timer and their mode of operation.
Gate: starts the timer 1 using a signal provided to the pin INTO
(P3.2)
TCON REGISTER:
UART:
It’s a duplex port for serial communication which means it can receive and
transmit data serially. Serial data is sent by writing into SBUF register. SBUF is an
8-bit register. All bits used for controlling the serial communication is done with
the help of the SCON register.
REN-receive enable
RESET: Reset occurs when RS=1.Here all internal registers are reset by the
microcontroller