Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No serial communication with Arduino Uno #8

Closed
TylerOderkirk opened this issue Jan 29, 2011 · 26 comments
Closed

No serial communication with Arduino Uno #8

TylerOderkirk opened this issue Jan 29, 2011 · 26 comments

Comments

@TylerOderkirk
Copy link

I successfully flashed grbl_0.51_9600_328p.hex to my Uno in Windows XP SP2 with the following:

"C:\Program Files\arduino-0022\hardware\tools\avr\bin\avrdude" "-CC:\Program
Files\arduino-0022\hardware/tools/avr/etc/avrdude.conf" -patmega328p -cstk500v1
-P.\COM12 -b115200 -D -Uflash:w:grbl_0.51_9600_328p.hex

However, I can't seem to talk to the firmware with the Arduino serial monitor nor Putty with {xon/xoff,rts/cts,no} flow control. I received one or two garbage (non-printable) bytes from the firmware but that's it.

@scottrcarlson
Copy link

I'm also having the same issue as well. I have successfully loaded the code from avrdude command line (mentioned above).

Using Ubuntu 10.10 64bit and Arduino Uno. (using avrdude from Arduino-0021) (Both before and after flashing the new usbserial patch for the uno)

Here is the output from my avrdude session:

--------------------------- snip
code/arduino-0021/hardware/tools/avrdude -Ccode/arduino-0021/hardware/tools/avrdude.conf -pm328p -cstk500v1 -P/dev/ttyACM0 -b115200 -D -Uflash:w:code/grbl/grbl_0.51_9600_328p.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "code/grbl/grbl_0.51_9600_328p.hex"
avrdude: input file code/grbl/grbl_0.51_9600_328p.hex auto detected as Intel Hex
avrdude: writing flash (13222 bytes):

Writing | ################################################## | 100% 3.20s

avrdude: 13222 bytes of flash written
avrdude: verifying flash memory against code/grbl/grbl_0.51_9600_328p.hex:
avrdude: load data flash data from input file code/grbl/grbl_0.51_9600_328p.hex:
avrdude: input file code/grbl/grbl_0.51_9600_328p.hex auto detected as Intel Hex
avrdude: input file code/grbl/grbl_0.51_9600_328p.hex contains 13222 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 3.11s

avrdude: verifying ...
avrdude: 13222 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.
--------------------------- snip

I've tried connecting at several baud rates (trying 9600 first) and get a few garbage characters..

-Scott

@simen
Copy link
Member

simen commented Jan 29, 2011

I'm currently running the active development branch ('accelleration') on an Uno with no trouble. Will debug the current release on the Uno tonight.

@simen
Copy link
Member

simen commented Jan 29, 2011

I had no trouble running the latest code in the master branch @9600 with the Uno. I uploaded my hex file here. Please try it and tell me how it works for you:

http://d.pr/GXoB

@scottrcarlson
Copy link

I just flashed the binary you provided. (Just spoke with Tyler, he also did the same)

We are both experiencing the same results, garbage characters. We are actively looking into this..l. Any thoughts?

Seems like there is something going on, on our end? He's running WinXp 32bit, I'm running Ubuntu 10.10 64bit..

I've used screen/socat to attempt connections...

Thanks,
Scott

----- Snip
code/arduino-0021/hardware/tools/avrdude -Ccode/arduino-0021/hardware/tools/avrdude.conf -pm328p -cstk500v1 -P/dev/ttyACM0 -b115200 -D -Uflash:w:code/grbl/GXoB.grbl_0.51.2_9600_328p.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "code/grbl/GXoB.grbl_0.51.2_9600_328p.hex"
avrdude: input file code/grbl/GXoB.grbl_0.51.2_9600_328p.hex auto detected as Intel Hex
avrdude: writing flash (13272 bytes):

Writing | ################################################## | 100% 3.86s

