Author Topic: Why is my Serial RX being seen simultaneously on TX line with Scope?  (Read 4087 times)

0 Members and 1 Guest are viewing this topic.

Offline K1JOSTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
I have a motor controller that communicates to a hardwired 30 foot long coiled cable hand remote using the older RS485 half duplex format.  My ultimate goal is to replace the hardwired hand remote with a wireless solution.  There are now small RF enabled Arduino's (e.g., Moteino) that provide +20dB transceiver function at various UHF frequencies.  I had no technical data on the motor controller so I had to scope out the RX and TX format and command packet bytes by scope.  It took a while but I now have all the info.  Before moving to the wireless Arduino I wanted to work out the RX/TX code hardwired using my own Arduino as a replacement for the handheld remote just to make sure I had the RX and TX packets working.

On  standard sized Arduino Uno or Mega, all works fine with basic serial code - my Arduino receives the motor controller fixed 5 byte heartbeat (sent every 220 msec) and waits about 60msec before sending it back to the motor controller as required so it knows a remote is handshaking correctly.  Attached is a scope picture.  Now to the problem - I took the same breadboard setup and swapped out the Arduino with the Moteino RF to run the identical code.  See next attached picture.  The received heartbeat packet (yellow trace) causes the TX line to drop from High to Low.  Though most of this looks like a long serials of zero's, not seen here but when the timebase is made shorter duration, some of the TX voltage fluctuations go high enough to be interpreted as a 1.  The only differences between the Moteino and the standard Arduino Uno is it about 1/4 sized PCB with same ATMega MCU but with finer traces.

My thoughts were this behavior is due to capacitive coupling as the data bits are nearly 10KHz on much smaller, closer PCB traces but the Moteino designer thinks not but has no alternate explanation.  I have replicated this on more than 4 of these miniaturized RF Moteino's while not seeing this behavior on several of the larger Arduino Uno's.

Any advice on what may be causing this behavior and more importantly what can I do to as a work-around temporary solution?


 

Offline bobcat

  • Regular Contributor
  • *
  • Posts: 94
  • Country: us
Re: Why is my Serial RX being seen simultaneously on TX line with Scope?
« Reply #1 on: August 19, 2014, 04:10:26 pm »
From the Moteino spec sheet, it is operating a 3.3 volts. It looks like you are putting signals of around 4v into the Moteino from the MC. That can cause some bad issues. It will work fine on an regular Arduino because most Arduino operate at 5 volts. You can test by temporarily putting a resistor in series with the RX input, but it is not recommended for use in the field.
Can you put a 5v->3v level shifter on the RX input to Moteino?
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16614
  • Country: us
  • DavidH
Re: Why is my Serial RX being seen simultaneously on TX line with Scope?
« Reply #2 on: August 19, 2014, 04:22:00 pm »
Now I am confused about how the differential RS-485 is being interfaced to the Moteino.  The first oscillograph shows 0 to 5 volts on both transmit and receive but the second shows less.  Is that the RS-485 line itself or the logic level signal or something else?
 

Offline K1JOSTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
Re: Why is my Serial RX being seen simultaneously on TX line with Scope?
« Reply #3 on: August 19, 2014, 04:57:37 pm »
The Moteino (R4) specs show an input voltage of 3.3V – 13V (up to 16V on MCP1703 regulated Moteinos in recent R4s).  I am using 5vdc regulated.

Sorry for any confusion. Althought the Moteino is receving and sending connected to a MAX485 (half duplex) the scope tracings are all at the Moteino RX (D0) and TX (D1) pins.

I got rid of the MAX485's and cross connected two Moteinos running same code basically (one sending a heartbeat packet every 200msec and the other listening/verifying then sending back the heartbeat 60msecs later.  All the scope tracings are clean.  So, I think this may be a termination issue where the Moteino's require a different termination than standard Arduino's.  I am digging further into this now on the bench and will report back my findings.
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: Why is my Serial RX being seen simultaneously on TX line with Scope?
« Reply #4 on: August 19, 2014, 05:03:19 pm »
The Moteino (R4) specs show an input voltage of 3.3V – 13V (up to 16V on MCP1703 regulated Moteinos in recent R4s).  I am using 5vdc regulated.

That's for the supply voltage, it is not the same thing as the input voltage at the microcontroller pins.

Quote
I got rid of the MAX485's and cross connected two Moteinos running same code basically (one sending a heartbeat packet every 200msec and the other listening/verifying then sending back the heartbeat 60msecs later.  All the scope tracings are clean.  So, I think this may be a termination issue where the Moteino's require a different termination than standard Arduino's.  I am digging further into this now on the bench and will report back my findings.

It's not a termination issue.



Vcc in your case is 3.3V. You are applying in excess of 4V. Do not do this.

Maxim, TI, and others have wide ranges of RS485 transceivers for operating at 3.3V. Get some.
« Last Edit: August 19, 2014, 05:18:50 pm by Monkeh »
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Why is my Serial RX being seen simultaneously on TX line with Scope?
« Reply #5 on: August 19, 2014, 05:20:48 pm »
The Moteino (R4) specs show an input voltage of 3.3V – 13V (up to 16V on MCP1703 regulated Moteinos in recent R4s).  I am using 5vdc regulated.

Sorry for any confusion. Althought the Moteino is receving and sending connected to a MAX485 (half duplex) the scope tracings are all at the Moteino RX (D0) and TX (D1) pins.

I got rid of the MAX485's and cross connected two Moteinos running same code basically (one sending a heartbeat packet every 200msec and the other listening/verifying then sending back the heartbeat 60msecs later.  All the scope tracings are clean.  So, I think this may be a termination issue where the Moteino's require a different termination than standard Arduino's.  I am digging further into this now on the bench and will report back my findings.

I would take a close look at /RE (pin #2) in the MAX485, make sure it's being driven properly. If it's floating anything like that might happen, if it's driven low while DE (pin #3) is high RO(RX) should be mirroring DI(TX), as it is doing (sort of).
« Last Edit: August 19, 2014, 05:43:00 pm by GeorgeOfTheJungle »
The further a society drifts from truth, the more it will hate those who speak it.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16614
  • Country: us
  • DavidH
Re: Why is my Serial RX being seen simultaneously on TX line with Scope?
« Reply #6 on: August 19, 2014, 05:26:11 pm »
They are not specified for it but you could try running the MAX485s on 3.3 volts.

I think the simplest but not best way to do the level shift from the 5 volt MAX485 to 3.3 volt logic is to add a series resistance, say 470 ohms to 1.5 kohms but it is not critical, with a schottky diode from the input pin of the microcontroller to the 3.3 volt rail.  That will clamp the high output value to about Vcc+0.3 volts or 3.6 volts with a 3.3 volt supply which is within the specified range of the microcontroller.
 

Offline K1JOSTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: us
Re: Why is my Serial RX being seen simultaneously on TX line with Scope?
« Reply #7 on: August 19, 2014, 11:39:22 pm »
Thanks David, George.  I have a source for some MAX3485 tomorrow. 

jerry
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf