0
\$\begingroup\$

I'm trying to communicate with an I2C bus using the Serial Card in my PC (NI PCI485/8). I've created a circuit using the MAX3162 to translate from RS485 to RS232. Then I use the MAX3232 as a level shifter to drop the RS232 to 3.3V. Then it's sent to a NXP SC18IM700 to talk to the I2C bus. I've gotten the I2C working by using a USB FTDI cable for UART communication to the SC18M700 and have verified everything on the I2C bus and the SC18IM700 itself are communicating correctly. I've verified that the message I'm sending from the PC (RS485) is being converted on the output of the MAX3162, on the input of the MAX3232, and on the output of the MAX3232. However, nothing is being received from the SC18IM700. I've removed the SC18IM700 from the circuit and attached the FTDI cable to the output of both the MAX3232 and MAX3162 to view the messages received from the computer. When I try to send a message back from the FTDI port I'm not receiving anything back on the PC (RS485) side. The MAX3232 is configured as it is so that the inverted RS232 is double inverted and will be the correct message to the SC18IM700. I've tried using both the inverted and non-inverted messages and neither method is giving me a RS485 message back to my RS485 port.

So the root of my problem here is seeming to be in the MAX3162. It's converting from RS485 TO RS232, but it is not converting the messages from RS232 back to RS485. I can't find much help in the data sheets, but I've configured my MAX3162 just as they've suggested on one of the web pages I found (https://www.maximintegrated.com/en/app_notes/index.mvp/id/723)

I wish I could just use the USB FTDI cable for my final product, but I am unable to use USB communication for my finished design, so I need to figure this out. It seems like I'm very close, but something is just slightly off...

CONVERSION AND LEVELING CIRCUIT

\$\endgroup\$
  • 1
    \$\begingroup\$ I don't understand why it goes twice via MAX3232. It should just talk RS232 levels to MAX3162 and TTL levels to SC18. Other than that, the RS485 Y/Z lines are connected to PC RX, so the A/B lines should be connected to PC TX. But it isn't, A is PC -TX and B is +RX which can't be correct. Is this just a drawing error or is it actually like that? \$\endgroup\$ – Justme Aug 4 at 21:45
  • 1
    \$\begingroup\$ Also, I don't understand why the MAX3232 is there at all. The SC18 TX/RX could be connected directly to the MAX3168 DI/RO pins that is the 3V3 tranceiver interface, right? Is there a reason to do RS485-TTL-TTL-RS232-RS232-TTL conversion, such as cabling? \$\endgroup\$ – Justme Aug 4 at 22:04
  • 1
    \$\begingroup\$ Ditto, on MAX3232. Kill it. \$\endgroup\$ – StainlessSteelRat Aug 4 at 22:27
  • 1
    \$\begingroup\$ The MAX3232 pin7 is RS232 level output. It is already killing the SC18 3.3V input pin with RS232 levels. Perhaps SC18 is already damaged. \$\endgroup\$ – Justme Aug 4 at 22:47
  • \$\begingroup\$ the +RX on pin 18 of the 3162 is supposed to say +TX \$\endgroup\$ – saregister Aug 5 at 0:26
2
\$\begingroup\$

The small error might just be the that RS485 A/B lines should be -TX and +TX instead of +RX.

But it also contains more severe design errors, such as level-converting the RS232 link back to RS232 levels for the I2C protocol converter chip, instead of using 3.3V levels. It might have damaged the I2C protocol converter.

And the MAX3232 is actually not needed at all, as the RS485 tranceiver already has a 3.3V level interface that can be directly connected to the I2C protocol converter.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ My original hookup was just using the MAX3162 and connecting it directly to the SC18. Even with a 3.3V supply, the 3162 was still outputting 5V logic which seemed to be more than the SC18 could handle. It was literally attaching Pin 5 of 3162 to Pin 9 of SC18, and pin 20 to pin 10. If I isolate the SC18 and attach it to the FTDI cable I'm still getting proper comms, so the chip itself is still good. I've burned through a couple of them already before I realized my logic levels were too high, so that's why the 3232 is in there now. \$\endgroup\$ – saregister Aug 5 at 0:32
  • \$\begingroup\$ I believe Justme is suggesting that you use the DI & RO pins 23 & 11, not the RS232 pins. DI & RO will use 3.3V levels. You can completely ignore the RS232 half of your MAX3162 - it's entirely unnecessary for what you're trying to do, as is the whole MAX3232. \$\endgroup\$ – brhans Aug 5 at 3:20
  • 1
    \$\begingroup\$ Pins 5 and 20 on the MAX3162 would be the wrong, RS232 level pins to attach to I2C converter directly. The DI and RO pins (which I mentioned earlier but not in my answer) would be the correct, 3V3 pins to use. The MAX3232 currently level translates twice, it converts RS232 signals to 3.3V signals and back to RS232 levels, so RS232 voltage levels still end up to I2C translator. \$\endgroup\$ – Justme Aug 5 at 5:17
  • \$\begingroup\$ @justme I think I'm too caught up on the recommended setup provided by Maxim in the link in my OP. I'm going to try DI and RO direct output to the I2C master and see how it goes. would pin 9 and 24 then need to be left floating? I thought those were controlling timing as I have them configured now. Thanks for the suggestion!I think I need to read the data sheet more carefully for that 3232 as well. I didn't realize the levels of the 2nd channel were raised back to RS232 levels and did not think to scope that side to verify. \$\endgroup\$ – saregister Aug 5 at 13:48
  • \$\begingroup\$ @saregister what does the datasheet say about those pins? If it says unused pins can be left unconnected, then they don't need any special handling. \$\endgroup\$ – Justme Aug 5 at 14:00
0
\$\begingroup\$

As suggested by @justme, the MAX3232 is not necessary in this circuit. I connected Pin 23 of MAX3162 to pin 10 on SC18IM700 (DI to TX) and Pin 11 on MAX3162 to Pin 9 on SC18IM700 (RO to RX). I've tied Pin 15 and 24 to VCC as suggested by @brhans.

Thanks for all the help everyone. I really appreciate it.

| improve this answer | |
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.