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

Simulation problem

Hi All,
When simulating an interupt from serial port RX0, I cannot succeed in affecting SBUF0 to a local variable, the watch window shows this variable to 0 even if SBUF0 is set.

Here is my code :

static void serial_port_0_isr (void) interrupt COM0_VECT
{
unsigned char data_received;
if (RI != 0)
{
RI = 0;
data_received = SBUF0;
...
}
}

on the above code, data_received is always 0 even if SBUF0 is set.
To set SBUF0, I use the serial port window from the simulator.

any idea would be appreciated.