avrdude: 13272 bytes of flash written
avrdude: verifying flash memory against code/grbl/GXoB.grbl_0.51.2_9600_328p.hex:
avrdude: load data flash data from input file code/grbl/GXoB.grbl_0.51.2_9600_328p.hex:
avrdude: input file code/grbl/GXoB.grbl_0.51.2_9600_328p.hex auto detected as Intel Hex
avrdude: input file code/grbl/GXoB.grbl_0.51.2_9600_328p.hex contains 13272 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 3.23s

avrdude: verifying ...
avrdude: 13272 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.
----- Snip

@scottrcarlson
Copy link

Forgot to mention, we are using two different Uno boards.

I will try a third Uno now, to rule out hardware issue.

Scott

@scottrcarlson
Copy link

Quick update.. The third Uno is giving me similar behavior. Strange...

@simen
Copy link
Member

simen commented Jan 29, 2011

Extremely odd. I just tried reflashing my uno with exactly the avrdude-command you used and no problems. What parameters are you using for socat? Here is my current, working line:

socat -d -d READLINE /dev/tty.usbmodem26221,clocal=1,nonblock=1,cread=1,cs8,ixon=1,ixoff=1

@simen
Copy link
Member

simen commented Jan 29, 2011

Do you have any other hardware connected to your unos when you try this?

@scottrcarlson
Copy link

I've used:

socat -d READLINE /dev/ttyACM0,clocal=1,nonblock=1,c1,ixoff=1,ispeed=9600
and screen /dev/ttyACM0 9600

I believe Tyler has tried Putty..

I don't have anything hooked up to the board, just usb cable.

I just tried your socat line, had to modify for /ttyACM0: (same results)

socat -d -d READLINE /dev/ttyACM0,clocal=1,nonblock=1,cread=1,cs8,ixon=1,ixoff=1

I notice you have a tty.usbmodem26221, do you think mine showing on ttyACM0 has anything to do with this?

@simen
Copy link
Member

simen commented Jan 29, 2011

Perhaps. Is this a related problem?

http://ubuntuforums.org/showthread.php?t=1622981

I'm getting a lot of interesting possibly related noise when i put 'ttyACM duo' into google

@scottrcarlson
Copy link

Interesting stuff. I followed the instructions in that thread and got Arduino-22 up and running and can now upload code through arduino ide (Did not work yesterday when I first fired up this Uno).

I don't believe that is my issue, as I can upload code. (Now from both arduino ide and avrdude).

I am going to keep digging along the lines of the ttyACM device and see what I find. At least I have your validation, that will help me narrow done the issue!

Question,.. why do you have a tty.usbmodem device?

@scottrcarlson
Copy link

Shoot, forgot to mention, Tyler is seeing similar results from his Windows box, he will be here shortly and we will re-try and keep you posted.

Thanks
Scott

@simen
Copy link
Member

simen commented Jan 29, 2011

I guess ttyACM is an Ubuntu thing? tty.usbmodem is probably OS X-ish?

@scottrcarlson
Copy link

Are you using a Mac? I can fire up my mini here and give that a try too....

@simen
Copy link
Member

simen commented Jan 29, 2011

Maybe you should do that? Would eliminate one possible cause, at least.

But I know people have used Grbl on both Ubuntu and Windows before. Could you flash it with some simple serial stuff and see it you can see that with socat?

@scottrcarlson
Copy link

Interesting finds here..

Windows/Mac/Linux attempting flashing and connecting at 9600. I read a link earlier regarding the Uno's serial baud rate double is turned on by default. See http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1292954023

So I unplugged the Uno after programming, plugged it back in and attempted a connection with screen at 19200.

Here is my result:

'$' to dump current settings��H�ɉ��0.51
ok
$
$0 = 755.906 (steps/mm x)
$1 = 755.906 (steps/mm y)
$2 = 755.906 (steps/mm z)
$3 = 30 (microseconds step pulse)
$4 = 480.0 (mm/sec default feed rate)
$5 = 480.0 (mm/sec default seek rate)
$6 = 0.100 (mm/arc segment)
$7 = 0 (step port invert mask. binary = 0)

