1 MicroController
1 MicroController
[Architecture]
The Microcontroller
• Microcontrollers can be considered as self-contained systems with a
processor, memory and I/O ports.
– In most cases, all that is missing is the software to define the
operation of the embedded system.
– Dallas Semiconductor
• Uses NV-RAM. Programmable in-system.
• As large as 32K of instruction memory.
• Some versions have an on-chip real-time clock.
– Philips Corporation.
• Large selection of 8051 based microcontrollers.
• Include features like A/D and D/A on chip.
– Xilinx and Altera
• 8051 FPGA cores.
The 8051 Microcontroller Internals
8051 Architecture
• Programmer’s View
– Memory Organization
– Register Set
– Instruction Set
Link: EA connection
Access to External Memory
• Port 0 acts as a multiplexed address/data bus. Sending
the low byte of the program counter (PCL) as an
address.
• Port 2 sends the program counter high byte (PCH)
directly to the external memory.
• The signal ALE operates as in the 8051 to allow an
external latch to store the PCL byte while the multiplexed
bus is made ready to receive the code byte from the
external memory.
• Port 0 then switches function and becomes the data bus
receiving the byte from memory.
• Bit addressable.
– ACC.2 means bit 2 of the ACC register.
The B Register
• Commonly used as a temporary register, much like a 9th
R register.
• Used by two op-codes
– MUL AB, div AB
• B register holds the second operand and will hold part of
the result
– Upper 8 bits of the multiplication result
– Remainder in case of division.
• Bit addressable.
– First bit has the same address as the register.
– Example: P1 has address 90H in the SFR, so
• P1.7 or address 97H refer to the same bit.
• In the 8052, one more pair exists (TH2) / (TL2) for the T2
timer.