Microcontroller Ab Manual New
Microcontroller Ab Manual New
MicroController LAB
(18ECL47)
B.E –IV Semester
Name :
USN :
Batch : Section :
1
VISION OF THE INSTITUTE
2
Electronics & Communication Engineering
Department
VISION
To excel in Electronics and Communication Engineering with social
responsibility and to moulding the graduates to face the global
challenges.
MISSION
M1: To impart quality education through advanced teaching and
learning aids facilitating the students to develop technical skills
through innovative ideas and their implementation.
M2: To Build competence through hands - on experience using state of
the art technology with the help of Industry- institute partnership.
M3: To guide the students to become responsible citizens of the
nation by inculcating ethical and moral values through
participation in Social activities.
3
INDEX
Laboratory Experiments:
1 LED 42-44
2 Transmit and Receive Set of Characters 45-47
3 ADC Interface 48
4 LCD Display 49-51
5 Stepper Motor 52
6 ADC 0804 53-54
VIVA Questions 55-57
4
B. E. (EC / TC)
Choice Based Credit System (CBCS) and Outcome Based Education (OBE)
Subject Code 18ECL47 IA Marks 40
Number of Lecture Hours/Week : 01Hr Tutorial (Instructions)+ 02 Hours
Laboratory=03
Exam Marks 60
Laboratory Experiments
I. PROGRAMMING
1. Data Transfer: Block Move, Exchange, Sorting, Finding largest element in an
array.
2. Arithmetic Instructions - Addition/subtraction, multiplication and division, square,
Cube – (16 bits Arithmetic operations – bit addressable).
3. Counters.
4. Boolean & Logical Instructions (Bit manipulations).
5. Conditional CALL & RETURN.
6. Code conversion: BCD – ASCII; ASCII – Decimal; Decimal - ASCII; HEX -
Decimal and Decimal -HEX.
7. Programs to generate delay, Programs using serial port and on-Chip timer/counter.
II. INTERFACING
1. Interface a simple toggle switch to 8051 and write an ALP to generate an interrupt
which switches on an LED (i) continuously as long as switch is on and (ii) only once
for a small time when the switch is turned on.
2. Write a C program to (i) transmit and (ii) to receive a set of characters serially by
interfacing 8051 to a terminal.
3. Write ALPs to generate waveforms using ADC interface.
4. Write ALP to interface an LCD display and to display a message on it.
5. Write ALP to interface a Stepper Motor to 8051 to rotate the motor.
6. Write ALP to interface ADC-0804 and convert an analog input connected to it.
5
Department of Electronics & Communication
Engineering
MicroController Lab
Course Outcome
On the completion of this laboratory course, the students will be able to:
• Interface different input and output devices to 8051 and control them using
Assembly language
programs.
• Interface the serial devices to 8051 and do the serial transfer using C programming.
6
‘Safety precautions / Do’s and Dont’s’
7
INTRODUCTION
8
TO WRITE A PROGRAM IN DOS
2. cd \ enter
3. cd xpo31 enter
5. c:\xpo31\asm\edit enter
11. (If errors are found then go to editor by typing EDIT filename.asm)
13. Give any filename other than already used name for the main program. Then
press ok.
9
21. Give strat adderss (ex 6000) enter. Then give end adderss (ex 6800) enter.
27. Choose appropriate location ( such as internal, external, gen register etc as per
your program)
10
1 : Data Transfer Programming
Result:
11
B. WALP to interchange the content of RAM location to ROM
location.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV DPTR, #5000H
MOV R1, #30H
MOV R2, #05H
UP: MOVX A,@DPTR
XCH @R1, A
MOVX @DPTR, A
INC DPTR
INC R1
DJNZ R2, UP
RET
Result:
Before Execution
30H<=0FH 5000H<=01H
31H<=0EH 5001H<=02H
32H<=0DH 5002H<=03H
33H<=0CH 5003H<=04H
34H<=0BH 5004H<=05H
After Execution
30H<=01H 5000H<=0FH
31H<=02H 5001H<=0EH
32H<=03H 5002H<=0DH
33H<=04H 5003H<=0CH
34H<=05H 5004H<=0BH
12
C. WALP to find largest in a given array.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV R1, #30H
MOV R2, 50H (Length of a array)
MOV R0, #00H
AGAIN: MOV A,@R1
MOV 30H, R0
CJNE A, 30H, DOWN
SJMP SKIP
DOWN: JC SKIP
MOV R0, A
SKIP: INC R1
DJNZ R2, AGAIN
RET
Result:
50H=05H
After Execution
30H<=08H
31H<=05H
32H<=0AH
33H<=10H
34H<=01H
13
D. WALP to find smallest in a given array.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV R1, #30H
MOV R2, 50H (Length of a array)
MOV R0, #0FFH
AGAIN: MOV A,@R1
MOV 30H, R0
CJNE A, 30H, DOWN
SJMP SKIP
DOWN: JNC SKIP
MOV R0, A
SKIP: INC R1
DJNZ R2, AGAIN
RET
Result:
50H=05H
After Execution
30H<=08H
31H<=05H
32H<=01H
33H<=10H
34H<=0AH
14
E. WALP to set the given array in ascending order.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV R3, #05H
UP: MOV DPTR, #5000H
MOV R2, #04H
AGAIN: MOV R1, 82H
MOVX A,@DPTR
MOV 30H, A
INC DPTR
MOVX A,@DPTR
CJNE A, 30H, DOWN
SJMP SKIP
DOWN: JNC SKIP
MOV 82H, R1
MOVX @DPTR, A
INC DPTR
MOV A, 30H
MOVX @DPTR, A
SKIP: DJNZ R2, AGAIN
DJNZ R3, UP
RET
Result:
Before Execution After Execution
5000H<=08H 5000H<=01H
5001H<=01H 5001H<=02
5002H<=02H 5002H<=05H
5003H<=09H 5003H<=08H
5004H<=05H 5004H<=09H
15
F.WALP to set the given array in descending order.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV R3, #05H
UP: MOV DPTR, #5000H
MOV R2, #04H
AGAIN: MOV R1, 82H
MOVX A,@DPTR
MOV 30H, A
INC DPTR
MOVX A,@DPTR
CJNE A, 30H, DOWN
SJMP SKIP
DOWN: JC SKIP
MOV 82H, R1
MOVX @DPTR, A
INC DPTR
MOV A, 30H
MOVX @DPTR, A
SKIP: DJNZ R2, AGAIN
DJNZ R3, UP
RET
Result:
Before Execution After Execution
5000H<=08H 5000H<=09H
5001H<=01H 5001H<=08H
5002H<=02H 5002H<=05H
5003H<=09H 5003H<=02H
5004H<=05H 5004H<=01H
16
2. Arithmetic Instructions
CPU” 8051.TBL”
HOF”INT8”
ORG 6000H
CLR C
MOV A, #17H
ADD A, #12H
MOV R0,A
MOV A,#15H
ADD A,#13H
MOV R1,A
RET
Result:
After Execution
R0<= 17H+12H R1<= 15H+13H
00010111 00010101
+00010010 +00010011
------------------------------------------------
00101001 00101000
R0<=29H R1<=28H
1517H+ 1312H=2829H
17
B. Write an ALP to SUBB two 16-bit numbers.
CPU” 8051.TBL”
HOF”INT8”
ORG 6000H
CLR C
MOV A, #17H
SUBB A, #12H
MOV R0,A
MOV A,#15H
SUBB A,#13H
MOV R1,A
RET
RESULT : R1 = 02 R0 = 05
00010111 00010101
-00010010 -00010011
------------------------------------------------
00000101 00000010
1517H- 1312H=0205H
18
C. WALP to multiply two 8-bit numbers.
CPU”8051.TBL”
HOF”INT8”
ORG 6000H
MOV A, 30H
MOV 0F0H, 31H
MUL AB
MOV 35H, A
MOV 36H, 0F0H
RET
Result:
Before Execution: After Execution:
19
D. WALP to divide two 8-bit numbers.
CPU“8051.TBL”
HOF“INT8”
ORG 6000H
MOV A, 30H
MOV 0F0H, 31H
DIV AB
MOV 35H, A
MOV 36H, 0F0H
RET
Result:
Before Execution: After Execution:
20
E. WALP to find square of the given number.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV A, 30H
MOV 0F0H, A
MUL AB
MOV 35H, A
MOV 36H, 0F0H
RET
Result:
Before Execution After Execution
35H<= 00H
36H<=01H
21
F. WALP to find the cube of a given number.
CPU“8051.TBL”
HOF“INT8”
ORG 6000H
MOV A, 30H
MOV 0F0H, A
MUL AB
MOV 0F0H, 30H
MUL AB
MOV 35H, A
MOV 36H, 0F0H
RET
Result:
Before Execution After Execution
(27)10= (1B)16
35H<= 1BH
36H<= 00H
22
3.Counters.
A. WALP to generate binary up-counter.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV A, #00H
UP: LCALL 061DH
MOV R3, A
MOV R4, #00H
MOV R5, #02H
LCALL 059EH
ADD A, #01H
CJNE A, #00H, UP
RET
Result:
After Execution
00
01
.
.
.
FC
FD
FE
FF
23
B. WALP to generate binary down-counter.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV A, #0FFH
UP: LCALL 061DH
MOV R3, A
MOV R4, #00H
MOV R5, #02H
LCALL 059EH
SUBB A, #01H
CJNE A, #0FFH, UP
RET
Result:
After Execution
FF
FE
FD
FC
.
.
.
04
03
02
01
00
24
C. WALP to generate BCD up counter.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV A, #00H
UP: LCALL 061DH
MOV R3, A
MOV R4, #00H
MOV R5, #02H
LCALL 059EH
ADD A, #01H
DA A
CJNE A, #00H, UP
RET
Result:
After Execution
00
01
02
03
.
.
.
96
97
98
99
25
D. WALP to generate BCD down counter.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV A, #99H
UP: LCALL 061DH
MOV R3, A
MOV R4, #00H
MOV R5, #02H
LCALL 059EH
ADD A, #99H
DA A
CJNE A, #99H, UP
RET
Result:
After Execution
99
98
97
96
.
.
.
4
3
2
1
26
4. Boolean & Logical Instructions
A. WALP to COUNT number of 1’s & 0’s in a number.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV R2, #08H
MOV A, 30H
MOV R0, #00H
MOV R1, #00H
CLR C
UP: RRC A
JNC GO
INC R1
SJMP LAST
GO: INC R0
LAST: DJNZ R2, UP
RET
Result:
Before Execution After Execution
27
B. WALP to find even & odd from given array.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV 0D0H, #00H
MOV DPTR, #5000H
MOV R0, #30H
MOV R1, #20H
MOV R3, #05H
UP: MOVX A,@DPTR
RRC A
JNC NEXT
MOVX A,@DPTR
MOV @R1, A
INC R1
SJMP SKIP
NEXT: MOVX A,@DPTR
MOV @R0, A
INC R0
SKIP: INC DPTR
DJNZ R3, UP
RET
Result:
Before Execution After Execution
28
Even:
Even: Odd:
30H<= 06H 20H<=05H
31H<= 08H 21H<= 07H
22H<= 09H
29
C. WALP to find positive & negative from given array.
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV 0D0H, #00H(clear the PSW)
MOV DPTR, #5000H
MOV R0, #30H
MOV R1, #20H
MOV R3, #05H
UP: MOVX A,@DPTR
RLC A
JNC NEXT
MOVX A,@DPTR
MOV @R1, A
INC R1
SJMP SKIP
NEXT: MOVX A,@DPTR
MOV @R0, A
INC R0
SKIP: INC DPTR
DJNZ R3, UP
RET
Result:
Before Execution After Execution
5000H<= FFH 5000H<= FFH
5001H<= 08H 5001H<= 08H
5002H<= 80H 5002H<= 80H
5003H<= 05H 5003H<= 05H
5004H<= 16H 5004H<= 16H
Negative: FF <= 1 1 1 1 1 1 1 1
08 <= 0 0 0 0 1 0 0 0
80 <= 1 0 0 0 0 0 0 0
05 <= 0 0 0 0 0 1 0 1
16 <= 0 0 0 1 0 1 1 0
30
30H<= FFH
31H<= 80H
Positive:
20H<= 08H
21H<= 05H Negative: FF & 80
22H<= 16H Positive: 08, 05 & 16
Negative: Positive:
30H<= FFH 20H<=08H
31H<= 80H 21H<= 05H
22H<= 16H
31
Method-1: Method-2 (using logical
instrucn):
Result:
Before Execution After Execution
30H=85 R0<= 85H
R1<= 08H
R2<= 05H
32
Method-1: Method-2:
CPU “8051.TBL” CPU “8051.TBL”
HOF “INT8” HOF “INT8”
ORG 6000H ORG 6000H
MOV R0,30H MOV R0,30H
MOV R1,31H MOV R1,31H
MOV A, R0 MOV A, R0
MOV 0F0H, #10H SWAP A
MUL AB ADD A, R1
ADD A, R1 MOV R2, A
MOV R2, A RET
RET
Result:
Before Execution After Execution
33
6.Code conversion
A. WALP to convert BCD to ASCII.
34
CPU “8051.TBL”
HOF “INT8”
ORG 6000H
MOV DPTR, #5000H
MOVX A,@DPTR
CLR C
ADDC A, #30H
INC DPTR
MOVX @DPTR, A
RET
Result:
Before Execution After Execution
35
HOF “INT8”
ORG 6000H
MOV DPTR, #5000H
MOVX A,@DPTR
CLR C
SUBB A, #30H
INC DPTR
MOVX @DPTR, A
RET
Result:
Before Execution After Execution
36
HOF “INT8”
ORG 6000H
MOV R1, #50H
MOV A,@R1
CLR C
SUBB A, #41H
MOV A,@R1
JC SKIP
CLR C
SUBB A, #07H
SKIP: CLR C
SUBB A, #30H
INC R1
MOV @R1, A
RET
Result:
Before Execution After Execution
50H<= 38H 50H<= 38H
51H<= 38-30= 08H
37
HOF “INT8”
ORG 6000H
MOV A, 20H
ANL A, #0F0H
SWAP A
MOV 0F0H, #0AH
MUL AB
MOV R2, A
MOV A, 20H
ANL A, #0FH
ADD A, R2
MOV R0, A
RET
Result:
Before Execution After Execution
38
7.Programs to generate delay, Programs using serial port and on-
Chip timer/counter.
mov tmod,#02h
mov th0,#00h
clr P1.0
clr a
setb tr0
again: mov r7,#0ffh
loop: mov r6,#14d
wait: jnb tf0, wait
clr tf0
djnz r6,wait
djnz r7,loop
cpl P1.0
sjmp again
end
RESULT:
Accumulator A is incremented in binary from 00, 01,02…09,0A, 0B, …, 0F,
10, 11, …FF every 1 second (for 33MHz clock setting & every 3 seconds for
11.0598MHz)
39
Part B Interfacing programs.
Step 1- communication
Port-com 4[ ref your system]
Baud rate: 9600
Device : 89C51RD2XX
Interface : none(ISP)
Oscillator frequency(MHZ):16
40
Step 2: Error
Click on blocks
Step 3: HEX file
Hex file ------Browse ( C:BC:Filename.Hex)
Click on start.
Do you want to continue—yes
Then blocks are erased. Finished .
After the execution white bar in kit move left.
Press reset on kit.
41
1.Interface a simple toggle switch to 8051 and
write an ALP to generate an interrupt which
switches on an LED
ACALL WAIT
SJMP START
DJNZ R3,WAIT2
DJNZ R4,WAIT1
RET
42
ii. only once for a small time when the switch is turned ON
ACALL WAIT
CPL P1.0
CPL P1.1
ACALL WAIT
CPL P1.1
SJMP START
DJNZ R3,WAIT2
DJNZ R4,WAIT1
43
RET
2. Write a C program to (i) transmit and (ii) to receive a set of characters serially
by interfacing 8051 to a terminal.
/* This program is used to send ny charater from hyperterminal and show that char on
LED's
44
It is demonstration of serial communiction */
#include <89c51rd2.H>
#define LCD_RS P3_5 // LCD RS Pin
#define LCD_E P2_7 // LCD Enable Pin
#define LCDDATA P0 // LCD Data Lines
45
}//end of for
//P2=0X00;
//P0=0X00;
//P1=0X00;
//P3=0X00;
lcdins(0x30); /* Output $30 as the Command */
lcdins(0x30); /* Output $30 as the Command */
lcdins(0x30); /* Output $30 as the Command */
lcdins(0x18); /* Send 8 Bit, 1 Line Instruction */
lcdins(0x0c); /* Turn the Display On */
lcdins(0x01); /* Clear the Display RAM */
lcdins(0x06); /* Set the Entry Mode */
while(1)
{
P3_4=0;
// lcdins(0x80); /*Move the LCD pointer to Start of Line 1*/
if (RI)
{
RI=0;
d = SBUF;
TI = 0; /* clear interrupt request flag */
SBUF = d; /* read character */
// P0 = d;
lcdins(0x80); /*Move the LCD pointer to Start of Line 1*/
lcdchar(d);
for ( i = 0; i < 30000; i++) { /* Delay for 10000 Counts */
wait();
}
for ( i = 0; i < 30000; i++) { /* Delay for 10000 Counts */
wait();
}
46
}
}
}
47
CPU"8051.TBL"
HOF"INT8"
P0: EQU 80H
P1: EQU 90H
P2: EQU 0A0H
P3: EQU 0B0H
R0: EQU 00H
R1: EQU 01H
R2: EQU 02H
R3: EQU 03H
R4: EQU 04H
R5: EQU 05H
R6: EQU 06H
R7: EQU 07H
DPL: EQU 82H
DPH: EQU 83H
ORG 0000H
STRT:
MOV P2,#00H ;PORT2
MOV P1,#00H ;PORT1
MOV P3,#00H ;PORT3
MOV P0,#00H ;PORT0
OUTPUT:
MOV P0, #00H ; Send low signal On P0
LCALL DELAY ; Delay
MOV P0, #0FFH ; Send high signal On P0
LCALL DELAY
HERE: NOP
SJMP OUTPUT ; loop again
DELAY:
MOV R1,#0FFH ; delay
DLY1: MOV R2,#0FFH
DLY2: MOV R3,#10H
DLY3: NOP
DJNZ R3,DLY3
DJNZ R2,DLY2
DJNZ R1,DLY1
RET
END
48
This program will display letter 'A' on LCD.
CPU"8051.TBL"
HOF"INT8"
P0: EQU 80H
P1: EQU 90H
P2: EQU 0A0H
P3: EQU 0B0H
R0: EQU 00H
A: EQU 0E0H
B: EQU 0F0H
LCDRS: EQU 0B5H
LCDE: EQU 0B3H
LCDRW: EQU 0B4H
BF: EQU 087H
ORG 0000H
49
mov A,#018h ; Send 8 Bit, 1 Line Instruction
ACALL LCDINS
mov A,#0Fh ; Turn the Display On
ACALL LCDINS
mov A,#01h ; Clear the Display RAM
ACALL LCDINS
mov A,#06h ; Set the Entry Mode
ACALL LCDINS
Acall Dlay ; Wait 100 msec before Initializing
the LCD
LOOP: mov A,#080h ; Move the LCD pointer to
Start of Line 1
Acall LCDINS
MOV A,#41H ; Ascii Value of char "A"
Acall LCDCHAR ; Display it
ACALL DLAY
LOOP1: NOP
Ajmp Loop
Dlay: ; Delay 100 msecs
mov Count,#0 ; Load the 100 msec Delay
mov Counthi,#0FFH
DlayLoop: ; Loop Here for 100
msec
djnz Count,DlayLoop
djnz Counthi,DlayLoop
ret
LCDINS: ; Output the LCD
Command
CLR LCDRS
SETB LCDRW
SETB LCDE
BACK:
JB BF,BACK
ACALL DLAY150
CLR LCDRS
50
CLR LCDRW
ACALL DLAY150
MOV P0,A
ACALL DLAY150
CLR LCDE
ACALL DLAY150
MOV A,#0FFh
MOV P0,A
ACALL DLAY150
RET
LCDCHAR: ; Output the LCD Command
CLR LCDRS
SETB LCDRW ;/* set RS */
SETB LCDE ;/* Set Enable */
BK1:
JB BF,BK1
SETB LCDRS
CLR LCDRW
MOV P0,A
ACALL DLAY150
CLR LCDE
ACALL DLAY150
MOV A,#0FFh
MOV P0,A
ACALL DLAY150
RET
Dlay150: ; 150 usec Dlay
mov Count,#0FFH ; Delay 116 usecs
Dlay150Loop:
djnz Count,Dlay150Loop
ret
51
ORG 0H
MAIN:SETB P2.7
MOV A,#66H
MOV P1,A
TURN:
JNB P2.7 , CW
RR A
ACALL DELAY
MOV P2, A
SJMP TURN
CW: RL A
ACALL DELAY
MOV P1, A
SJMP TURN
DELAY:
MOV R2,#100
H1: MOV R3,#255
H2: DJNZ R3,H2
DJNZ R2,H1
RET
END
52
ORG 00H
END
53
Viva Questions
1. What do you mean by Embedded System? Give examples.
2. Why are embedded Systems useful?
3. What are the segments of Embedded System?
4. What is Embedded Controller?
5. What is Microcontroller?
6. List out the differences between Microcontroller and Microprocessor.
7. How are Microcontrollers more suitable than Microprocessor for Real Time
Applications?
8. What are the General Features of Microcontroller?
9. Explain briefly the classification of Microcontroller.
10. Explain briefly the Embedded Tools.
11. Explain the general features of 8051 Microcontroller.
12. How many pin the 8051 has?
54
13. Differentiate between Program Memory and Data Memory.
14. What is the size of the Program and Data memory?
15. Write a note on internal RAM. What is the necessity of register banks? Explain.
16. How many address lines are required to address 4K of memory? Show the
necessary calculations.
17. What is the function of accumulator?
18. What are SFR’s? Explain briefly.
19. What is the program counter? What is its use?
20. What is the size of the PC?
21. What is a stack pointer (SP)?
22. What is the size of SP?
23. What is the PSW? And briefly describe the function of its fields.
24. What is the difference between PC and DPTR?
25. What is the difference between PC and SP?
26. What is ALE? Explain the functions of the ALE in 8051.
27. Describe the 8051 oscillator and clock.
28. What are the disadvantages of the ceramic resonator?
29. What is the function of the capacitors in the oscillator circuit?
30. Show with an example, how the time taken to execute an instruction can be
calculated.
31. What is the Data Pointer register? What is its use in the 8051?
32. Explain how the 8051 implement the Harvard Architecture?
33. Explain briefly the difference between the Von Neumann and the Harvard
Architecture.
34. Describe in detail how the register banks are organized.
35. What are the bit addressable registers and what is the need?
36. What is the need for the general purpose RAM area?
37. Write a note on the Stack and the Stack Pointer.
38. Why should the stack be placed high in internal RAM?
39. Explain briefly how internal and external ROM gets accessed.
40. What are the different addressing modes supported by 8051 Microcontroller ?
41. Explain the Immediate Addressing Mode.
42. Explain the Register Addressing Mode.
43. Explain the Direct Addressing Mode.
44. Explain the Indirect Addressing Mode.
45. Explain the Code Addressing Mode.
46. Explain in detail the Functional Classification of 8051 Instruction set
47. What are the instructions used to operate stack?
48. What are Accumulator specific transfer instructions?
49. What is the difference between INC and ADD instructions?
50. What is the difference between DEC and SUBB instructions?
51. What is the use of OV flag in MUL and DIV instructions?
52. What are single and two operand instructions?
53. Explain Unconditional and Conditional JMP and CALL instructions.
54. Explain the different types of RETURN instructions.
55. What is a software delay?
56. What are the factors to be considered while deciding a software delay?
57. What is a Machine cycle?
58. What is a State?
59. Explain the need for Hardware Timers and Counters?
55
60. Give a brief introduction on Timers/Counter.
61. What is the difference between Timer and Counter operation?
62. How many Timers are there in 8051?
63. What are the three functions of Timers?
64. What are the different modes of operation of timer/counter?
65. Give a brief introduction on the various Modes.
66. What is the count rate of timer operation?
67. What is the difference between mode 0 and mode 1?
68. What is the difference Modes 0,1,2 and 3?
69. How do you differentiate between Timers and Counters?
70. Explain the function of the TMOD register and its various fields?
71. How do you control the timer/counter operation?
72. What is the function of TF0/TF1 bit
73. Explain the function of the TCON register and its various fields?
74. Explain how the Timer/Counter Interrupts work.
75. Explain how the 8051 counts using Timers and Counters.
76. Explain Counting operation in detail in the 8051.
77. Explain why there is limit to the maximum external frequency that can be
counted.
78. What’s the benefit of the auto-reload mode?
79. Write a short note on Serial and Parallel communication and highlight their
advantages and disadvantages.
80. Explain Synchronous Serial Data Communication.
81. Explain Asynchronous Serial Data Communication.
82. Explain Simplex data transmission with examples.
83. Explain Half Duplex data transmission with examples.
84. Explain Full Duplex data transmission with examples.
85. What is Baud rate?
86. What is a Modem?
87. What are the various registers and pins in the 8051 required for Serial
communication? Explain briefly.
88. Explain SCON register and the various fields.
89. Explain serial communication in general (synchronous and asynchronous). Also
90. Explain the function of the PCON register during serial data communication.
56
104. Briefly describe the Interrupt structure in the 8051.
105. Explain about vectored and non-vectored interrupts in general.
106. What are the five interrupts provided in the 8051?
107. What are the three registers that control and operate the interrupts in 8051?
108. Describe the Interrupt Enable (IE) special function register and its various
bits.
109. Describe the Interrupt Priority (IP) special function register and its need.
110. Explain in detail how the Timer Flag interrupts are generated.
111. Explain in detail how the Serial Flag interrupt is generated.
112. Explain in detail how the External Flag interrupts are generated.
113. What happens when a high logic is applied on the Reset pin?
114. Why the Reset interrupt is called a non-maskable interrupt?
115. Why do we require a reset pin?
116. How can you enable/disable some or all the interrupts?
117. Explain how interrupt priorities are set? And how interrupts that occur
simultaneously are handled.
118. What Events can trigger interrupts, and where do they go after getting
triggered?
119. What are the actions taken when an Interrupt Occurs?
110. What are Software generated interrupts and how are they generated?
111. What is RS232 and MAX232?
112. What is the function of RS and E pins in an LCD?
113. What is the use of R/W pin in an LCD?
114. What is the significance of DA instruction?
115. What is packed and unpacked BCD?
116. What is the difference between CY and OV flag?
117. When will the OV flag be set?
118. What is an ASCII code?
57