DEPARTMENT ELECTRICAL OF AND ELECTRONICS
ENGINEERING
B.E. Electrical and Electronics Engineering
Anna University Regulation: 2022
EE3317– Embedded C Programming
III Year / Vs Semester
Question Bank
Unit – III
Prepared by,
Mrs. J.Thilagavathy, AP/EEE
UNIT 3
TWO MARKS
1. Convert 3910 to binary
32 + 0 + 0 + 4 + 2 + 1 = 39
Therefore, 3910 = 100111
2. What are the features of 8051 microcontroller?
The 8051 is an 8-bit processor . The CPU can work on only 8 bits of data at a time .The 8051
had 128 bytes of RAM , 4K bytes of on-chip ROM, Two timers, One serial port,
Four I/O ports, each 8 bits wide 6 interrupt sources
3. What are the various 8051 family?
4. What are the various bank register in 8051?
5. Draw the Flag register of8051
6.What are the RAM allocation in 8051?
7.What is the use of PSW register?
PSW register Bits D4 and D3 of the PSW are used to select the desired register bank ¾ Use the
bit-addressable instructions SETB and CLR to access PSW.4 and PSW.3
8.What is stack pointer?
The register used to access the stack is called the SP (stack pointer) register .The stack pointer in
the 8051 is only 8 bit wide, which means that it can take value of 00 to FFH
9. What are to Operation in Stack?
i) The storing of a CPU register in the stack is called a PUSH . SP is pointing to the last used
location of the stack. As we push data onto the stack, the SP is incremented by one
ii) Loading the contents of the stack back into a CPU register is called a POP. With every pop,
the top byte of the stack is copied to the register specified by the instruction and the stack pointer
is decremented once
10. Examining the stack, show the contents of the register and SP after execution of the
following instructions. All value are in hex.
POP 3 ; POP stack into R3
POP 5 ; POP stack into R5
POP 2 ; POP stack into R2
11.List some conditional instruction in 8051.
JNB Jump if bit = 0
JB Jump if bit = 1
JNC Jump if CY = 0
JC Jump if CY = 1
CJNE reg,#data Jump if byte ≠ #data
CJNE A,byte Jump if A ≠ byte
DJNZ Decrement and Jump if A ≠ 0
JNZ Jump if A ≠ 0 J
12.What is machine cycle?
CPU executing an instruction takes a certain number of clock cycles . These are referred as to as
machine cycles
13. Find the period of the machine cycle.
for 11.0592 MHz crystal frequency Solution: 11.0592/12 = 921.6 kHz;
machine cycle is 1/921.6 kHz = 1.085μs
14. What are the Two factors can affect the accuracy of the delay ¾.
Crystal frequency - The duration of the clock period of the machine cycle is a function of this
crystal frequency .
8051 design -The original machine cycle duration was set at 12 clocks Advance
15.What are the Port 3 pins?
PART B
1. Explain about I/O Programming in 8051.
2. Explain Time delay using for loop and Special functions in 8051.
3. Write an 8051 C program to read the P1.0 and P1.1 bits and issue an ASCII character to P0
according to the following table.
P1.1 P1.0
0 0 send ‘0’ to P0
0 1 send ‘1’ to P0
1 0 send ‘2’ to P0
1 1 send ‘3’ to P0
4. Write an 8051 C program to convert packed BCD 0x29 to ASCII and display the bytes on P1
and P2.
5. Write an 8051 C program to calculate the checksum byte for the data 25H, 62H, 3FH, and
52H.
6. Write an 8051 C program to convert 11111101 (FD hex) to decimal and display the digits on
P0, P1 and P2.
7. Write a C program to send out the value 44H serially one bit at a time via P1.0. The LSB
should go out first.
8. Write a C program to send out the value 44H serially one bit at a time via P1.0. The MSB
should go out first.