Console baudrate

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
nelfata
 
Posts: 31
Joined: Wed May 07, 2014 9:44 am

Console baudrate

Post by nelfata »

How to change the console baud rate?

User avatar
westfw
 
Posts: 2005
Joined: Fri Apr 27, 2007 1:01 pm

Re: Console baudrate

Post by westfw »

On which platform? Most of the circuitPython-capable boards use a direct USB connection for the "console", and baudrate there is irrelevant.

User avatar
nelfata
 
Posts: 31
Joined: Wed May 07, 2014 9:44 am

Re: Console baudrate

Post by nelfata »

Thanks for your reply.
I am using the nRF52840 DK, the USB shows up on my PC as a COMPORT and I would like to change the baudrate from 115200 to a higher rate.

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: Console baudrate

Post by Franklin97355 »

OK, what programming language are you using and what are you using to communicate? Do you want to increase the speed of the board or the speed of the computer that connects to the board?

User avatar
nelfata
 
Posts: 31
Joined: Wed May 07, 2014 9:44 am

Re: Console baudrate

Post by nelfata »

I can either build Circuitpython from source code, or use some boot.py setting to change the console baud rate (communication between a Circuitpython board and the PC, as I mentioned the COM port).

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: Console baudrate

Post by Franklin97355 »

nelfata wrote:I can either build Circuitpython from source code, or use some boot.py setting to change the console baud rate
Great, glad you figured it out.

User avatar
nelfata
 
Posts: 31
Joined: Wed May 07, 2014 9:44 am

Re: Console baudrate

Post by nelfata »

I was only saying that I can build the code if need be, but searching through the code I could not find a place where the baudrate is set to change the console speed.
In other words, I saw the setting of 115200 but changing it did not make a difference. So no luck yet.

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: Console baudrate

Post by Franklin97355 »

What program are you trying to chane the baudrate with?

User avatar
nelfata
 
Posts: 31
Joined: Wed May 07, 2014 9:44 am

Re: Console baudrate

Post by nelfata »

No worries, I will figure it out. Thank you for your response.

User avatar
westfw
 
Posts: 2005
Joined: Fri Apr 27, 2007 1:01 pm

Re: Console baudrate

Post by westfw »

I am using the nRF52840 DK, the USB shows up on my PC as a COMPORT and I would like to change the baudrate from 115200 to a higher rate.
I am pretty sure that the nRF52 chips are among those "direct USB" chips where the baud rate setting is irrelevant.
You can check by changing the speed of your terminal emulator (say, to 9600) - if there's an actual serial port, it will stop communicating. If it's got HW USB, it will proceed at the same rate it's always used.

That doesn't mean that it's as fast as you'd want it to be. All sorts of things can slow down the end-to-end data rate, and I think I've seen some "pretty poor" benchmarks for USB data speed (but on a different CPU.) Also, I've looked at some of the USB code and been pretty shocked by how many times the data was copied :-( And the radio-equipped chips usually run some sort of OS, which can introduce additional inefficiencies.

User avatar
nelfata
 
Posts: 31
Joined: Wed May 07, 2014 9:44 am

Re: Console baudrate

Post by nelfata »

Yes it seems that the baud rate is irrelevant. But I was not expecting this behavior, I used Putty and set the baud rate to 9600 and it still worked at whatever speed, it seems that the driver is ignoring the baud rate settings.
Thank for the reply.

User avatar
westfw
 
Posts: 2005
Joined: Fri Apr 27, 2007 1:01 pm

Re: Console baudrate

Post by westfw »

It's a bit surprising, but it makes sense. USB is going to operate at a (fundamental) data rate of 12Mbps, but that's packetized and shared amongst all the devices connected to a hub port (although some of them will be low-speed 1.5Mbps and some High-Speed 480Mbps, and maybe even some "Super-Speed"...)

Although the software and firmware makes the connection LOOK like a COM port, there is no actual hardware any where in the path that limits the "baud rate" (such as an actual UART.) Artificially limiting the data transfer rate would be significantly more complex to implement than just operating at however fast the USB subsystems push the data...

User avatar
tannewt
 
Posts: 3298
Joined: Thu Oct 06, 2016 8:48 pm

Re: Console baudrate

Post by tannewt »

The baudrate is communicated over USB in case the connected device is actually transmitting over UART (which it isn't usually in CircuitPython.)

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”