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

Hi,

Following code is working fine with simulator but when I use the target debugging it hangs up after coming to
while(!TI)

#include <At89x51.h> /* For Atmel 89C51*/
#include <stdio.h>

void main (void)
{
/*------------------------------------------------
Setup the serial port for 9600 baud at 11.0592MHz.
------------------------------------------------*/

SCON = 0x52; /* SCON: mode 1, 8-bit UART, enable receive*/
TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
PCON &= 0x7F;
TH1 = 0xFD; /* TH1: reload value for 9600 baud @ 11.0592MHz */
RI = 1;
TI = 1;
TR1 = 1;
EA=1;

while (1)
{
TI = 0;
SBUF = 'A';
while (!TI);
P1 ^= 0xFF;
TI=0;
SBUF = 'B';
while (!TI);
TI=0;
SBUF = 'C';
while (!TI);
}
}

could you suggest any solution? I have installed monitor at 0xE800.

Thank you

0