max232 question
max232 question
Is the max232 just a level converter. i.e. when troubleshooting my comms does the max232 care which pin is rx or tx on either side (ttl or rs232) or does it just dumbly convert the voltage levels?
i.e. If i suspect i have my tx and rx reversed, does it matter if i swap the input to the max232 or the output ?
i.e. If i suspect i have my tx and rx reversed, does it matter if i swap the input to the max232 or the output ?
It both inverts and does level conversion. It does matter how it's connected. See the example interfaces Don has provided. For example see ZX-40 Series Suggested Circuits.
Last edited by dlh on 31 January 2011, 15:37 PM, edited 1 time in total.
Re: max232 question
You must connect the pins correctly. It has two types of input pins ("TTL" and "RS232" levels) and two types of output pins ("TTL" and "RS232" levels). The "RS323" levels are logically inverted and swing from negative to positive voltage while the "TTL" levels are logically non-inverted and swing from 0 to +5 (or so). The datasheet for the device describes exactly what each pin does and may include example circuits.FFMan wrote:does the max232 care which pin is rx or tx on either side (ttl or rs232)?
- Don Kinzer
sorry i don't think i was clear. i understand that there is a pair of ttl side pins, and a pair of rs232 side pins, but i was asking if it matters which ttl pin is connected to say the tx pin on the zx or does it not matter so long as the rs232 side matches ?
its not always clear from diagrams which is rx and tx as what is rx to one device is tx to another.
its not always clear from diagrams which is rx and tx as what is rx to one device is tx to another.
i'll connect it as per the diagram, though i'm still 100% sure, when the labels say TX does this mean TX from the ZX or TX from the Max232 ?
I am assuming labels are device-centric so TX is TX from the Max232 and connects to the RX on ZX ? so in my case the com2 tx pin is pin 11 and this connects to pin 12 on the max232 ?
On the rs232 side, both lines are idling at about -9v when the modem is connected, which implies to me that I have the tx/rx pin situation right on that side.
I am assuming labels are device-centric so TX is TX from the Max232 and connects to the RX on ZX ? so in my case the com2 tx pin is pin 11 and this connects to pin 12 on the max232 ?
On the rs232 side, both lines are idling at about -9v when the modem is connected, which implies to me that I have the tx/rx pin situation right on that side.
It doesn't matter which Rx and Tx you use, they are all independent. You can use either one. The pins labeled TTL/CMOS are the ones that go to the microprocessor.
Think of the triangle shapes as arrows showing the direction of the data flow. On the MAX232, RS-232 data from the outside world going to the processor (received data) would go into pin 8 (or 13) and come out pin 9 (or 12) and go into the processor RX pin.
The processor TX pin sends data out as TTL/CMOS into pin 10 (or 11) which comes out of the MAX232 chip as RS-232 data on pin 7 (or 14).
Note that the appropriate pull-up/pull-down resistors are inside the MAX232 chip.
Hope this helps.
Think of the triangle shapes as arrows showing the direction of the data flow. On the MAX232, RS-232 data from the outside world going to the processor (received data) would go into pin 8 (or 13) and come out pin 9 (or 12) and go into the processor RX pin.
The processor TX pin sends data out as TTL/CMOS into pin 10 (or 11) which comes out of the MAX232 chip as RS-232 data on pin 7 (or 14).
Note that the appropriate pull-up/pull-down resistors are inside the MAX232 chip.
Hope this helps.
Usually, the labels Rx and Tx are from the perspective of the device on which they appear. However, you should always check the datasheet. The diagram below is excerpted from the MAX232 datasheet. The symbols and labeling used make it pretty clear which pins are inputs, which are outputs and what the levels are.FFMan wrote:when the labels say TX does this mean TX from the ZX or TX from the Max232 ?
The pins labeled "TTL/CMOS OUTPUTS" can be connected to any ZX input pin while those labeled "TTL/CMOS INPUTS" can be connected to any ZX output pin.
Note, too, that as Tom mentioned, this particular chip has pullup/pulldown resistors built in.
- Attachments
-
- max232.jpg (39.22 KiB) Viewed 7999 times
- Don Kinzer
thanks chaps - that is clearer now. I was working from a diagram from the zx Basic Language Reference PDF which shows the max232 but doesn't have as much detail.
I hadn't realised the max232 contained 2 pairs of drivers, or that it had pull-up resistors. the diagram provided by don above is much clearer thanks.
I guess i could use on of the other drivers to give me a ttl level DCD rather than using my voltage divider affair i have at present (though it does appear to work).
I'll troubleshoot it tonight and expect i'll get it working.
I hadn't realised the max232 contained 2 pairs of drivers, or that it had pull-up resistors. the diagram provided by don above is much clearer thanks.
I guess i could use on of the other drivers to give me a ttl level DCD rather than using my voltage divider affair i have at present (though it does appear to work).
I'll troubleshoot it tonight and expect i'll get it working.
That's why datasheets are so important. You should always read the datasheet for any device you use so that you fully understand its capabilities and limitations. They usually contain a wealth of useful information.FFMan wrote:I hadn't realised the max232 contained 2 pairs of drivers, or that it had pull-up resistors
Although it is common for level converter chips to have pullup/pulldown resistors you must check the datasheet of the particular device you're using to ensure that they are present.
- Don Kinzer