Hello all,
For a home project I use the AT89C51RE2. I wrote some C code with Keil uVision3 to have this micro respond to serial interrupts via UART0. I used the internal baudrate generator and set it to 9600 baud. The interrupt function is something like: void call_ISR(void) interrupt 4. When using the uVision debugger/simulator, the debugger goes to the interrupt handler on a simulated interrupt. So far so good. Arriving at the code line with 'SBUF_0' the next step the debugger goes to the end of the interrupt handler and the content of SBUF_0 will not be read! What could be the cause of this??
Any help i will appreciate!
Max
compiler optimization...?
OK,
here is the ISR I wrote:
void call_ISR(void) interrupt 4 { while (RI_0 != 1) {
} RI_0 = 0;
switch(SBUF_0) { case 'S': P2 = 0x55; break;
default: break; } }
{ while (RI_0 != 1) {
dangerous code you'll hang forever if you get a TI
Erik