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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/17/08 06:58
Read: times


 
#153589 - the risks of doing things the "wrong way"
Responding to: ???'s previous message
There are things, methods, ways-of-doing-things - and not only in programming - which are labelled as "proper" and "good". They mostly come from life-long experience and often the reasoning behind them is subtle; the point being to do things in a robust way, somehow taking care of some "common faults" "automagically". Nevertheless, there might be valid (or at least half-reasonable) reasons to shoot one into his foot; as well as there are those out-of-the-standard methods which one has to employ when running against some limitation (it's not really the case of asynchronous transmission).

In this particular case, the mixed method is detrimental if you use the TI flag the other way round, i.e. if you check-and-clear it BEFORE inserting character into SBUF (which is the better way to do things anyway, isn't it). The cautionary note therefore is issued, and if you obey it as you should, you don't run into problems, regardless of what you do with TI.

Russ said:
So here's the question: Assuming the hardware is working correctly, is there any chance that TI can be set except as a result of loading SBUF?

Sure, for example by TI = 1. ;-)
(OK, if you want something more sophisticated, it can be hidden behind some obscure manipulation with the whole SFR byte).

JW

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