Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/15/08 18:26
Read: times


 
#153409 - if you do that
Responding to: ???'s previous message
.. then all you need is to set a flag in the ISR when you reset TI and 'poll' that flag in the main.

It "makes sense" to do the transmit in main when the code to fetch the next byte is complex i.e. not just the next byte from a buffer. Sometimes it can be beneficial not to 'unpack' the record to be transmitted to a buffer but to save the space such a buffer would occupy. In such a case the transmit code can easily be 'heavier' that what is good for an ISR. BTW in such a case, instead of 'polling' just check the flag for each passage in the workloop.

however:
NEVER poll TI (or RI) directly in the main if the serial interrupt is enabled.

Erik

List of 14 messages in thread
TopicAuthorDate
Interrupt-driven Rx, polled Tx            01/01/70 00:00      
   this is why we have the FAQs...            01/01/70 00:00      
      Maybe I'm crazy            01/01/70 00:00      
         if you do that            01/01/70 00:00      
         Polled transmission            01/01/70 00:00      
            Mixing modes on UART            01/01/70 00:00      
   Here's why I asked            01/01/70 00:00      
      the risks of doing things the "wrong way"            01/01/70 00:00      
         the old nugget            01/01/70 00:00      
            Cool idea            01/01/70 00:00      
               size            01/01/70 00:00      
         Is the \"wrong way\" risky, or just stupid?            01/01/70 00:00      
            explanation            01/01/70 00:00      
               Thanks. I understand now what you are saying            01/01/70 00:00      

Back to Subject List