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.
"anyway when stepping on asm, the R7 register remains to 0 while SBUF0 was 0x08" Are you using the correct Register Bank?
well I'm new to keil and 8051, I was assuming the C compiler is able to use correct banking, which becomes transparent to the programmer, at least at the C level !? Am I wrong ? Do I have to manage banking in C ?
"Am I wrong?" Yes "Do I have to manage banking in C?" Yes - see the using keyword extension, and the REGISTERBANK Control Directive