Pages: 1 2 [3]   Go Down
Author Topic: Leonardo baud rate for USB CDC  (Read 5839 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is transmit bandwidth benchmark program on the pjrc site:
http://www.pjrc.com/teensy/usb_serial.html
https://github.com/loganb/teensy-usb-serial/blob/master/tx_benchmark.c
It shows darn fast 10Mbit/s max serial speed with teensy halfkay USB-Serial bootloader.
Someone can try to adapt and test it on Leonardo.

« Last Edit: December 09, 2012, 06:19:49 pm by DEHiCKA » Logged

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

So if i understand this thread right, Serial.begin(baudrate) does not have any effect for the speed of the USB CDC port?

Also i see in CDC.cpp a baud rate of 57600? Has this something to do with the speed of the port?

I ask, because i want to control a LED strip with 240 RGB LEDs over serial with a minumum of 25 Hz. This would be 240*3*25 = 18000 bytes per second over serial (or minumum 144000 bits per second). At the moment i do not have success. Seems to be too slow.

Maybe i should connect an FTDI breakout to the Serial1 ports on the Leonardo board? Can i set then 500k or 1M bau rate to Serial1?

Best regards
TheChief
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
18000 bytes per second over serial (or minumum 144000 bits per second).
18000 * 10 != 144000

There are 2 extra bits per byte - the start and stop bits that separate the bytes.
Logged

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

OK, then i need a minumum of 180000 bits per second  + some protocol bytes. The USB CDC seems to be not really with good performance. Any other ideas?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33311
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well I reported at the start of this old thread that I measured the Leonardo transfer rate at 39258 bytes/second. That is faster than your required 18000 bytes per second. So if there are any performance issues it is not with the Leonardo.
Logged

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

But it is much slower then an FTDI Breakout? There i could set 500k, 1M or 2M on an 16Mhz Arduino.

I also tried the test scipt and cannot get more then 40000 bytes/s.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But it is much slower then an FTDI Breakout? There i could set 500k, 1M or 2M on an 16Mhz Arduino.

Where have you heard that? I doubt it will go that hight. Do you have seen any project receiving 2MB/s on an Arduino? Or even 2Mbit/s using the USART?

Quote
I also tried the test scipt and cannot get more then 40000 bytes/s.

So you're getting more than you require? Where's your problem?
Logged

Pages: 1 2 [3]   Go Up
Jump to: