| ??? 04/03/03 10:45 Read: times |
#42834 - Printf getchar getkey |
Hi,
encountered a problem. How can I receive serial data by interrupt and still have the fun of printf? I see no interrupt on my device (or response). serial communications works great for - printf("troela"); - getkey(); but the 'getkey()' holds the program execution. I need a buffered style input. The printf is only for debug info. No further use in the final application. Thanks. void SerialS0 (void) interrupt 4 using 1 { if (RI != 0) { RI = 0; LED_GREEN ^= 1; } if (TI != 0) { TI = 0; } } void InitSerialPort() { INT_DISABLE; TI = 0; TR1 = 0; ET1 = 0; PCON |= 0x80; SCON = 0x50; TMOD &= ~0xF0; TMOD |= 0x20 TH1 = 0xEF; 4800 Baud 16 Mhz TR1 = 1; SM0 = 0; SM1 = 1; SM2 = 0; REN = 1; TI = 1; } |
| Topic | Author | Date |
| Printf getchar getkey | 01/01/70 00:00 | |
| RE: Printf getchar getkey | 01/01/70 00:00 | |
| RE: Printf getchar getkey | 01/01/70 00:00 | |
| RE: Printf getchar getkey | 01/01/70 00:00 | |
| RE: Printf getchar getkey | 01/01/70 00:00 | |
| RE: Printf getchar getkey | 01/01/70 00:00 | |
| RE: Printf getchar getkey | 01/01/70 00:00 | |
| RE: Printf getchar getkey | 01/01/70 00:00 | |
RE: Printf getchar getkey | 01/01/70 00:00 |



