Documente Academic
Documente Profesional
Documente Cultură
• B Register:
• This register is used to store one of the operands for multiply
and divide instructions
• Considered as a special function register
Architecture of 8051
• Program status word(PSW)
• Set of flags contains the status information
• Considered as special function register
• Stack Pointer(SP)
• This register is incremented before the data is stored on
to the stack
• Contains 8 bit stack top address
• After a reset the SP register is initialised to 07
• If sp contains 07 H the next PUSH operation will store
data at address 08H
• The SP content incremented to 08H
Architecture of 8051
• DATA POINTER
• 16 register (higher byte DPH and lower byte DPL)
• It contains a higher byte and lower byte of a 16 bit external
data RAM address
• Port 0 to 3 Latches and drivers
• Four latches and drivers pair are allocated to each of four on-
chip I/O ports
• Using this the user can communicate with these
ports(P0,P1,P2,P3)
Architecture of 8051
• Serial Data Buffer(SBUF)
• Internally contain two registers
1)Transmit Buffer(parallel –in Serial Out)
2)Receive Buffer (Serial l –in paralleOut)
• Timer Registers
• 2 ,16 BIT REGISTERS
• Timer register 0(TL0 and TH0)
• Timer register 1(TL1 and TH1)
• 4 address has been allotted to them which lie in special function registers
Architecture of 8051
• Control Registers
• These are special function registers
• IP,IE,TMOD,TCON,SCON and PCON
• These registers contain control and status information for
interrupts timers, counters and serial port
• Timing and Control Unit
• This unit derives all necessary timing and control signals
required for the internal operation of the circuit
Architecture of 8051
• Oscillator
• Generate basic timing clock signal for the operation of the
circuit using crystal oscillator
• Instruction Registers
• This register decodes the opcode of an instruction to be
executed and gives info to the timing and control unit
• to generate necessary signals for the execution of the
instruction
• EPROM and Program Address Register
• On-chip EPROM
• necessary mechanism to internally address it
• RAM and RAM Address register
• Provide internal 128 bytes of RAM and
mechanism to address it
• ALU
• Perform 8 bit arithmetic and logical operations
• Bit addressable
• Containing 16*8=128 bites
• Can be accessed by specifying the bit
number directly in the instruction
• OR the bit is mentioned with its position
in the respective register byte
• Eg:20.0 to 20.7
Memory addressing/organization 8051
RAM
• Section 3(30H to 7FH)
• Byte addressable
• Used as a stack memory
Lower 128 Byte of RAM
• LOWER RAM ORGANIZATION
EXTERNAL I/O INTERFACING
EXTERNAL I/O INTERFACING
• 8051 has internal ports
• Some complex applications may require
additional I/O devices
• Interfaced as external memory mapped
devices
• Devices are treated as external memory
locations
EXTERNAL I/O INTERFACING
INTERRUPTS AND STACK OF 8051
INTERRUPTS AND STACK OF 8051
• The 8051 microcontroller can recognize five
different events that cause the main program
to interrupt from the normal execution. These
five sources of interrupts in 8051are:
– Timer 0 overflow interrupt- TF0
– Timer 1 overflow interrupt- TF1
– External hardware interrupt- INT0
– External hardware interrupt- INT1
– Serial communication interrupt- RI/TI
INTERRUPTS AND STACK OF 8051
– External hardware interrupt- INT0
– External hardware interrupt- INT1
• TCON register specifies the type of external interrupt to the
microcontroller.
• External interrupts can be either edge sensitive or level sensitive
• This depends on bits IT0 and IT1 provided in the Register TCON.
• The flags which generate these type of interrupts are bits IE0 and
IE1.
• When an external interrupt is generated, the flag that generated
the interrupt is cleared by the hardware when the service routine is
vectored to ISR location.
• This happens only if the interrupt was edge-triggered.
• If the interrupt was level-triggered, then the external requesting
source is what controls the requested flag, rather than the on-chip
hardware.
INTERRUPTS AND STACK OF 8051
– Timer 0 overflow interrupt- TF0
– Timer 1 overflow interrupt- TF1
• Timer-0 & Timer-1 Interrupts are generated by
TF0 and TF1 bits of register TCON.
• When these interrupts are generated
respective flags are automatically cleared after
the control is transferred to respective
interrupt service routine
INTERRUPTS AND STACK OF 8051
• Serial communication interrupt- RI/TI