08-13-2012 06:02 AM
in multisim10 i written a code to display "YES" on virtual terminal (serial terminal) but the virtual terminal showing some garbage characters.the code is as below.there r no compilation errors & no warnings. please suggest how to get required display.
void serTx(unsigned char);
void main()
{
SCON = 0x50;
TMOD = 0x20;
TH1 = 0xFD;
TR1 = 1;
TI = 1;
while(1)
{
serTx('Y');
serTx(10);
serTx(13);
serTx('E');
serTx(10);
serTx(13);
serTx('S');
serTx(10);
serTx(13);
}
}
void serTx(unsigned char x)
{
SBUF=x;
while(TI==0);
TI=0;
}
08-13-2012 06:24 AM
I'm not sure how accuratly Multisim emulates serial communications but when garbage characters come up in a real display, I usually look at the baud rate and make sure the sender and the receiver are set to the same speed.
08-13-2012 11:19 PM
i already set the baud rate 1200bps for both microcontroller & virtual terminal still output is arbitrary characters.