Assignment 3
1. List specifications of 8051 microcontroller.
1) 8- bit data bus and 8- bit ALU.
2) 16- bit address bus – can access maximum 64KB of RAM and ROM.
3) On- chip RAM -128 bytes (Data Memory)
4) On- chip ROM – 4 KB (Program Memory)
5) Four 8-bit bi- directional input/output ports.( P0 P1 P2 P3 )
6) Programmable serial ports i.e. One UART (serial port)(RXD TXD)
7) Two 16- bit timers- Timer 0& Timer 1
8) Works on crystal frequency of 11.0592 MHz
9) Has power down and idle mode in microcontroller when no operation is
performed.
10) Six interrupts are available.
2. Compare address bus and data bus used in 8051.
Sr. No. Address Bus Data Bus
1 A bus that is used to A bus that is used to
specify a physical address transmit data
in memory among components
2 Unidirectional Bidirectional
3 Helps to transfer memory Helps to send and receive
address of data and I/O data
4 16 bit address bus in 8051 8 bit data bus in 8051
3. Define the term BUS related to microprocessor/controller and list
different buses used in microcontroller.
BUS: A Bus is a set of physical connections used for communication
between CPU andperipherals.
Different buses used in microcontroller are:
1. Address Bus
2. Data Bus
3. Control Bus
4. Compare data memory and program memory.
Sr.No . Program Memory(ROM) Data Memory (RAM)
1. It is used for storing It is used for storing
the hexadecimal codes of the temporaryvariable data
program to be executed i.e. and intermediate
Instructions. results
2. Program Memory of 8051 is Data Memory of 8051 is
4kB 128bytes
5. List SFRs in 8051. ( Special Function Registers )
1. ACC
2. B registers
3. DPH
4. DPL
5. Stack pointer SP
6. PSW : Program Status Word
7. Port P0
8. Port P1
9. Port P2
10. Port P3
11. Serial data buffer(SBUF ),
12. serial control (SCON)
13. TCON,
14. TMOD,
15. TL0
16. TL1,
17. TH0
18. TH1
19. Power control(PCON) ,
20. Interrupt Enable(IE),
21. Interrupt Priority(IP)
6. Draw the format of PSW register of 8051 microcontroller and
explain the function of eachbit.
1. CY: Carry flag.
This flag is set whenever there is a carry out from the D7 bit after an 8 bit
addition or subtraction. It can also be set to 1 or 0 directly by instructions
such as “SETB C” and CLR C”where “SETB C” stands for “set bit carry”
and “CLR C” for “clear carry”.
2. AC: Auxiliary carry flag
If there is a carry from D3 to D4 during an ADD or SUB operation, this bit
is set.
This flag is used by instructions that perform BCD (binary coded decimal)
arithmetic.
3. F0: Available to the user for general purposes.
4. RS0, RS1: Register bank selects bits
These two bits are used to select one of the four register banks from
internal RAM as shown in given table. The user can use only one bank of
register at one time. By default , bank 0 gets selected.
5. OV: Overflow flag
This flag is set whenever the result of a signed number operation is too
large, causing - order bit to overflow into the sign bit. In general, the carry
flag is used to detect errors in unsigned arithmetic operations. The overflow
flag is only used to detect errors in signed arithmetic operations.
6. P: Parity flag
The parity flag reflects the number of 1s in the A (accumulator) register
only. If the A register contains an odd number of 1s, then P=1. P=0 if A has
an even number of 1s.
7. Describe 8051 microcontroller as boolean processor.
8051 processor is a CPU that can perform some operation on a data
and gives the output.
The 8051 processor contains a complete Boolean processor for
single-bit operations.
The internal RAM contains 128 addressable bits, and the SFR space
supports up to 128other addressable bits.
All port lines are bit-addressable, and each can be treated as a
separate single-bit port.
The instructions that access these bits are not only conditional
branches but also a complete set of move, set, clear, complement,
OR, and AND instructions.
The 8051 instruction set is optimized for the one bit operations.
The Boolean processor provides direct support for bit manipulation
and testing of individual bit allows the use ofsingle bit variable to
perform logical operations therefore 8051 can be used to
solveBoolean expression. Bits may be set or cleared in a single
instruction.
Eg: 1) C means clear the carry bit
2) SETB 20h means set the memory bit with bit address
20H
8. Explain function of following pins of 8051
(i) Pin 31
(ii) Pin 29
(iii) Pin 21-28
i) Pin 31-EA :It is and active low I/P to 8051 microcontroller. When
(EA)= 0, then8051 microcontroller access from external program
memory (ROM) only. When (EA) = 1,then it access internal and
external program memories (ROMS).
ii) Pin 29- PSEN :This is an output pin. PSEN stands for “program store
enable.” It is activelow O/P signal. It is used to enable external program
memory (ROM). When [PSEN(bar)]=0, then external program memory
becomes enabled and micro controller read content ofexternal memory
location. Therefore it is connected to (OE) of external ROM.
iii) Pin 21-28: A8 – A15 :These pins are known as Port 2. It serves as I/O
port. Each pin isbidirectional Input /Output with internal pull – up resistors.
Besides the Input /Output, whenexternal memory is interfaced, PORT 2
pins act as the higher-order address bus. (A8-A15)
9. State the alternate pin functions of port 3 of 8051.
Pin Name Alternate Function
P3.0 RXD Serial input line
P3.1 TXD Serial output line
P3.2 INTO External interrupt 0
P3.3 INT1 External interrupt 1
P3.4 T0 Timer0 external input
P3.5 T1 Timer1 external input
P3.6 WR External data memory write strobe
P3.7 RD External data memory read strobe
10. Differentiate between
1)Harvard and Von-neuman architecture
2)Microprocessor and Microcontroller
Harvard Architecture and Von-neuman architecture
11. Microprocessor and Microcontroller
12. Sketch the internal memory organization in 8051.