??? 06/08/06 04:12 Read: times |
#117996 - This could have problems Responding to: ???'s previous message |
void serial_IT(void) interrupt 4 { uchar echo; if(RI) { echo=SBUF; RI=0; SBUF=echo; while(!TI); TI=0; } } // Note the use on the pre and /pre tags You are waiting in the interupt for TI to complete. the RX UART data can be overwitten by the next incomming byte if it is not removed in time. If you can, put a delay between the bytes at the sender. Keil has a serial sample using interupts and independant ring buffers. That would be a great place to look. |