I am having trouble with converting ttl to rs232 I am using the MAX232 chip and schematic found in Making Things Talk:
I have wired up one of them and tested the send function by jumping the ttl side send and receive sides together. What I am finding is if I send the ascii 't' about 10 times i get 't' back about 2 times. The rest of the time I am getting random characters like : or }. Has anyone had any experience with this circuit. I read somewhere that Capacitors don't have a polarity but in most diagrams it shows that they do. Should I redo it? Also, I found this diagram which is quite different : http://www.forum-auto.com/uploads/200504/piffo77_1112975528_piffo77_max232.gif
Any Suggestions? Is one diagram better than the other?
The max232 uses 0.1uf capacitors which are typically ceramic types and don't have polarity. The second diagram uses polarized 1uf electrolytic parts but these are much larger than necessary.
Ceramic capacitors are fine with the max232 and you don't need worry about the polarity. Try a test where you send data to an external computer. Your random characters could be due to reading and displaying data when nothing is in the buffer (did you remember to use Serial.available?)
The MAX232 is such a great part that now everybody and their dog makes their own version of it.
find the specific manufacturer and part number (including things like that A suffix that BroHogan mentioned), then get a datasheet for that part and use what it says.
If you're not sure, I suspect the 10uF caps would be more likely to work for all variants of the MAX232, whereas the .1uF caps wouldn't work for a device that expects the 10uF.
Oh, and the chip you see in the Making Things Talk reference is a MAX3323, not a 232, hence different pins and caps.
Thanks Everyone for your replies. I do have the circuit wired incorrectly and I have the .1u caps. The chip is a MAX232 it is not the A.
On Page 17 of the DataSheet: http://datasheets.maxim-ic.com/en/ds/MAX220-MAX249.pdf
it says that I need the 1uF capacitor but on page one the data sheet under Nominal cap value it lists both the 1uF and then in brackets the .1uF. Does this mean I can use both? It doesn't make mention of the .1uF elsewhere.
I guess you didn't actually read this thread before you posted?
find the specific manufacturer and part number (including things like that A suffix that BroHogan mentioned), then get a datasheet for that part and use what it says.
I have always used 0.1 uF "104" ceramic caps for MAX3222 or Max233, although I got used to using Max233A to not need to use them.
But I have a question, I see you are doing a loop back test by shorting the TTL pins, but how are you looking at the characters? Are you using the Arduino to display the data on a LCD panel? or are you looking at it on a terminal program like Hyperterminal?
You should not need more than the datasheet from Maxim there to wire it up. Maybe instead of a loop back you might want to use 2 different serial ports for your test, or another pc using Hyperterminal