Welcome to Synthiam!

Program robots using technologies created by industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation, and artificial intelligence easy.

Get Started
Canada
Asked — Edited

Question

I’m trying to connect an Arduino Nano with the EZ-B v4 to offload some of the work. UART1 and UART2 work fine!

Problem is with UART0 (information is send but corrupted)

Connection:

- Arduino GND to EZ-B v4 GND

- Arduino RX connected to UART0 TX (first pin), D5 or D18

Attached to the Arduino is a 2x16 character LCD (I2C connection) to display (the serial information (also visible true the Serial Monitor) using a simple protocol; 0 (0x30) = clear LCD, 1 (0x31) = start at line 1, 2 (0x32) = start at line 2. All other information is just displayed.

All is fine and Information is displayed correctly when attached to pin D5 or D18.

When connected to the TX pin of UART0 information is sporadically send but corrupted. Touching the wire (on the outside!) changes the behavior of the characters received (more characters but still corrupted)??!!




ARC Pro

Upgrade to ARC Pro

Your robot can be more than a simple automated machine with the power of ARC Pro!

#1  
This is the Script I used:
:loop
UARTInit(0, 0, 9600) #initialize UART0
UARTWrite(0, 0, 0x30)
sleep(100)
UARTWrite(0, 0, 0x31, "Hello UART-zero")
UARTWrite(0, 0, 0x32, "Second Hello")
sleep(100)

UARTInit(0, 1, 9600) #initialize UART1
UARTWrite(0, 1, 0x30)
sleep(100)
UARTWrite(0, 1, 0x31, "Hello UART-one")
UARTWrite(0, 1, 0x32, "Second Hello")
sleep(100)

UARTInit(0, 2, 9600) #initialize UART2
UARTWrite(0, 2, 0x30)
sleep(100)
UARTWrite(0, 2, 0x31, "Hello UART-two")
UARTWrite(0, 2, 0x32, "Second Hello")
sleep(100)
Goto (loop)
PRO
Synthiam
#15   — Edited
You can’t short all three TX lines of each uart like that and get the same voltage during activity. That’s why you’re reading unusual voltages. Because the uart’s that aren’t writing are holding their voltage state - which is causing the active uart to over drive. 

Also, take a ground from one of the digital pins, because perhaps it’s not grounding well in the female connector if it’s a bit loose.

Either way though, I can’t think of a reason why the uart #0 would not work for your application. I can’t even imagine a reason.
#16   — Edited

Code:

You can’t short all three TX lines of each uart like that



Unless I'm missing something or looking at the picture wrong I don't think his TX lines of each Uart are shorted on the breadboard. I know little about the Nano and how to wire it. Are you talking about the connections I see at A4 & A5?

I do like DJ's suggestion of running another ground from the black ground pins of the EZB's digital pins. Multiple grounds are always a good ideal in case one comes loose or broken. How about also attaching another ground wire to the other side of the Nano and running it directly to a EZB digital ground pin just to be sure. Bypass the breadboard with a sure ground connection.
PRO
Synthiam
#17  
Ooops I was tired and you’re correct Dave. I took a quick look and saw the three wires and didn’t pay attention before closing my eyes for a good night rest:)

Still, I can’t understand or imagine what could cause that for his setup.
#18   — Edited
Added an extra ground to the other side of the Nano (3 GND wires now), problem still exists.



The thing is, I can easily move the green wire between UART0, 1 and 2 and check how the transmission is going. AURT 1 and 2 always work fine so I would think Ground is fine.



The problem is only with UART0. Most of the time all characters are corrupted. With a bad connection of the TX wire you would expect that wiggling the wire would change the behavior. It does not.



It may or may not be related but almost every time I’m testing there is this message My battery is low. The only thing I’m doing right now is running this serial script. Nothing else connected.



I’m using a bench power supply at 7.4V. Increasing the voltage doesn’t help. Unplugging and re-initializing will most of the time fix it. Sometimes I need to restart a couple of times



User-inserted image


These are the Connection Control settings I use

User-inserted image
PRO
Synthiam
#19  
How come there’s a long list of countries in ubb code after each of your responses lol? We keep having to delete them 

If the battery is low message, it’s  because you’re under powering the ezb - look into the battery monitor in the ezb data sheet. You’ve jumped a few steps ahead:) the min battery voltage is in the connection control, and can be hard coded in the web interface.
#21   — Edited
As stated, I added an extra ground to the other side of the Nano (3 GND wires now), problem still exists.

The thing is, I can easily move the green wire between UART0, 1 and 2 and check how the transmission is going. UART1 and 2 always work fine so I would think Ground is fine.

The problem is only with UART0. Most of the time all characters are corrupted. With a bad connection of the TX wire you would expect that wiggling the wire would change the behavior. It does not.
#22  
I just found out that when I unhook the mini scope (BitScope DSO connected to orange wire) no characters are received at all.
Plugging the orange wire back in, UAET0 start immediately producing (mostly corrupted) characters again.
It is as if the signal is pulled down a bit more so it can be recognized as a signal but not far enough to be recognized correctly

