Skip to content

Instantly share code, notes, and snippets.

@d-boz-wtwh
Created October 22, 2019 21:00
Show Gist options
  • Save d-boz-wtwh/e0897e8bb2c68e4bdd046c1ae29b6029 to your computer and use it in GitHub Desktop.
Save d-boz-wtwh/e0897e8bb2c68e4bdd046c1ae29b6029 to your computer and use it in GitHub Desktop.
Microcontroller Projects
#include<reg51.h>
void main()
{
char A[]="www.microcontroller-project.com";
unsigned int i=0;
P3=0x03; //Initializing 8051 UART
TMOD=0x20; // Timer1 Mode2 8 bit auto reload
TH1=0xFD; // 9600 bps
SCON=0x50; // 8 Data bit, 1 start bit, bit 1 stop
TR1=1; // Timer1 ON
while(1)
{
while(A[i]!='\0'){
SBUF=A[i]; // Placing character one by one in the serial buffer register
while(TI==0); // It automatically poles up to 1 when character is transmitted
TI=0;
i++;
}
i=0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment