Aim:
To write a C program to transmit/receive the character using timer1 mode2,
operating at a baud rate of 9600 and display the character using UART

Algorithm:
Step1. Start the program
Step 2. Declare the header file
Step 3. Set the timer mode1 in mode 2
Step 4. Set the baud rate to9600
Step 5. Set the SCON register to 5
Step 6. Set the timers run bit
Step 7. Start transferring the letter until timer interrupt becomes one

Program:
Without Pointers
#include<reg51.h>
void main()
{
TMOD=0x20;
TH1=0xFD;
SCON=0x50;
TR1=1;
while(1)
{
SBUF='A';
while(TI==0);
TI=0;
}
}

With Pointers
#include<reg51.h>
char tx='A';
char *txp=&tx;
void transmit(char *tx)
{
SBUF=*tx;
while(TI==0);
TI=0;
}
void main()
{
TMOD=0x20;
TH1=0xFD;
SCON=0x50;
TR1=1;
while(1)
{
transmit(txp);
}}