0
\$\begingroup\$

I'm trying to interface an Arduino Mega2560 to a Modbus RTU device using an SN75176B transceiver, on a solderless breadboard at this stage. When I'm driving DE high and writing serial data out of the Arduino, the highs are nice and clean but the lows are full of 3MHz noise. It looks like this:

enter image description here

The blue line is the arduino output, the yellow is the transceiver output (A to B). The arduino's UART is running at 9600 baud. Obviously the device connected has trouble understanding this.

According to the data sheet, all this device needs is a bypass capacitor between VCC and GND. Admittedly the one I'm using is a bit overspecced, but would that cause this?

(Note: I have 120ohm termination resistors at both ends)

\$\endgroup\$
  • \$\begingroup\$ Put the capacitor on and make sure DE is enabled all the time. \$\endgroup\$ – Andy aka Feb 15 '17 at 18:15
  • \$\begingroup\$ Show the schematic. And how exactly are you probing? \$\endgroup\$ – CL. Feb 15 '17 at 18:16
  • \$\begingroup\$ @Andyaka - I have a 10uF capacitor where the datasheet says 0.1uF. Was supposed to have 0.1uFs delivered today but haven't shown up. I've checked that DE is high throughout the transmission. \$\endgroup\$ – Tom Feb 15 '17 at 18:24
  • 1
    \$\begingroup\$ Is your probe isolated from ground? If not, you can't just clip the gnd lead to B. \$\endgroup\$ – Tut Feb 15 '17 at 18:32
  • 1
    \$\begingroup\$ Try looking from data line to ground and not across AB. \$\endgroup\$ – Andy aka Feb 15 '17 at 18:33
3
\$\begingroup\$

Witha regular scope probe, and measuring across A and B you inevitably short out one of the differential outputs to local ground. Measure differentially using the oscilloscope using two channels then use the scope function A+B.

Or just measure one output with respect to ground then swap to the other to prove it's working.

\$\endgroup\$
  • 1
    \$\begingroup\$ Re "A+B" ...To make this differential measurement, you need to invert channel B. \$\endgroup\$ – Tut Feb 15 '17 at 20:21
  • \$\begingroup\$ @tut good call! \$\endgroup\$ – Andy aka Feb 15 '17 at 21:13
  • \$\begingroup\$ slaps forehead what an idiot. Thanks. The thing at the other other end's still not talking to me, but at least the signalling from the mcu end is correct. \$\endgroup\$ – Tom Feb 16 '17 at 10:00
  • \$\begingroup\$ @Tom ... Sync your scope with the DE transistion and look at your driver input and output at the transistion of DE (high and low). Make sure that neither your first charcacter nor your last character is getting clipped. It could be necessary to add a slight delay to the transmission of the first character after DE goes low, or a delay to switching DE high after the last character is sent. I don't know the Arduino, but there is often a separate interrupt to indicate the last character has been transmitted (the one you want) vs Tx buffer empty. \$\endgroup\$ – Tut Feb 16 '17 at 11:33
  • \$\begingroup\$ @Tut - Yes, I thought of that, too. But I've tried extending it out to four characters of space at either end, as some Modbus documentation suggests, and still no response from the thing. I've wired up a USB-RS485 converter onto the same bus, and it receives the frames correctly (well, I'm assuming the CRC is being done correctly by the library I'm using... maybe I'll check that...) but still no response from the unit. Starting to tear my hair out! \$\endgroup\$ – Tom Feb 16 '17 at 12:03
0
\$\begingroup\$

Your capacitor is probably under-speced, rather than over-speced. A 10 uF electrolytic will have much less effective capacitance at high frequency than a 0.1 uF ceramic - and it's the high frequency performance which counts. Furthermore, physical location counts. You must connect your decoupling capacitor as close to the ground and Vcc pins as possible, and less than 0.5 inches is a good target.

But make sure to leave the existing 10 uF cap in the circuit, as well. Low-frequency support is important, too.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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