Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
70 views2 pages

8051 Microcontroller System Design

The document outlines an embedded system programming project using an 8051 microcontroller in C language. It involves: 1) Performing a built-in test of 4 input pins and displaying the results on an LCD. 2) Creating a 3 second delay to display countdown on LCD before showing "System Ready". 3) Using a timer counter to wait for 8 pulses before displaying a message. 4) Reading 4 bytes of data from port 2 based on the states of input pins. 5) Creating an 8 byte data block with identifiers, read data and checksum and transmitting it serially. 6) Repeating steps 3-5 indefinitely.

Uploaded by

Raees Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views2 pages

8051 Microcontroller System Design

The document outlines an embedded system programming project using an 8051 microcontroller in C language. It involves: 1) Performing a built-in test of 4 input pins and displaying the results on an LCD. 2) Creating a 3 second delay to display countdown on LCD before showing "System Ready". 3) Using a timer counter to wait for 8 pulses before displaying a message. 4) Reading 4 bytes of data from port 2 based on the states of input pins. 5) Creating an 8 byte data block with identifiers, read data and checksum and transmitting it serially. 6) Repeating steps 3-5 indefinitely.

Uploaded by

Raees Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

(Complex Engineering Problem)

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” on LCD 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


a. Use different set of instructions to create a delay of 3 seconds. During
this time the display of LCD should be shown as 3 secs, 2 secs, 1 sec
after each passing second.
b. 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 forever.

You might also like