'$x=value' to set parameter or just '$' to dump current settings
ok

!! Much improved. You are connecting at 9600? So far 19200 is repeatably working!?

At any rate, we are over the first hurdle, a few more to go...

@simen
Copy link
Member

simen commented Jan 29, 2011

The version you have is hardwired to 9600. I am planning to put in bit-rate-detection, but it was always second to complete acceleration-support which I just recently completed a few days ago. To change bitrate Grbl must be recompiled at this time :-/ sorry. Given that I have succesfully used it at 9600 and 115200.

The little glitch you see there at startup sometimes is normal. It is a bug caused by a slight hack in the boot routine that I have fixed in the current branch ('accelleration'). I will backport everything when I have tested this new stuff on a real machine. So far I have only verified it on a logic analyzer. But I expect it to go well and will integrate all changes and be back to one branch for main development for a while.

@scottrcarlson
Copy link

No problemo... In the thread I linked to there is a simple way to force Uno to turn off the baud doubling if thats the case, I'll test that ASAP.

We are working hard tonight to wire up Grbl to our cnc proto-type. I've got to re-arrange some I/O. We will more than likely grab your latest acceleration code and fire that up.

Very exciting times... We'll keep you posted.

-Scott

@simen
Copy link
Member

simen commented Jan 29, 2011

I haven't looked into the new possibilities with Uno, yet. Got a few just to make sure Grbl worked. Will look into it later. Maybe my whole baud-autodetection-plan is moot by now? Hope so!

@scottrcarlson
Copy link

Just to finish this thread up.

First and foremost, the serial communication is functioning correctly.

(Strangeness). I periodically have issues loading Grbl onto the Uno. So far, as bizzare as it sounds, I used a Mac and ran avrdude from there, and then I am able to move the device back to my Ubuntu 10.10 box and flash and communicate to grbl.

On Ubuntu 10.10 64bit with both arduino-0021 and arduino-0022 hardware/tools/avrdude, I can flash just fine. However, I get garbage characters from Grbl at any standard baud rate.

Once I play the goto the mac game, then I am able to connect to the device a 2X (double) the baud that the config.h file contains. I have read that the Uno has a baud-doubler flag enabled by default. So, by default 9600, I have to connect at 19200 and all is well. [ ** Anyone else obverse this behavior? ]

(Previous to all of this, I did update the usbserial driver on the Uno http://www.hacktronics.com/Tutorials/arduino-uno-linux-serial-port-printing-trouble.html)

When I have a chance to investigate further, I will target, programmer versions and os kernel versions. I have a feeling there is a kernel side driver issue.

Bottom line,. the problem is intermittent, and I can work around it. I will carefully document my findings in the next few weeks and report back with some better details..

Scott

@simen
Copy link
Member

simen commented Feb 11, 2011

Did you leave the arduino boot loader in when you flashed your Duos? Might that be the reason why you get baud doubling and I don't? (I routinely remove the boot loader)

Anyway I'll add a line to disable the baud doubler.

@simen
Copy link
Member

simen commented Feb 11, 2011

If you could pull the latest version of the acceleration branch, uncomment line 47 and tell me how it works for you, I would really appreciate that. I fried both my Unos today in an unrelated project trying to drive high current DC motors :-/

@simen
Copy link
Member

simen commented Feb 11, 2011

I compiled a hex file for you and put it here: http://d.pr/G9eL

@scottrcarlson
Copy link

No problemo, give me a couple hours and I'll get back to you!

@scottrcarlson
Copy link

That did the trick, I'm now connecting at 9600 bps.

Nice. That should prevent any confusion from future adopters!

@simen
Copy link
Member

simen commented Feb 11, 2011

Great!

ashelly pushed a commit to ashelly/grbl that referenced this issue May 21, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants