faraj
Member level 1
- Joined
- Feb 22, 2005
- Messages
- 40
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- Azarbaijan/ Tabriz
- Activity points
- 1,601
hi everybody.
I'm writing a program in C language for 89c52. it's collects data from an isa ported device and sends the data with rs232 to the PC. and beside this, the uc recieves commands through rs232 and must respond to this commands immediately. I use serial interrupt to get data from PC. As known, the serial interrupt vector is common for RI & TI flags, and for sending data from uc to pc, TI falg needs to be set and in this case uc always goes to serial interrupt vector and this makes uc to work very slowly. so i decided to keep the TI flag cleared and just set it when i want to send data to PC. But this time, the data are missing or completely lost in the PC side. and another thing is that the TI flag gets set without sending any data to PC that seems wrong to me, because the TI flag just set when a data transfer from uc has finished. can anyone help me with this communication problem? thanks in advance.
I'm writing a program in C language for 89c52. it's collects data from an isa ported device and sends the data with rs232 to the PC. and beside this, the uc recieves commands through rs232 and must respond to this commands immediately. I use serial interrupt to get data from PC. As known, the serial interrupt vector is common for RI & TI flags, and for sending data from uc to pc, TI falg needs to be set and in this case uc always goes to serial interrupt vector and this makes uc to work very slowly. so i decided to keep the TI flag cleared and just set it when i want to send data to PC. But this time, the data are missing or completely lost in the PC side. and another thing is that the TI flag gets set without sending any data to PC that seems wrong to me, because the TI flag just set when a data transfer from uc has finished. can anyone help me with this communication problem? thanks in advance.