Assignment Document

Microprocessor Interfacing & Programming - Assembly Code

Pages:

Preview:


  • "Microprocessor Interfacing & ProgrammingQ. The UART of an 8051 is to be tested for serial communication at different baud rates(9600, 4800, 2400, 1200). A piece of wire isData1 used to connect the Transmitter pin with thereceiver pin. To test th..

Preview Container:


  • "Microprocessor Interfacing & ProgrammingQ. The UART of an 8051 is to be tested for serial communication at different baud rates(9600, 4800, 2400, 1200). A piece of wire isData1 used to connect the Transmitter pin with thereceiver pin. To test the serial communicationlink a test message ‘Testing serial link’ is transmittedacross the serial link. The message received on thereceiver side is saved in RAM. Atthe end of the reception the originalmessage and the received message are compared toconfirm the working of the communication link. Thecommunication link can be tested at any baud rate byselecting any one of the four different baud rates withthe help of four switches connected to port 1. Connecting any one of the four switches tologic ‘H’ allows the corresponding baud rate to be configured. Write an 8051 assembly code which does the following? Configures the 8051 in one of the four baud rates by reading the Port 1 switch status.? Transmits and receives the test message.? Compares the transmitted and received message and turns on a green LED connectedto P1.7 if there is no error and a red LED connected to P1.6 if there is an error.Solution CODE: ORG OOHMOV P1,#0FFHMOV TMOD,#20HMOV SCON,#50HGO: JB P1.0, LABELJB P1.1,LABEL1JB P1.2,LABEL2JB P1.3,LABEL3SJMP GOLABEL: JB P1.1,GO JB P1.2,GO JB P1.3,GO MOV TH1,#0FDHSJMP SETLABEL1:JB P1.2,GO JB P1.3,GO MOV TH1,#0FAH SJMP SETLABEL2: JB P1.3,GO MOV TH1,#0F4H SJMP SETLABEL3:MOV TH1,#0E8H SJMP SET SET:SETB TR1MOV DPTR,#MYDATAAGAIN:CLR AMOVC A, @A+DPTRACALL SENDINC DPTRSMJP AGAINACALL RECVCLR AMOV A, #MYDATACJNE A, R0, NOT_EQUALMOV P1,#00HMOV P1.7, #1SJMP EXITNOT_EQUAL: MOV P1.6, #1EXIT: ENDSEND:MOV SBUF, ACHECK: JNB T1, CHECK CLR T1 RETRECV: JNB R1, RECV MOV A, SBUF CLR R1 RET "

Why US?

Because we aim to spread high-quality education or digital products, thus our services are used worldwide.
Few Reasons to Build Trust with Students.

128+

Countries

24x7

Hours of Working

89.2 %

Customer Retention

9521+

Experts Team

7+

Years of Business

9,67,789 +

Solved Problems

Search Solved Classroom Assignments & Textbook Solutions

A huge collection of quality study resources. More than 18,98,789 solved problems, classroom assignments, textbooks solutions.

Scroll to Top