writting Software UART 8051

hi, im trying to write a software UART , im simulating it in proteus and using a 8051 cpu , 89S52...

Code:
void main()
{

TMOD=0x20;
TH1=-3;
SCON=0x50;
TR1=1;

while (1)
{
unsigned char a;
a=0x41; // Send Characther A
P3_7=1; //
P3_7=0; // Start Bit
delayms(1);
for (i = 0; i < 8; i++) { // send the bits
 b[i] = a & 1; a = a >> 1;
 P3_7=b[i];  // Pin_3.7
delayms(1);
 }

i dont know but in the virtual terminal it should display the chracther A but it doesnt ... i dont know really why
 
many many thanks !!

i read ur article , can i've the C Code version ?
or at least the project ?
i wrote it and it worked , send me ur email and i will send u mine codes and analyze it ...
 
Last edited:
need software UART 8051

hi,

i need C code for software UART in 8051. because my task is i have to communicate the GSM modem with the 8051 microcontroller. for this i need to receive the message from the gsm and send the msg to the another one microcontroller. so i need two UART. i can communicate the GSM using hardware UART. but i need to communicate the another one microcontroller with this microcontroller by using software uart or any other ways?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…