Tronbike Meter (TBM) 4.0.0 Test Ride

Thursday, February 25, 2010

Serial TTL to RS-232 Using a MAX232 IC

My progress has been stymied since last week when I figured out TTL Serial != RS-232 serial. I fried one of my Arduino AVR chips discovering this - DO NOT PLUG THE 5 Volt Arduino wiring into the 12 Volt RS-232 ports on a PC!

Ebay is full of these TTL to RS-232 converters too, I ordered one from Canada that has yet to get here. Kits exist at Sparkfun too, but I am rapidly learning hardware supply chains take time - ie buying ordering and WAITING - ARG!

Turns out  I need a device that can convert the Arduino's 5V Serial to 12V RS-232, and this commonly uses a driver IC chip commonly called "MAX232". Problem is there was one of these in San Rafael (30 minutes away) so I decided to do a Jameco order for a bunch of them, armed with free schematics such as these

http://sodoityourself.com/max232-serial-level-converter/

Note the Capacitor sizes vary depending on the exact version of the MAX232 you get - mine is a MAX232CPE, so my caps are 10x smaller.The chip supports 2 IO channels, like this diagram I only turned one channel on (4 wires - TTL in/out and RS-232 in/out), no flow control.

My parts showed up Monday and this AM I put them together over a 2 hour stretch (slow soldiering) and the end result worked first try!




Next time I will get the MAX233 - caps are already built in - or I'll just be sure to get a lineup of the converters in stock, 2 hours of my time is a bit $$ ;)

Packaging these parts is going to become very interesting.

Time to test some TBM code on my Alltrax Serial simulator!

0 comments: