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

DS89C4xx Error reading SBUF0

Why in this ISR I can't read the value of SBUF0? Always I read '00', but i can write what i want:

void serial (void) interrupt 4 using 1
{
unsigned char kk;
EA = 0;

if (RI_0)
{
RI_0=0;
kk=SBUF0;
flag = 1;
}

if (TI_0)
{
TI_0 = 0;
SBUF0 = kk;
}

EA = 1;
}

0