| ??? 12/03/02 06:02 Read: times |
#33627 - RE: Simple 8052 O/S |
"What will happen if UART happens to finish TX-ing a character while the ISR is running?
That will mean that your ISR is WAAAY too slow" No ... say the user IO task loads a number of chars (ie a message) into the TX buf, sets TI to start the send process, then dies ... but can do that again at any time because of a switch press. Maybe the ISR finished say 200us ago, but is simultaneously being started by 2 sources ... TI int from last char that was sent, and TI int from user IO task. So there must be a 'TX_BUSY' flag, user task must not set TI while that is there. "If you are having multiple tasks all accessing a UART transmit, you WILL need to do some housekeeping or get mixed transmission, depending on the active task at TI time." Exactly. Maybe I didn't explain well - I am not just monitoring a data stream ... I am monitoring it, but deciding with each message (1 to 3 bytes in length) whether the message should be echoed, modified and echoed, or discarded, and also maybe stored to be resent later (by user IO). But thinking about your earlier post I realised that I can do this without the OS ... and maybe that will be much cleaner, faster and less memory use. Maybe I will do that. Oh well, I guess design is an iterative process ;-) Thanks Daniel |



