{"id":144,"date":"2011-08-26T13:05:31","date_gmt":"2011-08-26T17:05:31","guid":{"rendered":"http:\/\/fll-freak.com\/blog\/?p=144"},"modified":"2025-04-21T00:54:36","modified_gmt":"2025-04-21T04:54:36","slug":"root-cause-to-rs-232-bug-found","status":"publish","type":"post","link":"https:\/\/fll-freak.com\/blog\/?p=144","title":{"rendered":"Root cause to RS-232 bug found!"},"content":{"rendered":"<p>Last night I found the true cause of my RS-232 problems. The question should not have been why two computers did not work when one did, but rather how did any manage to work.<!--more-->RS-232 uses voltage levels to send over a serial signal. Long time ago, the standard was +-12 volts. Over time that has been narrowed to as low as +- 5 volts. The logic level on my detector was correct in timing, but the Sparkfun RS-232 level converter I was using was not generating an appropriate RS-232 signal. The converter does not use a &#8216;normal&#8217; RS-232 driver like the Maxim drivers, but rather uses two simple transistors. It gets the negative voltage by stealing it from the other sides TX line and storing it in a capacitor. This design is highly dependent on the receiver of your data.<\/p>\n<p>In my case the signal was about 1 volts in amplitude and was not even centered on zero but rather at nearly 3 volts. Why the laptop was able to decode this awful signal I do not know.<\/p>\n<p>So I searched around and found that Polulo sells a similar converter, but theirs uses an honest driver chip and does not steal power. I placed an order for one of these to replace the Sparkfun crummy unit.<\/p>\n<p>Unfortunately neither the RS-485 parts I ordered nor this Polulo part will get to me before the hurricane and associated lightning storms hit us this weekend. So I was scratching my head as to how to bypass the problem to be ready in time when it occurred to me that my detector has both a plus and minus 5 volt supply. This voltage swing should be enough to drive most modern UARTS.<\/p>\n<p>Looking to my available inventory, I stumbled on some optoisolators. One of these should do the trick. Drive the LED part from the micro and use the transistor to switch a load resistor between the +5 and -5 rails. I should be all set for the hurricane!<\/p>\n<p>For those that are following this, I would <strong>discourage <\/strong>purchasing either of these two Sparkfun products. It gives me no joy to do so as I am very fond of their products, but these two are pretty substandard:<\/p>\n<p><a href=\"http:\/\/www.sparkfun.com\/products\/133\">RS232 Shifter Board Kit<\/a><\/p>\n<p><a href=\"http:\/\/www.sparkfun.com\/products\/449\">RS232 Shifter SMT<\/a><\/p>\n<p>I would suggest looking at the Pololu products instead.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last night I found the true cause of my RS-232 problems. The question should not have been why two computers did not work when one did, but rather how did any manage to work.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,9,7,11],"tags":[],"class_list":["post-144","post","type-post","status-publish","format-standard","hentry","category-lightning-detector","category-product-reviews","category-projects","category-rs232-shifter"],"_links":{"self":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=144"}],"version-history":[{"count":4,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/144\/revisions"}],"predecessor-version":[{"id":1066,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/144\/revisions\/1066"}],"wp:attachment":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}