Hi. We are using the USB CDC example to send data to a windows PC over virtual comport.
First question is that in the sdk_config.h file NRFX_UART_DEFAULT_CONFIG_BAUDRATE = 30924800 which is 115200bps. However we are transmitting about 64,000 bytes in about 2 seconds which is 256,000bps ? Sometimes it is even quicker than that.
Second question is, that on a slower windows computer sometimes a few bytes are lost when reading the data in. We would like to adjust the baud rate (lower), but seems from above question that it can't be adjusted?
Where is the baud rate set for the USB CDC example, or is it no and its all 'virtual'?
I checked all the baudrate settings in sdk_config, and they are all 115,200bps.
I have not work with nRF CDC but worked with other MCU. By my experience, the baud rate is only for the physical UART. The CDC is virtual and always at USB speed. You are having issue on the UART side or USB side ?
Thanks. Yes I am thinking the same thing, that it is as fast as USB will allow.
The issue is on the Windows USB side I think, it seems to drop a few bytes from the 64K message on slower windows 10 machine. Ok on our windows 7 machines. In fact it is loosing 64 bytes somewhere, which is a USB packet now I think about it.
This might be related to the window software that you use to get the data. I assume you are using some kind of terminal program. I use CoolTerm. Works well on MAC/Linux/Windows.
Yes I think so. It seems to drop the odd 64 byte packet now and again, when running on a slower windows machine. I have some C# software implementing the serialport. It works well on most computers.
Going back to my original question, I was trying to find a way to slow down the CDC data throughput from the nRF52840, but don't think the baudrate setting can be changed.
I think you can use the UART flow control signal for that. You can set CTS/RTS bit and in the CDC should receive it. It's in the USB standard CDC control line state.