Professional Documents
Culture Documents
11.State the function of RS1 and RS0 bits in the flag register of Intel 8051
microcontroller.
The RS1 and RS0 pins are to select the respective register banks in the
memory.
RS1 RS0 Bank Selection
0 0 Bank 0
0 1 Bank 1
1 0 Bank 2
1 1 Bank 3
Carry flag Auxilary Carry flag User Defined flag Overflow Flag
Parity flag
24.Write an 8051 ALP to toggle P1 a total of 200 times. Use RAM location
32H to hold your counter value instead of register R0 R7.
MOV DPTR, #0032H
MOV A,#200
L1: MOVX @DPTR,A
MOV P1,#00H
MOV P1,#FFH
DJNZ A, L1
L2: SJMP L2
UNIT-5
3CA
66R4
3C = 0 0 1 1 1 1 0 0
66 = 0 1 1 0 0 1 1 0
AND
0 1 1 0 0 1 1 0
OPERATION
2 4
Solution:- 24A
27.State how baud rate is calculated for serial data transfer in mode 1.
Timer 1 is used in timer mode 2 to generate baud rate for mode 1. The
formula
Where SMOD 7th bit of PCON register
fosc crystal oscillator frequency of the microcontroller
fosc
Timer 1 overflow frequency.
12[256(1)]
Eg: If standard baud rate is desired, then 11.0592 MHz crystal could be
selected. To get a standard 9600 baud rate, the setting of TH1 is calculated
as follows,