Microcontroller - Architecture
Microcontroller - Architecture
MICROCONTROLLER
• A microcontroller is a small and low-cost microcomputer, which is
designed to perform the Specific tasks of embedded systems like
displaying microwave’s information, receiving remote signals, etc.
The general microcontroller consists of the processor, the memory
(RAM, ROM, and EPROM), Serial ports, peripherals (timers,
counters), etc.
MICROPROCESSOR VS MICROCONTROLLER
TYPES OF MICROCONTROLLERS
• It is based on an 8 bit central processing unit with an 8 bit accumulator and another
8-bit B register as main processing blocks.
• Other portions of the architecture include few 8 bit and 16b it registers and 8-bit
memory locations.
• It has some amount of data RAM built in the device for internal processing. This area is
used for stack operations and temporary storage of data.
• 8051 is supported with on-chip peripheral functions like I/O ports, Timers/ Counters,
Serial communication port
BLOCK DIAGRAM OF 8051
ARCHITECTURE OF 8051
CENTRAL PROCESSING UNIT
• This 16-bit register contains a higher byte (DPH) and the lower byte (DPL) of a
16-bit external data RAM address.
• This four latches and driver pairs are allotted to each of the four
on-chip I/O ports.
• For examples, TL0 represents the lower byte of the timing register 0,
while TH0 represents the upper byte of the timing register 0.
• Similarly, TL1 and TH1 represent lower and higher byte of the timing
register 1.
• TIMER MODE
• In the timer mode, the internal machine cycles are counted. So this register is
incremented in each machine cycle.
• COUNTER MODE
• In the counter mode, the external events are counted. In this mode, the timer
register is incremented for each 1 to 0 transition of the external input pin.
CONTROL REGISTER
• The special function register IP, IE, TMOD, TCON, SCON and
PCON contain control and status information for interrupts, Timer /
Counters and serial port.
• This unit derives all the necessary timing and control signals
recovered for the internal operation of the circuit.
• This circuit generates the basic timing clock signal for the operation of the circuit
using crystal oscillator
INSTRUCTION REGISTER
• Finally, the interrupt, serial port and timer units control and perform their
specific function under the control of the timing and control unit.
MEMORY ORGANISATION:
• The 8051 has a separate memory space for programs (Code) and
data.
• The 8051 supports a special feature which allows access to bit variables.
• This is where individual memory bits in Internal RAM can be set or cleared.
• A bit variable can be set with a command such as SETB and cleared with a
command such as CLR.
GENERAL PURPOSE RAM: 30H TO 7FH
• These 80 bytes of Internal RAM memory are available for general-purpose data
storage.
• Access to this area of memory is fast compared to access to the main memory
and special instructions with single byte operands are used.
• However, these 80 bytes are used by the system stack and in practice little
space is left
• The general purpose RAM can be accessed using direct or indirect addressing
modes.
SFR REGISTERS
• The SFR registers are located within the Internal Memory in the address range 80h to
FFh, as shown in figure 3.
• Each SFR has an address (within the range 80h to FFh) and a name which reflects the
purpose of the SFR.
• Although 128 byes of the SFR address space is defined only 21 SFR registers are
defined in the standard 8051.
• Undefined SFR addresses should not be accessed as this might lead to some
unpredictable results.
• A 16 bit base registers (DPTR or PC) points to the base of the lookup
tables and accumulator carries the constant indicating table entry
number.
• The address of the exact location of the table is formed by adding the
accumulator data to the base pointer.