1

I've spent all day trying to monitor serial console output of a router. I'm using an "ebay" MAX3232 RS232 to TTL converter connecting only GND, TX and RX to the Electron. Trying to simply monitor the console output during bootup - all I get is gibberish.

Even connected to computer's COM1 port and was unable to echo back and forth. All I get is 0 or weird symbols. (this was tried with more code than below)

Here's my most basic code. I'm about ready to give up. Any ideas?

#include "Particle.h"

void setup() {
  Serial.begin(9600);
  Serial1.begin(9600); // tried with 2400/even 1200 really should be 9600
  Serial.println("Starting up Serial");
  Serial1.println("Starting up Serial1");
} 


void loop() {
 while(Serial1.available()>0)
 {
   Serial.write(Serial1.read());
 }
 delay(50);
}
7
  • 1
    Did you check the power supply voltage on the MAX3232 pins (V+ pin 2 and V- pin 6)? What are the values of the two flying caps (across pins 1-3 and pins 4-5)? And, if you suspect that you were sold a counterfeit part, Maxim customer service would like to know. (Disclaimer: I am a Maxim applications engineer.)
    – MarkU
    Commented Jun 17, 2016 at 3:56
  • Have you tried both 7-bit and 8-bit data? Are you set to no-parity? (stop bits should not matter).
    – Mark
    Commented Jun 17, 2016 at 4:18
  • @MarkU - I didn't check the voltages or the cap values yet. I don't know about counterfeit, or how to determine that - it's a cheap Chinese Serial to TTL adapter board. Mark - I tried both 7 and 8 bits with no parity and still nothing.
    – user1389579
    Commented Jun 17, 2016 at 5:21
  • 2
    I suspect you have the wrong master serial clock rate.
    – Jasen
    Commented Jun 17, 2016 at 5:49
  • 3
    Loopback test the MAX3232 transceiver by itself (independent of the microcontroller). Connect the loopback on the RS232 side (T1OUT driving R1IN), and then drive logic low on T1IN, expect the RS232 loopback should go to about +5.5V and expect the R1OUT should go logic low. Then drive logic high on T1IN, expect the RS232 loopback should go to about -5.5V and expect R1OUT should go logic high. MAX3232 datasheet
    – MarkU
    Commented Jun 17, 2016 at 6:16

2 Answers 2

1

If the OP has correctly stated that only three connections to the MAX3232 have been made, power to the device is missing. Code tested with an RS232 transmitting device (Maxbotix 7092) with Sparkfun MAX3232 breakout and Particle Photon. Serial monitor correctly displays continuous range reading.

0

You do not need any hardware between the Particle and the router. Both the router and the Particle work at 3.3V logic levels.

  • Connect the GND of the router the GND of the Particle
  • Connect the TX of the router to the RX1 of the Particle
  • Connect the RX of the router to the TX1 of the Particle

You only need the MAX3232 if you want to connect direct to your computer's RS232 port:

  • Connect the GND of the MAX3232 to the GND of the computer and the GND of the router
  • Connect the TX of the computer to RIN of the MAX3232
  • Connect the RX of the computer to DOUT of the MAX3232
  • Connect the TX of the router to the DIN of the MAX3232
  • Connect the RX of the router to the ROUT of the MAX3232
  • Connect the VCC of the MAX3232 to +3.3V from the router.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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