🌈 ESP32-S3 Rainbow: ZX Spectrum Emulator Board! Get it on Crowd Supply →
View All Posts
read
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi

This video's all about how the baud rate setting on an ESP32S3 with native USB does absolutely nothing. Testing with different baud rates showed no effect on performance; every rate worked flawlessly. With USB full speed, you can expect data transfers of up to 7 megabits per second. So, baud rate? Totally irrelevant with native USB—it's full steam ahead, folks! Grab my test code from GitHub, give it a go, and share your results in the comments. If that blew your mind, don't forget to like and subscribe for more ESP32 insights!

Related Content
Transcript

This number does absolutely nothing.




Nothing.
Nothing. Nothing. What does that mean?
You will find this line of code
everywhere. A quick search of GitHub
finds over 450,000 examples. I
discovered this while testing my new
boards from PCB way. And despite a small
mistake on my part, they nailed the
build completely. Everything works
beautifully. But I needed to transfer a
lot of data over serial. And I thought
maybe I should bump up the board rate.
We can go from a very snails pace 9,600
bits pers through the classic 56k that
I’m sure a lot of you remember
all the way up to number 11 with 921600
which gives you a smashing 115 kilob per
second. The numbers all go to 11.
But here’s the catch. The ESP32S3
doesn’t have a USB to UART chip. It has
native USB. So if there’s no UART clock,
what does this board rate actually do?
So I tested it different board rates and
every single one worked flawlessly. I
first tried it out using the serial
monitor. The firmware is set to 115200,
the classic setting, and the monitor is
set to the same rate. And as you’d
expect, it works without any issues. The
firmware just echoes a capitalized
version of what it receives. Then I
tried changing the monitor speed to
9,600 and it still works perfectly.
What’s going on? To really test it, I
wrote a script. It enumerates a whole
bunch of board rates and as you can see,
they all work perfectly. The board rate
number does nothing. So if board rate
doesn’t matter, how fast can we actually
go? Well, USB full speed runs at 12
megabits pers with overhead. The maximum
we should be able to get should be
around 9.6 megabits pers. So, I wrote
some new firmware that just blasts out a
4 megabyte packet. And I wrote a simple
script on my computer that receives the
data and tests the speed. Just to make
sure that no one’s cheating, I included
a CRC check. The result for my Arduino
version of the code, we get over 7
megabits per second. That’s nearly 1
megabyte a second. For you IDF fans, I
tried the same with tiny USB and I got 5
megabits pers. Surprisingly, not as
fast, but there is a hope for you IDF
fanboys. It is being worked on. There
are some issues on the tiny USB
implementation. Now, of course, this is
just test code. Real applications may be
slower. But here’s the takeaway. With
versions of the ESP32 with native USB,
board rate doesn’t matter. With older
chips that do use USB to UART bridges,
you’re stuck with the UART limits. I put
all my test code on GitHub. There’s a
link below. Try it out yourselves and
let me know what speeds you get in the
comments. And if this surprised you, hit
the like and subscribe. I’ve got more
ESP32 deep dives coming soon.




HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
Blog Logo

Chris Greening

> Image

atomic14

A collection of slightly mad projects, instructive/educational videos, and generally interesting stuff. Building projects around the Arduino and ESP32 platforms - we'll be exploring AI, Computer Vision, Audio, 3D Printing - it may get a bit eclectic...

View All Posts