| ??? 06/01/06 14:46 Read: times Msg Score: -1 -1 Didn't Search First |
#117520 - Interrupt driven Seril I/O |
i am facing a problem in interrupt driven serial i/o. follow is my code
#include<AT89X51.h> unsigned char data SEND=0; UART_ISR() interrupt 4 { if(TI==1)TI=0;} main() { TMOD=0x20h; TH1=0xFD; //9600 baud rate SCON=0x50; TR1=1; ES=1; EA=1; while(1) { SBUF=SEND; while(TI!=1){;} SEND++ } } though theorectically there is no problem. if i write code as follow than my requiremwnt is fulfilled. I comment ISR and disable Serial interrupt. #include<AT89X51.h> unsigned char data SEND=0; // UART_ISR() interrupt 4 { if(TI==1)TI=0;} main() { TMOD=0x20h; TH1=0xFD; //9600 baud rate SCON=0x50; TR1=1; //ES=1; //EA=1; while(1) { SBUF=SEND; while(TI!=1){;} TI=0; SEND++ } } pls give the appropriate reason of it. |
| Topic | Author | Date |
| Interrupt driven Seril I/O | 01/01/70 00:00 | |
| no way | 01/01/70 00:00 | |
| He's innocent ! | 01/01/70 00:00 | |
| no, he is not | 01/01/70 00:00 | |
| the isr clears ti fast... | 01/01/70 00:00 | |
| Discussed here | 01/01/70 00:00 | |
| Interrupt driven Serial I/O | 01/01/70 00:00 | |
| Think about it: | 01/01/70 00:00 | |
what does what micro did have to do with | 01/01/70 00:00 |



