I download intsio.zip and only changed some word in main.c as following:
void main (void) { com_initialize (); /* initialize interrupt driven serial I/O */ com_baudrate (38400); /* setup for 38400 baud */ printf ("Interrupt-driver Serial I/O Example\r\n\r\n"); while (1) { unsigned char c,cCmd,cCmdLen,i; c = getchar(); if (c == 0xaa) { c = getchar(); if (c == 0x55) { c = getchar(); if (c == '@') { c = getchar(); cCmd = c; c = getchar(); if ((c+cCmd) == 0xff) { cCmdLen = getchar(); for ( i = 0 ; i < cCmdLen ; i ++) { c = getchar(); printf("%c" ,c); } } } } } } }
"the main_loop would stop excuting when program runing in _getkey() while UART hadn't income data" That's the way the SIO example works - it's just doing what it says on the tin! If this is not the behaviour you require, you will have to change it to your requirements. Me, I created a rx_available() function to check if any received character(s) are available, then I call getchar() only if there's something to get. "the program would poll RI untill the data coming " Not if you're doing interrupt-driven serial IO! If your program really is doing this, it might explain your problem... "If i want communicating with ISR_driven and running others program when serial has no incoming data,how can i do?" See above.
"it's just doing what it says on the tin!" See: http://www.keil.com/support/man/docs/c51/c51__getkey.htm Which is consistent with Keil's other products: http://www.keil.com/support/man/docs/ca/ca__getkey.htm http://www.keil.com/support/man/docs/c166/c166__getkey.htm