Assignment Micro PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

You have to make the following embedded system using 8051 Microcontroller and do the programming in C-Language.

1. Built in test

4 inputs are connected to P1.0 to P1.3 pins of controller. When 8051 will start it will check these lines individually. If
signal is high at any of the pins do the following:

P1.0 high => Print “System 1 Faulty” on LCD

P1.1 high => Print “System 2 Faulty” and so on.

If no pin is high than print all systems are OK on LCD.

The LCD is connected to Port 0 and remaining pins of P1 (i.e. P1.4 to P1.7)

2. Wait for 3 Seconds

Use different set of instructions to create a delay of 3 seconds. During this time the display of LCD should be
shown as 3 sec, 2 sec, 1 sec after each passing second. Finally after 3 seconds it should display system ready.

3. Use of Timer/Counter
Now set Timer 0 in counter mode such a way that the program waits for 8 pulses to arrive. Once 8 pulses are
arrived. Send message on LCD “8 Pulses Arrived”.

4. Getting data from port 2


Now you have to get 4 bytes of data from port 2. Hence wait for P1.0 to be high, when it is high send 00 to P3.6
and P3.7 and read data from Port 2 and save it. Now wait for P1.1 to be high, when it is high send 01 to P3.6 and
P3.7 and read data from Port 2 and save it. Repeat the process for P1.2 and P1.3 to be high. Hence, at the end
you will have four bytes. It is to be ensured that in program you have to ensure that you have to declare P1.0
(P1.1, P1.2 and P1.3) declared 1 if it remains one for at least 20 msec.
5. Making a data block and send it on serial link

Now you have to make a data block of 8 Byte as under:

5A, 6B, 7C , 4 bytes of data gathered in step 5. The last byte will be XOR of all 7 previous bytes.

Once this block is ready send each byte if the block serially one by one using serial port at a Baud rate of 9600
and a protocol of 1 start bit 8 data bits and 1 stop bit.

Repeat the program from step 3 for ever.

Page 1 of 1

You might also like