weird serial problem - USB works RS232 doesn't

Combining the power of the ATmega2560 MCU with onboard Ethernet, a microSD card slot, an efficient switchmode power supply, and a small prototyping area. [Product page]
Post Reply
effgee
Posts: 64
Joined: Tue Aug 07, 2012 2:41 am

weird serial problem - USB works RS232 doesn't

Post by effgee » Wed Sep 24, 2014 12:37 pm

I'm out of ideas on this one, so any thoughts are welcome.

I can communicate both ways over USB, but can only send data via RS232.

Configuration:
- freetronics ethermega (3 actually, all behave the same)
- freetronics terminal shield (with ethernet connector clearance notch) and
- SEEEDstudio relay shield on top (http://littlebirdelectronics.com.au/pro ... hield-v2-0).
- DF Robotics RS232 converter http://littlebirdelectronics.com.au/pro ... -converter wired to D0 & D1 (on the screw terminal). Running at 19.2kb

Everything else works fine, 2 motors (1 on serial2 to Pololu 18v15), a bunch of buttons and limit switches, IR remote.

I can upload programs and issue serial commands over USB (with the RS232 converter unplugged), but when I swap from USB to RS232, data sends from the ethermega fine, but none is received.

I connected a scope and can see the data arriving at D0 (at least on the top shield) when using RS232, but (unexpectedly) NOT when communicating with USB. I've only scoped 1 unit but all 3 behave the same.

I've used this exact setup maybe 5-8 times before with no problem.
These are all new hardware.
I've tried 5 different USB-RS232 convertors on my PC (3 different designs) but they make no difference to the behaviour, I gave up chasing that angle after I saw the data on my scope.

Any guesses suggestions what could cause this ?

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: weird serial problem - USB works RS232 doesn't

Post by angusgr » Thu Sep 25, 2014 12:10 am

Hi effgee,
effgee wrote:- freetronics terminal shield (with ethernet connector clearance notch) and
Do you mean you've cut a notch in the screw terminal shield yourself to clear the ethernet connector? Can you possibly post a photo of the shield and the whole setup, please?
effgee wrote: I connected a scope and can see the data arriving at D0 (at least on the top shield) when using RS232, but (unexpectedly) NOT when communicating with USB. I've only scoped 1 unit but all 3 behave the same.
This makes it sound like something in the shield stack is broken, ie the link from the Screw Terminal shield down is flaky?

If you remove everything else and just use breadboard wires to connect the four TTL/Serial VCC,TX,RX and Ground connections directly to the EtherMega, does everything work then?

If you then add the shields one at a time, which one causes the problem to reoccur?

Regards,


Angus

effgee
Posts: 64
Joined: Tue Aug 07, 2012 2:41 am

Re: weird serial problem - USB works RS232 doesn't

Post by effgee » Thu Sep 25, 2014 7:47 am

thanks Angus

after writing up the post, I came up with the theory that maybe the RS232 converter was being powered by 3.3V instead of 5, and that it doesn't reliably cross the 'high' threshhold. Does that sound possible ? I'll set up a test tonight to see if I can reproduce it.

I don't have access to the project at the moment, but have asked someone that does to check for me.

effgee
Posts: 64
Joined: Tue Aug 07, 2012 2:41 am

Re: weird serial problem - USB works RS232 doesn't

Post by effgee » Fri Oct 24, 2014 2:22 am

OK, I have another piece of this puzzle now.
Done another project, similar setup, except using a Pololu dual VNH5019 shield in place f the Seeed relay shield.

Similar issues, a couple of pins not working. I've swapped to a different ethermega from the same batch, and onw down to a single pin not working.

This time I've had a much better chance to investigate.

My conclusion is that the headers on D0-D13 are loose on the latest batch of ethermega's compared to previous models. They feel loose. I've got an older ethermega (v1.1 with the mini USB instead of the micro USB on v3.0) and the fit feels fine in that. I can see a tooling mark on the header that tells me it's a from a different tool, there is a slight line across the midpoint of the top face (will post photos later).

Any comments ? ANyone else seeing loose headers on D0-D13 on ethermega ?
I can't find any date code on the packaging.

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: weird serial problem - USB works RS232 doesn't

Post by angusgr » Fri Oct 24, 2014 2:55 am

Hi effgee,

Thanks for updating us. We haven't had any reports of this. The actual female header pins do vary a small amount in the size of the hole in the plastic, as we sometimes source headers from different manufacturers, but they should all still take standard size pins.

Any pictures or other debugging info you can supply would be much appreciated.

Angus

effgee
Posts: 64
Joined: Tue Aug 07, 2012 2:41 am

Re: weird serial problem - USB works RS232 doesn't

Post by effgee » Fri Oct 24, 2014 8:15 am

I believe the main problem is the pins on the screw shield are narrow, 0.33x0.60 instead of standard header pins at 0.60x0.60 (my measurements, maybe ±0.03 at worst). I suspect the thin pins don't spring the female metal connector inside the header enough to create a reliable joint.

Pretty sure the size of the hole in the plastic is irrelevant, it's the interference fit between the metal pin and the springy part on the header. I think what I'm seeing is a slight incompatibility between the ethermega and the freetronics screw shield; the header has changed a little which makes it sensitive to the pins supplied with the screw terminal board.

When plugging/unplugging the screw shield into the ethermega, it feels noticeably loose on the D0-D13 side. I tried measuring the push-in force, but the numbers I got didn't line up with the subjective feel, I think largely because it was impossible to judge when the connection bottomed out, i.e. the force displayed was greater than the insertion force. I got someone else to cross check subjectively and they agreed the screw shield felt too loose in the ethermega.

To work around the problem today I bent 'wiggles' in the screw shield pins on the 'digital' side to increase interference in the header, and that at least got my project going, but left me nervous about how reliable it might be in the future. A better solution would be use square section 0.60x0.60 pins on the screw shield - any pointers where to source these would be appreciated.

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: weird serial problem - USB works RS232 doesn't

Post by angusgr » Sun Oct 26, 2014 8:39 pm

Hi effgee,

Thanks for sharing your new observations. The pins on our "stackable" header shields should all be around 0.4mm x 0.6mm, I just checked a random sample of shields, including some screw terminal shields, here and they all meet this. If the screw shield pins are as 0.3mm then this might be the issue.

To confirm this is the problem, do you have a multimeter with a continuity test function (aka buzzer function)? You can verify the bad connection by doing the following:

- Install shield in the EtherMega
- Insert a small breadboard jumper wire (or similar) in one of the suspect female pins of the stacking header on the shield.
- Flip the EtherMega over, use multimeter to test continuity between the solder pad on the bottom of the pin and the other end of the jumper wire.
- Repeat for other suspect pins (and possibly also test some "good" pins as a control).

Please let us know how you go.


Angus

effgee
Posts: 64
Joined: Tue Aug 07, 2012 2:41 am

Re: weird serial problem - USB works RS232 doesn't

Post by effgee » Mon Oct 27, 2014 12:27 am

Hi Angus

I'm remote from the project now, so I'm unlikely to get a chance to do the tests you suggest. I did enough A-B-A testing on Friday with the new & old ethermegas, 2 screw shields and 2 motor shields to convince myself that the thin legs IS the cause. I understand they 'should' be 0.4 thick, but assuming this https://www.sparkfun.com/datasheets/Pro ... /18688.pdf is typical of the spec for the stackable headers used on the screw shield, they could be as thin as 0.15 and still meet the drawing requirement.

Looking at the internals on that drawing, they only spring in 1 dimension. If the same design applies to the ethermega headers, and female pins in the are oriented differently from that drawing (as could conceivably happen with a change of supplier), there is not much interference to grip the 0.33 dimension (scaling off the screen I estimate the open gap at around 0.3mm on that drawing).

I'm keen to find some 0.6x0.6 pin stackable headers for next time.

effgee
Posts: 64
Joined: Tue Aug 07, 2012 2:41 am

Re: weird serial problem - USB works RS232 doesn't

Post by effgee » Fri Nov 07, 2014 6:28 am

update - I found some 0.6x0.6 stackable headers
https://www.dropbox.com/s/h93yvs9yt8hfb ... s.jpg?dl=0

the only trick is I found them in my parts bin, and don't know where I got them from. My best guess is they came with Pololu (since the plastic is blue, and Pololu ship blue header jumpers) dual VNH019 shields from a couple of years ago, only the photos & drawings on the Pololu site now show the 0.6x0.4 black stackable headers both with that kit and sold separately.

Can anyone suggest a supplier ?

Post Reply