Question 10.16: Write an 8051 C program to transfer the message “YES” serial...

Write an 8051 C program to transfer the message “YES” serially at 9600 baud, 8-bit data, 1 stop bit. Do this continuously.

The blue check mark means that this solution has been answered and checked by an expert. This guarantees that the final answer is accurate.
Learn more on how we answer questions.
#include <reg51.h>
void SerTx(unsigned char);
void main(void){

TMOD=0x20;                    //use Timer 1, mode 2
TH1=0xFD;                        //9600 baud rate
SCON=0x50;
TR1=1;                                //start timer
while (1) {

SerTx(‘Y’);
SerTx(‘E’);
SerTx(‘S’);

}

}
void SerTx(unsigned char x){

SBUF=x;                       //place value in buffer
while (TI==0);             //wait until transmitted
TI=0;

}

Related Answered Questions

Question: 10.1

Verified Answer:

The machine cycle frequency of 8051 = 11.0592 / 12...
Question: 10.4

Verified Answer:

MOV   TMOD,#20H         ;timer 1,mode 2(auto reloa...
Question: 10.3

Verified Answer:

MOV    TMOD,#20H       ;timer 1,mode 2(auto reload...
Question: 10.2

Verified Answer:

MOV   TMOD,#20H         ;timer 1,mode 2(auto reloa...