Pages: 1 [2]   Go Down
Author Topic: Mega Baud rate Error  (Read 2630 times)
0 Members and 1 Guest are viewing this topic.
SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6637
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I believe the problem is with the SERIAL_2X_UBBRVAL macro
how do you figure?   The 57600bps special case was because the bootloader (which is "hard" to change) was using 57600 (as close as possible) without the "double-speed" option, while the usb/serial device was using 57600 as close as possible WITH the u2x option, and they were on opposite sides of "correct", making them far enough apart to not talk to each other (even though theoretically, each was with "allowable" tolerance WRT the actual bitrate.

The mega should talk fine to its own usb/serial port, because they should have consistently picked "which side" of 14400to be on, and other devices (most other devices) should be OK if they're closer to correct.

And I can't think of a reason why a serial port couldn't talk to itself or another serial port on the same arduino (with the same bitrate generator decisions), EVER, even if the resulting bitrate were WAY off of what was expected (it should still be the same for receiver and transmitter.)
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12741
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

how do you figure?

You have point.  The problem could also be in the USB handler of the ATmega8U2.


Quote
The mega should talk fine to its own usb/serial port, because they should have consistently picked "which side" of 14400to be on, and other devices (most other devices) should be OK if they're closer to correct.

I agree.  But that's not the issue...

The sketch tries to set the ATmega328 baud rate to 14400.  The evidence indicates that worked.

Serial Monitor tries to set the ATmega8U2 baud rate to 14400.  The evidence indicates that did not work.
Logged

0
Offline Offline
God Member
*****
Karma: 25
Posts: 606
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It this on Linux?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12741
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


In my case it's Vista / 32 bit / Arduino 1.0-rc2.  (Thank you for the dependency check feature!)
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12741
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


My apologies.  The bug is in Serial Monitor not in the ATmega8U2.

@T3bear: Just use a different terminal program.
Logged

0
Offline Offline
God Member
*****
Karma: 25
Posts: 606
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The bug might be in the RXTX library?

Some serial drivers also don't support 14400 and 28800, particularly the cdc_acm driver on Linux.

Glad you're enjoying the compile speedup.  smiley  I also recently fixed the bugs in error reporting to multi-tab projects, but it looks it might have been too late to make the 1.0.1 release....
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What I get from all of this is:   It Is What It Is.

However that does not help me, I am trying to communicate with a servo unit that only knows 14400 baud.
What I am seeing on the output of uno and or mega uart is different width pulses for each bit.  and the servo's
uart just does not like that.  I added an external uart from SparkFun and it's output is as 'steady as a rock', solving my
problem talking to the servo.

Thanks everyone for all the information.
Logged

Pages: 1 [2]   Go Up
Jump to: