Lab Reort # 6: TITLE: Serial Communication Between Microcontrollers. Components Required

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

LAB REORT # 6

TITLE: Serial communication between microcontrollers.


COMPONENTS REQUIRED:
1. AT89C51 Microcontroller (8051)
2. LCD
3. Battery
4. Ground

CODE:
Transmitter:
org 00h

mov TMOD, #20H

mov TH1, #-6

mov SCON, #50H

setb TR1

again: MOV A, #'Y'

acall trans

acall delay

mov A, #'E'

acall trans

acall delay

mov A, #'S'

acall trans

acall delay

SJMP AGAIN

trans: MOV SBUF, A

here: JNB TI, here

CLR TI

ret

delay: mov R3, #255

here1: mov R4, #255


here2: DJNZ R4, here2

DJNZ R3, here1

ret

end

Receiver:
org 00h

mov P1, #00H

clr P2.0

clr P2.1

clr P2.2

mov A, #38H

acall comnwrt

acall delay

MOV A, #0EH

acall comnwrt

acall delay

MOV A, #01H

acall comnwrt

acall delay

MOV A, #06H

acall comnwrt

acall delay

MOV A, #84H

acall comnwrt

mov TMOD, #20H

mov TH1, #-6

mov SCON, #50H

setb TR1

here: JNB RI, HERE

MOV A, SBUF

acall datawrt

clr RI

sjmp here
comnwrt: mov P1, A

CLR P2.0

CLR P2.1

SETB P2.2

acall delay

clr P2.2

ret

datawrt: mov P1, A

setb P2.0

clr P2.1

setb P2.2

acall delay

clr P2.2

ret

delay: mov R3, #255

here2: mov R4, #255

here1: djnz R4, here1

DJNZ R3, here2

ret

end

CIRCUIT DIAGRAM:
PRODECURE:
1. We opened the Keil software
2. We made New uVision Project.
3. We Saved the new project
4. We Selected AT89C51 after saving the project.
5. We created new file to write the code the code
6. Code is saved and we used .asm for saving it
7. We went to Project tab and then to Target for Option.
8. Change Frequency to 12 MHz
9. Click on the Generate Hex file.
10. Add code file to group source 1.
11. Built the Code and use the hex file for the project
12. We Open the Proteus.
13. Click the schematic capture.
14. Add all the required components from the library and place them in the Window.
15. Connect all the component according to circuit.
16. Connect LCD with port P1.
17. Connect TX, RX to RX, TX respectively
18. Add the Hex file into the Microprocessor by double clicking on it.
19. Simulate the circuit.

RESULT:
CONCLUSION:
We made serial communication between two microcontrollers.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy