Shop OBEX P1 Docs P2 Docs Learn Events
Max232 — Parallax Forums

Max232

Jonathan HolleJonathan Holle Posts: 48
edited 2010-07-26 20:46 in Propeller 1
Hi all,

Is it possible to use a max232 in order to connect the propeller to the pc knowing that I have a 5volt output in my propeller board. Is it any risk of damaging the propeller ? thanks [noparse];)[/noparse]
«1

Comments

  • BigFootBigFoot Posts: 259
    edited 2010-07-23 00:09
    We use the ADM3202 or the Maxim Max3202e, they both have better input protection
    than the Max232 and operate off of 3.3 volts. You can directly interface the propeller
    to them without dropping resistors.

    Russ
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-23 00:19
    thank you for you prompt answer. Sure is better to use a 3,3v serial ttl adapter but is there any way to use the max232, because it's the only thing I have ready to hand :-/
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-07-23 01:53
    Max232 works fine with the propeller. Put a 1k resistor between the line that goes from the max232 to the propeller - this protects the propeller from the 5V coming from the max232. For the line going from the propeller to the max232 you don't need a resistor.

    So all you need is a 1k resistor.

    I'm using this circuit for all my programming and interface to the propeller and it works fine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • TimHTimH Posts: 48
    edited 2010-07-23 02:29
    I agree with Dr_Acula - I use the MAX232 for most of my designs with a 1K resistor between max TX and propeller input. No resistor required for output from the prop to RX on the max232.
  • LeonLeon Posts: 7,620
    edited 2010-07-23 04:59
    You can use the MAX232 at 3.3V, like the 3.3V MAX3232. It's out of spec, but works OK in an emergency, I've found.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-24 21:10
    Thanks for your answer, I finally bought one max3222 (3232 was unavailable), could you explain me how to connect it to the propeller ?
  • LeonLeon Posts: 7,620
    edited 2010-07-24 21:33
    !SHDN should be tied high, !EN should be tied low.

    Connect T1IN to the serial output pin and R1OUT to the serial input pin, on the Propeller. T1OUT is the RS-232 output and R1IN is the RS-232 input. See the diagram on page 12 of the data sheet. Don't leave unused inputs floating, the MAX3222 doesn't have pull-downs like the MAX3232. You need to add them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM

    Post Edited (Leon) : 7/24/2010 9:39:58 PM GMT
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-24 21:52
    I'am not an expert in electronic ^^, how to tied hight the !SHDN and tied low the !EN ? The capacitor on V+ have to be connected on the GND or the VCC ? What about the RST ? And what's a pull-downs and how to make it ? thank you for your help [noparse];)[/noparse]
  • LeonLeon Posts: 7,620
    edited 2010-07-24 21:57
    Connect to Vcc to tie high, Gnd to tie low.

    V+ and V- capacitor connections are in the diagram.

    There isn't an RST pin.

    Pull-downs are resistors, as in the MAX3232 diagram on the same page.

    Post your schematic if you want it checked.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-24 22:24
    Okay, what about this diagram ? Still don't understand about the pull down ... sorry, what resistor I have to put, and where ?
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-07-25 01:37
    Re "but is there any way to use the max232, because it's the only thing I have ready to hand"

    www.smarthome.viviti.com/files/documents/Propeller_v5.pdf

    This is a big schematic and you won't need most of it, but check out the max232 part on the left side. You can leave out the leds if you like, though they are rather handy for debugging. There are two ports, but essentially it is just a 1k resistor. One is female and one male - just note the pinouts there as pins 2 and 3 are swapped.

    Note also the max232 power supply pins - they appear over in the 5V regulator section (pins 15 and 16).

    If you can get that working, then drop in a max3232 or similar instead.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller

    Post Edited (Dr_Acula) : 7/25/2010 2:42:13 AM GMT
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-25 07:46
    Could the capacitors be no polarized ? Is it no better to use a max3222 or is it exactly the same thing ?
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-07-25 08:17
    A max232 uses 1uF caps and yes, you could use non polarised ones (eg polyester) but polarised electrolytics at 1uF are cheaper and smaller.

    Max3222 uses 0.1uF, and for 0.1uF the non polarised ones work out cheaper (and smaller). Probably the reason these newer chips are proving more popular.

    Looking at the spec sheet datasheets.maxim-ic.com/en/ds/MAX3222-MAX3241.pdf they say pin for pin compatible so yes, just drop in 0.1uF caps, use the correct supply volts and follow the data sheet.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-25 08:50
    Ok, and if I use the max3222 do you know which resistor I have to use for pull-down ?
  • LeonLeon Posts: 7,620
    edited 2010-07-25 09:52
    Something like the one that is in the diagram for the MAX3232. I think it's 5k, so a 4k7 will do.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-25 09:56
    is my schematic ok ?
  • LeonLeon Posts: 7,620
    edited 2010-07-25 10:42
    It's difficult to tell, you should have created a symbol matching the one in the data sheet.

    Pin 16 should be connected to ground. I can't see why you are using Vdd, it's a CMOS supply used internally in chips. The schematic should be redrawn, as I've suggested.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-07-25 10:52
    I'm afraid I can't say definitely, sorry. I found this in the data sheet, quote: "The MAX3222 and MAX3232 are pin, package,
    and functionally compatible with the industry-standard MAX242 and MAX232, respectively."

    And then I see that the Max3222 has 18 pins. But the max232 has 16 pins, so who knows what else is different. Not "pin compatible" as they claim, anyway. The TSSOP package appears to be 20 pins. datasheets.maxim-ic.com/en/ds/MAX3222-MAX3241.pdf

    I do know that the max232 is very easy to interface to the propeller. The max3232 and max3222 *probably* are very similar. And it looks like they have added pins 1 and 18 at one end. And yes, maybe you need to tie unused inputs somewhere. 4k7 is a safe bet.

    I'll just stick to commenting on the max232 as I know and understand that chip. Did you say you had a max232? If so, all you need are four 1uF capacitors. Any brand/type/package of 1uF capacitors will do.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • LeonLeon Posts: 7,620
    edited 2010-07-25 11:27
    The MAX242 is the older 5V version of the MAX3222, and also has 18 pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-07-25 12:16
    Ah thanks Leon. I was a bit confused there.

    For Jonathan, when you drew up that schematic, what program did you use? It looks a bit like Eagle, and if so, the Max libraries are all there. Search eg for *max3222* (the stars are wildcards, and will sometimes find parts better than just searching for the part number)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-25 14:35
    Is this schematic ok ?

    Post Edited (Jonathan Holle) : 7/25/2010 3:09:38 PM GMT
  • LeonLeon Posts: 7,620
    edited 2010-07-25 18:07
    Much better! Pins 16 (Vdd) and 17 (Gnd) are presumably connected in the part definition, to avoid clutter. Don't forget them.

    It looks OK. You don't need the 3k pulldown resistor, as you have that pin connected. I'm not sure if it is actually needed on unconnected pins, anyway, as it is shown in the diagram in the data sheet. I'm sure that it was mentioned in the body of the doc., though.

    Use Vcc or 3.3V in schematics, not Vdd. The latter is a CMOS supply inside a chip, like Vss (Gnd).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM

    Post Edited (Leon) : 7/25/2010 6:11:58 PM GMT
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-25 18:32
    Arght, it does not work :-S, any idea what the problem could be ?
  • LeonLeon Posts: 7,620
    edited 2010-07-25 18:49
    Check all the voltages on the chip pins and try a loopback test (connect the output to the input) and check the signals with a scope.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-25 19:23
    here the different voltages :
    C1+ : 5,4
    V+ : 6,9
    C1 :- 1,7
    C2+ : 3,8
    C2- : 3,8
    V- : 7
    T2out : 6,85

    T1out : 7,2
    R1in : 4
    R1out : 3,3
    T2in : 0,4
  • LeonLeon Posts: 7,620
    edited 2010-07-25 19:38
    The voltages look OK, so the charge pumps are working. You should be using T1IN (not T2IN) and T1OUT.

    Try switching T1IN between high and low, and check that T1OUT goes -ve and +ve.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-25 20:00
    I use T1IN ; T1out goes well positive and negative
  • LeonLeon Posts: 7,620
    edited 2010-07-25 20:03
    The Tx function seems to be working, then; you should be able to receive from it if you have the correct baud rate etc. Try sending the same character continuously, I use '*'.

    A scope is very useful for debugging that sort of thing. You can check timing if you send 'U' continuously - alternating 1s and 0s - and even use a counter/timer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM

    Post Edited (Leon) : 7/25/2010 8:09:09 PM GMT
  • Jonathan HolleJonathan Holle Posts: 48
    edited 2010-07-25 20:08
    unfortunatly I have no scope [noparse]:([/noparse] , Could the propeller work if the baud rate is not correctly defined ? because regarding the max3222 datasheet, the baud rate is set with a resistor and a capa on the Tout ... Could this be the problem ?
  • LeonLeon Posts: 7,620
    edited 2010-07-25 20:19
    The baud rate isn't relevant as far as the MAX3222 is concerned. It's just a driver/level converter. T1OUT shouldn't have a resistor or a capacitor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
Sign In or Register to comment.