As always UAR1 and 2 are working fine with or without the oscilloscope being attached
PRO
Synthiam
#23   — Edited
Those are indeed symptoms of a bad ground - which I can't understand given your picture looks fine.

Oh, reviewing your picture... I noticed the Bitscope isn't connected correctly as it's missing the ground. So if it "works" with the Bitscope connected, i'm guessing it's a grounding issue still. I know it's not what you want to hear but it's the only thing i can think of with similar results that you're experiencing.

Is there a different GND pin on the arduino that you can use? Maybe that GND isn't connected correctly or something?

Also, i doubt that USB power on the arduino can power the display correctly AND the arduino. You should consider giving it adequate supply rather than USB. I suspect if you checked the +5 that's powering the display you'll find the voltage to be quite low when it's displaying data

What happens if you take GND off somewhere else on the EZ-B? Like a digital port GND pin or an ADC gnd pin?

Lastly, you "could" try putting a 4.7k resistor pulling the EZ-B's TX line to GND (down). Maybe there's a lot of capacitance in the arduino?

As you know, this is the simplest circuit you could come across. It's ridiculously simplified and shouldn't be this complicated so something is affecting the results - and all signs point to a ground, but i can't understand how if you're confident the grounds are solid
United Kingdom
#24  
This might be a silly question and you may have already tried it, but have you tried another Nano.
I’ve have some obscured faults with a couple of Nano’s, which i’ve put down to Static damage due to the way they were packed on delivery.
Anyway just a thought!
#25  
Hi Cem,
I startend this atempt with an Arduino Uno. Same problem.
The thing is that UART1 and 2 both work fine. Just the UART0 is giving this problem
#26   — Edited
Hi DJ,
Thanks for your response. I started this exercise with a wire to the digital GND. 
My current setup is 2 GND wires, one to digital GND and one to the GND of the UART0. Also an extra wire to the 2nd GND on the Nano. Problem is the same :-( 
What puzzles me is that UART1 and 2 are working fine, so I’m confident the grounds are solid (with UART1 and 2 at least)
#27   — Edited
Did some more step by step testing.

- Added GND to the Bitscope, trigger at minimum  - Cleared op the signal a bit but no incoming characters at all on UART0
  (Value UART0 is 2.14V, value UART1 and 2 is 1.6V)
- Moved power of the LCD to separate power - no incoming characters are recognized at all on UART0
- Removed the Bitscope 
- Added a 4.7K resistor between TX and GND - Improvement, a lot of characters are coming in but all scrambled
- Added the Bitscope, trigger at minimum - a lot of characters are coming in but are still all scrambled
  (Value UART0 is 2.07V, value UART1 and 2 is 1.5V)
- Removed GND from the Bitscope, trigger at minimum - slight improvement,  a lot of characters are coming in scrambled but some (5-10%) are OK
  (Value UART0 is 2.01V, value UART1 and 2 is 1.5V)

It seems that the Signal LOW for UAERT0 is not low enough. The lower it gets the better the results
PRO
Synthiam
#28   — Edited
Add the resistor between TX and +3.3v instead of GND... try that

The fact the results change with the bitscope connected still leans toward a broken ground somewhere. The bitscope should be floating and not affect the reading. that's the point of a meter or a oscilloscope for measurement is that it cannot affect the results. The fact that it is affecting the results leans toward a bad ground
#29   — Edited
Hi JD,

Moving the resistor between TX and +3.3v instead of GND didn't help. Less incoming characters and all incoming characters are corrupted.
Removed GND from Digital pin.
Connected now is GND from UART0, D5 and D18. As UART1 and 2 are still working fine, ground is fine for UART1 and 2 even using GND from UART0
Any grounding issue with UART0 therefore would be internal to the EZ-Bv4 isn't it?
#30  
Maybe ez robot should try and replicate this scenario at there facility. Get it resolved quicker?
PRO
Synthiam
#31  
We replicate it daily. Many of our robots have arduino, ssc-32 or uart<->usb devices connected. Also, the lidar dev units all connect to uart0. This works for us on a daily basis, which is why i'm at a loss to of why it wouldn't work for tonlaar. All signs point toward a bad ground is the only suggestion i have, even if it sounds like a broken record.

Connecting devices to UART 0 is common practice for us on a daily basis
#32  
Long shot, but where are you located?  Maybe one of us is close enough to let let you test with another EZ-B and rule out anything wrong specific to yours?
#33  
Ya, I agree with Thetechguru. Try another EZB. There may be something wrong internally with the one you're using. 

Have you tried wiring directly and eliminating the breadboard?
#34  
The thing is the whole setup including the the 2 ground wires I use are working for UART1 and UART2 so Serial communication is working but not for the UART0