To develop the skills to interface 8051 microcontroller (AT89C51) to a computer via serial port, RS232. Visit Website

To develop the skills to interface 8051 microcontroller (AT89C51) to a computer via serial port, RS232.

 

Exp 08:- Aim: To develop the skills to interface 8051 microcontroller (AT89C51) to a computer via serial port, RS232.

Algorithm: 

  1. Initialize TMOD register with respective timer and its mode.
  2. Load the value in the timer register corresponding to the baud rate.
  3. Load SCON with 50H value indicating mode 1, 1 stop and start bit.
  4. Set the timer run bit.
  5. Load the character 'A' in SBUF.
  6. Start transmitting the data by setting the timer run bit.
  7. Check TI to determine whether the transmission process if completed.\]
  8. Repeat the process continuously.

Flowchart: 



Program:

#include <reg51.h>

void main (void)

{

TMOD =0X20;

TH1=0XFD;

SCON=0X50;

TR1=1;

while (1)

{

serial = ‘E’;

serial = ‘S’;

serial = ‘Y’;

while (TI= = 0);

TI=0;

}

}

 

 

 

/*Special function register declarations*/

/* for the intended 8051 derivative */

 

//Use Timer 1 , 8 bit auto reload

//9600 baud rate

 

 

 

//place a value in buffer

Conclusion: Hence we conclude that we developed and tested ‘C’ program to perform data transmission.













Post a Comment

Visit Website
Visit Website