8051 LAB Assignment Questions
8051 LAB Assignment Questions
8051 LAB Assignment Questions
Depending on the number of times the sw pressed the 1st time, LED 0 should be ON only,
the 2nd time, LED 1 should be ON only,
the 3rd time, LED 2 should be ON only,
the 4th time, LED 3 should be ON only,
If pressed here after none should be ON until system reset .
70. Read the status of all momentary switches SWs connected to PORT 0 and display
their status of being pressed on corresponding LEDS connected to PORT 2
infinitely.
71. Read the status of 4 momentary switches SWs connected to lower nibble of
PORT 0 and display their status on an LED connected to P2.0 only.
10ms.Write the program for infinitely creating a pulse width of 10ms P0.7.
84. Assuming that XTAL=12MHz,write a program to generate a square wave of 2KHz
frequency on P0.6.
Solution:
T = 1/f = 1/2kHz = 500us the period of square wave
of it for high and low portions of the pulse is 250us
250us/1us=250 and 65536 250 = 65286(convert to hex).
Load TLX and THX
85. Write an embedded C program to count pulse inputs at the pin T1.
Serial Comunication
86.
Write an ALP to serially transmit the message Welcome to VECTOR on serial window/pc
hyper terminal window.
87.
Write an ALP to infinitely receive any character then re-transmit its ASCII value in decimal and
hex format. Output should be seen as for example below
Output: Received A 65 41
Received a 97 61
..
88.
Using the concept of multiple file assembly, assuming three files, say mainfile.asm,serial.asm
and delay.asm are edited as mentioned below
Mainfile.asm containes the main logic of the application which invokes routines from other files
Serial.asm - contains UART input and output routines
Delay.asm contains loop delay and timer delay routine
Write an ALP to show 00 99 secs counters on the serial window.
89.
90.
91.
Write an Emb-C program for demonstrating full duplex feature of UART in mode 1.
keypad status display on uart.
authentication status display on uart.
Interrupts
92.
Test with some form of visual outputs the response of the microcontroller to
various interrupt sources. Note : all interrupts
93.
Transmit a character when the external interrupt fired.