Professional Documents
Culture Documents
Unit 2 - Microcontroller & Embedded System - WWW - Rgpvnotes.in
Unit 2 - Microcontroller & Embedded System - WWW - Rgpvnotes.in
Unit 2 - Microcontroller & Embedded System - WWW - Rgpvnotes.in
Tech
Subject Name: Microcontroller & Embedded System
Subject Code: EC-604
Semester: 6th
Downloaded from www.rgpvnotes.in
Functional Block-Diagram:
The 8096 family of microcontrollers has several sections, the major sections include a 16 bit CPU, a
programmable high speed input/output unit, on-chip RAM, on-chip ROM, analog to digital converter, serial
port and pulse-width modulated output for analog to digital converter. Fig. 2.1 shows the internal
architecture of 8096 microcontroller. It consists of several functional units. They are.
(i) CPU with 232 byte register file and register ALU.
(ii) 8KB internal ROM.
(iii) Programmable high speed I/O unit.
(iv) Two 16 bit timers/counters.
(v) Serial ports.
(vi) Pulse width modulator.
(vii) Watchdog timer
(viii) Memory controller.
(ix) Eight multiplexed inputs A/D converter with 10 bit resolution.
The two main buses, address bus and data bus are used for inter-processor communication. It has address
bus of 8 bit and data bus is 16 bit. The data bus transfers data between RALU and register file or special
function registers. (SFRs). The address bus provides addresses for multiplexed address/data bus
connecting to the memory controller. The memory controller provides the addresses for the internal ROM
and external memory.
• For instruction requiring shift for execution, shift registers are provided. e.g.: shift left, shift right,
normalize, multiply, divide etc.
• When a 16-bit data is to be shifted, an upper word register/shifter is used. The lower word/shifter
is used along with upper word register/shifter in case of 32-bit shift.
• For the instructions that require repetitive shifts (e.g. shift right by 5 bits), a 5 bit loop counter is
useful.
• For execution of two operand instructions, a temporary register is provided. This temporary
register stores the multiplier during the execution of multiplication instruction, or divisor during
execution of division instruction.
• For the execution of increment/decrement instructions some constants are defined. The constants
0,1,2 are stored in RALU to execute the instruction faster.
• The A bus (address bus) is 8 bit wide. It is used to transfer 16 bit address or data information to
memory controller or other units. A delay circuit is provided. It facilitate transfer of lower byte
followed by delay followed by upper byte to the memory controller.
• Program counter and incrementer are provided in RALU to increment the PC after execution of
each instruction. Thus, it points to the next instruction to be executed.
• In case of jump instructions being executed, the program counter is modified through ALU.
Port 0: Port 0 is an input port. It shares its pins with the analog inputs to the A/D converter.
Port 1:
• A is a quasi-bidirectional I/O port. The word “quasi-bidirectional” means that the port pin has a
weak internal pull up that is always active and an internal pull-down than can be on/off.
• The pin’s logic level can be controlled by an external pull-down if the internal pull-down is left off.
(i.e. a 1 is written).
• A quasi-bidirectional port will source current if externally held it. It will pull itself high if it is left
unconnected.
• If the processor writes to the pins of a quasi-bidirectional port it actually writes into the register
that drives the port pin.
• If the port pin is to be used as an input then the software must write a one to SFR bit. This causes
the low impedance pull down device to turn off and leave the pin pulled with a high impedance
pull up device that can be driven by the device that drives the input.
Fig. 2.5: I/O Control Register 0 (IOC0) Fig. 2.6: I/O Control Register 1 (IOC1)
Fig. 2.7: I/O Status Register 0 (IOS0) Fig. 2.8: I/O Status Register 1 (IOS1)
Addressing Modes: The 8096-instruction set supports six addressing modes. They are
• Immediate addressing mode
• Register direct addressing mode
• Indirect addressing mode
• Indirect with auto increment mode
• Short indexed mode
• Long indexed mode.
These addressing modes increase the flexibility and overall execution speed of 8096 controller. Each
instruction uses at least one of the addressing modes. The register, direct and immediate addressing
modes execute faster than the other addressing modes. Both of the indirect addressing modes use the
value in a word register as the address of the operand. The indirect auto increment mode increments a
word address by one after a byte operation and two after a word operation.