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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/04/07 08:47
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#138609 - not quite so...
Responding to: ???'s previous message
Gia,

You might have found out your design "working", however, you should strive for "well designed" rather than simply "working". Erik and/or Richard will please kindly preach here on the value of "testing" (where "testing" refers to "I tried and it worked").

  1. Get rid of the "some noise" FIRST, then you can think of any anti-noise measures in your software (including higher-level measures such as packetizing and checksumming and retrying etc.).
  2. Have you replaced the optocoupler to the "digital" one, as per my recommendation above? Do so.
  3. Is the connection going to run over a longer distance, in a possibly noisy environment? Consider the following solutions (the first is the best):

    1. converting to RS485 plus the optocoupler
    2. converting to RS232 plus the optocoupler
    3. using an optocoupler with push-pull output rather than OC (or an additional driver)

  4. Your receiver bit timing is still not corrected (see my post above). You still have 1% bit time mismatch.
  5. The startbit checking is too long. Your subsequent sampling points are somewhere at 2/3 of the bit, rather than in the middle. (Curiously, this here cancels partially the bit-time-mismatch effect, but that's not a good way how to do it).
  6. For additional noise immunity, you can multiple-sample inside each bit (as the HW UARTs do), and also check for valid stopbit. However, first, make everything in HW needed to get rid of the noise as much as possible.


JW


List of 14 messages in thread
TopicAuthorDate
bit-bang proplem            01/01/70 00:00      
   bit bang can be many things            01/01/70 00:00      
   Optocouplers            01/01/70 00:00      
      re:schematic and code            01/01/70 00:00      
         Speed?            01/01/70 00:00      
            Do you have a CRO to see the wave forms?            01/01/70 00:00      
         different timing            01/01/70 00:00      
            everything ok            01/01/70 00:00      
               not quite so...            01/01/70 00:00      
                  requested sermon            01/01/70 00:00      
                     thanks, Erik...            01/01/70 00:00      
                  one more            01/01/70 00:00      
                     that is not necessarily good enough            01/01/70 00:00      
                        check time            01/01/70 00:00      

Back to Subject List