CP2102N baud rate wrong. - Page 1
Forum section: electronics / projects

author: phil from seattle
author_rank: Super Contributor
timestamp: February 08, 2018, 04:02:55 am
content: I designed and build a board based on the SiLabs CP2102N. Got my PCBs today and populated/reflowed it. Happy to say that it works. However, I am seeing the weirdest problem. I'm using it to talk to an Arduino Pro running at 3.3V. Uploading sketches works fine but I was getting gibberish on the serial monitor that looked a lot like a baud rate mismatch. Sure enough, the baud rate that the sketch set (9600 in this case) was actually 1/2 the speed that the monitor was seeing. I set the monitor to 4800 and it is displaying correctly. See the attached picture.Does anyone have an idea what is going on here and how to correct this? I know I could double the baud rate but want to understand why it is wrong. I have an SiLabs CP2102N mini eval kit that I will try in a bit but I need to make up a harness for it.Some details - Using the QFN28 version of the CP2102N. RX is configured open-drain and TX is configured push-pull. In the arduino IDE I'm using Avrdude and baud rate there is 57600. Based on the monitor output being what I expected and programmer output shown below, I believe the upload was correct. I've included my schematic as well.Here's the verbose output of the programmer:Quote

author: phil from seattle
author_rank: Super Contributor
timestamp: February 08, 2018, 04:14:40 am
content: Hmmm, one clue. In the device manager, the com port entry for COM8 believes the device is running at 9600 baud. So maybe it's not the chip at all but the SiLabs USB driver? Windows 10 with the latest updates. changing the baud rate in the com properties panel to anything winds up having it go to 4800 baud so I believe that is the real baud rate coming from the chip.

author: jeremy
author_rank: Super Contributor
timestamp: February 08, 2018, 04:59:11 am
content: What is the real baud rate? Check it with an oscilloscope?

author: phil from seattle
author_rank: Super Contributor
timestamp: February 08, 2018, 05:29:52 am
content: Good idea. Maybe with a LA.

author: jeremy
author_rank: Super Contributor
timestamp: February 08, 2018, 05:33:59 am
content: The quick way I normally do it is1. Repeatedly transmit 0xAA or 0x552. Scope the TX line3. Place the cursors on the edges of a single high or low pulse, and read off the cursor frequency (often shown as delta X), otherwise do 1/period. 9.6kHz = 9600 baud, 115.2kHz = 115200, etc

author: Psi
author_rank: Super Contributor
timestamp: February 08, 2018, 05:46:18 am
content: My guess is your Arduino ide is set to the wrong arduino board type.Some boards have different xtals but are otherwise the same.And some cheap clones have the wrong xtal for the board they are sold as.So your ardunio IDE thinks the board is running at a different speed to what it actually is and is therefor calculating the uart settings wrong when it tries to setup 9600.Arduino IDE probably thinks your ardunio board has a 16mhz xtal but it really has 8mhz.So 9600 becomes 4800Have a look in the board config section. Sometimes there is two options for an Arduino board 8mhz and 16mhz

author: phil from seattle
author_rank: Super Contributor
timestamp: February 08, 2018, 06:05:31 am
content: That's what it was.