This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

serial communication in proteus via virtual terrminal

hi....
i want to send some strings serially using virtual terminal in proteus but i get garbage value on virtual terminal
can any one mail me proteus design for it on
hayatkhan015@yahoo.com
or
help me by some other way..

or there is some error in my program?
which is..

#include <reg51.h>
void Delay();
void serialsend(char *ptr);

void main ()
{ char z;
code char command1[]={"AT12"};
code char command2[]={"ATC51" };
code char command3[]={"ADSING"};
code char command4[]={"12"};
code char command5[]={"ATMEL"};
code char command6[]={"CIPSEND"};
code char command7[]={"GPRS"};
code char command8[]={"26"};
TMOD=0x20;
TH1=0xFD;
SCON=0x50;
TR1=1;
serialsend(command1);
Delay();
serialsend(command2);
Delay();
serialsend(command3);
for(z=0; z<3; z++)
{ Delay(); }
serialsend(command4);
Delay();
serialsend(command5);
for(z=0; z<10; z++)
{ Delay();
} serialsend(command6);
for(z=0; z<5; z++)
{ Delay(); }
serialsend(command7);
serialsend(command8);

}
void serialsend(char *ptr)
{ while(*ptr != '\0')
{ SBUF=*ptr;
while(TI==0);
TI=0;
ptr++;
} }

void Delay()
{ unsigned char x;
for(x=0; x<40; x++)
{ TMOD=0x01;
TL0=0xFD;
TH0=0x4B;
TR0=1;
while (TF0==0);
TR0=0;
TF0=0;
} }

0