Go Down

Topic: Leonardo baud rate for USB CDC (Read 7 times) previous topic - next topic

DEHiCKA

#30
Dec 10, 2012, 12:08 am Last Edit: Dec 10, 2012, 12:19 am by DEHiCKA Reason: 1
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.


TheChief79

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

PaulS

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.

TheChief79

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?

Grumpy_Mike

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.

TheChief79

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.

pylon

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?

Go Up