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

Faster Serial Baud Rates? #116

Closed
dmadison opened this issue May 10, 2017 · 16 comments
Closed

Faster Serial Baud Rates? #116

dmadison opened this issue May 10, 2017 · 16 comments
Milestone

Comments

@dmadison
Copy link

Would it be possible to add faster baud rates than 115200 for 3rd party devices? I'm not sure if it's a matter of just appending the list or if there's more to it on the back end.

@psieg
Copy link
Owner

psieg commented May 11, 2017

Honestly I have no idea. Since I don't have any such device I don't use know anything about that. Are there other common rates?

@dmadison
Copy link
Author

Here's a reference I found. Relevant quotes:

Most serial devices accept only a predefined set of baud rates. The maximum rate for most standard serial ports is 115200. However, some serial devices...support any arbitrary baud rate below a specified maximum rate.

So while 115200 seems to be the fastest rate for "standard" hardware, some hardware will support faster rates. If I recall correctly a typical Arduino can do up to 1M, assuming that the PC's port can support it.

Typical faster rates, also from that link:

Standard baud rates supported by some serial ports:

  • 128000
  • 153600
  • 230400
  • 256000
  • 460800
  • 921600

Continuing the doubling theme, I'd recommend 230400, 460800, and 921600 be added. Maybe an added checkbox or the like warning about unsupported hardware would be prudent.

I've tested rates of 230400, 460800, and 921600 successfully on a genuine Arduino Uno, just using it to relay messages. Notably none of the rates above 115200 worked on a knockoff Uno, presumably because of the lower quality FTDI chip.

@psieg
Copy link
Owner

psieg commented May 16, 2017

You should be able to set any baud rate in the config file, it appears the value is not vaildated when loaded. Have you tried that?

@dmadison
Copy link
Author

Which config file is that? I didn't see any serial options listed in the profile files.

@psieg
Copy link
Owner

psieg commented May 17, 2017

The baud rate is a device setting, which is saved in main.conf

@dmadison
Copy link
Author

Thanks, I found the file and the settings. I don't know how I missed it!

I did some quick tests with the Arduino Nano I have driving my LEDs, and changing the serial speed in main.conf appears to work perfectly. Although in the future it would be nice to be able to set baud rate through the configuration wizard.

Interestingly, the USB -> Serial chip on my knockoff Nano doesn't work with 230400, 460800, or 921600 baud, but does work with 250000, 500000, and 1M baud (I haven't tested others). So it may be better to leave the current dropdown setting as-is, and maybe add a text field for a "Custom baud rate" instead.

@dmadison
Copy link
Author

Related: because the white balance adjustment in the wizard ( #86, #95) is after the baud rate setting, the firmware on 3rd party devices would need to be flashed to a lower baud rate to utilize the global GUI white balance adjustment in the current release.

@psieg
Copy link
Owner

psieg commented May 30, 2017

I don't understand. If the baud rate page is first, the rest of the wizard should use the configured baud rate. Why would one need to flash a different firmware?

@dmadison
Copy link
Author

Sorry, reading it back now I see I was being a bit too vague.

It's only an issue if you're running a 3rd party device at a higher baud rate than 115200 by editing main.conf, which is the current workaround. Because the white balance portion of the wizard is after the baud rate setting, you cannot get to the white balance page because it will force you to a lower baud rate.

@psieg
Copy link
Owner

psieg commented Jul 25, 2017

Does the device does not work with slower baud rates or is it just slower?

@dmadison
Copy link
Author

It does not work. The baud rate is set on firmware upload, and the board won't communicate properly at other rates.

@Benik3
Copy link

Benik3 commented Oct 23, 2017

For the BaudRates I recommend to look at this tables, where you can find speed vs Error. The Speed is on AVR set by dividers from clock so you can't choose any speed you want. http://wormfood.net/avrbaudcalc.php
Also if you want to use higher speeds then 115200 don't use Arduino Nano, mini etc. with Atmega328P and dedicated USB-serial converter.
Instead use Arduino micro (Leonardo) with Atmega32u4 which has USB in the CPU. Much faster, no problem here to use 1M Bd ;)
Also for some reason it looks like Atmega32u4 "ignores" settings of speed of serial in code.
I have in code 1000000Bd but it communicate on what ever speed which I set o.O

@Dallas-J
Copy link

I know this issue is a bit old at this point, but did anyone here ever get a baud rate above 115200 working? When I try setting the baud rate above 115200 in main.conf, I get random colors on all of my LEDs. I have tested the board (Arduino Uno) and it is fine all the way to a 2M baud rate, so I thought I'd make sure I wasn't doing anything wrong before investigating further.

@dmadison
Copy link
Author

I've successfully tested all the way up to 1M without issue.

@Dallas-J
Copy link

I was using an algorithm to convert from RGB to RGBW - turns out the algorithm wasn't fast enough. I can run at 2M baud now with no problems. Maybe I'll try implementing an RGBW algorithm on the program side at some point but this is good enough for now.

@psieg psieg added this to the 5.11.2.16 milestone Apr 6, 2018
@psieg
Copy link
Owner

psieg commented Jun 18, 2018

Added in 5.11.2.16

@psieg psieg closed this as completed Jun 18, 2018
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

4 participants