Valid serial baud rates?

114 views
Skip to first unread message

Bugs

unread,
Jun 16, 2019, 8:44:53 AM6/16/19
to Annex WiFi RDS
Is there a list somewhere for Annex?

I have been trying to communicate with a MIDI keyboard at the standard 31250 baud rate using "serial.mode 31250" statement.
As far as I can establish (by using a terminal to transmit) the ESP  is receiving at 28800 baud.
I have checked that an Arduino Uno works using ver 1.8.9.

If this MIDI baud rate is not available yet, may I request a feature addition please.



cicciocb

unread,
Jun 16, 2019, 10:50:49 AM6/16/19
to Annex WiFi RDS
Have you tried on serial 2?

Bugs

unread,
Jun 16, 2019, 11:22:29 AM6/16/19
to Annex WiFi RDS
Hi,

I had not - but just done a quick check and I can get two-way communication at 31250 baud on serial2.
I had ignored it because of the receiving speed limitation mentioned in the help file:-
"Note: although it can be used up to 115200 in transmission, reception is limited to 9600 baud."

 I am not far enough into the programming yet to tell if missing or corrupting bytes.

Bugs

unread,
Jun 16, 2019, 11:41:36 AM6/16/19
to Annex WiFi RDS
ok - a quick echoing test with serial2 is fine at 9600 and possibly 19200 but missing characters at 28800 upwards

at 28800 baud
the uick brown fox jumps over the lazy dog
the quik brown fox jumps over the lazy dog
the quick brown fox jumps over the lazy dog
the quick brown fox jumps over the lazy dog
the quick brown fox jumps over he lzy dog
the quick brown fox jump over the lazy dog
the quick brown fox jumps over the lazy dog
the quick brownfox jumps ovr the lazy dog

at 31250 baud
the uick brown fox jumps over the lazy dog
the quick brown fox jumps over the lazy dog
the quick brown fox jumps over the lazy dog
the quick brown fox jumps over te lazy dog
the quck brown fox jumps over the lazy dog
the quick rown fox jumps over the lazy dog
the quick brown fox jumps over the lazy dog
the quick brown fox umps over the laz dog
the quick brown fox jmps over the lazy dog
the quick brown fox jmps over the lazy dog
the quick brown fox jumps overthe lazy dog
the quic brown fox jumps overthe lazy dog

cicciocb

unread,
Jun 16, 2019, 2:20:06 PM6/16/19
to Annex WiFi RDS
Yes, the serial 2 is sw based so it is not reliable at high speed.
By the way the serial should work, need to check why it doesn’t at 31250.

Bugs

unread,
Jun 16, 2019, 2:31:56 PM6/16/19
to Annex WiFi RDS
Thanks - it is not high priority as have (too) many other things on the go - but will be interested to see your findings later.

cicciocb

unread,
Jun 18, 2019, 1:35:15 PM6/18/19
to Annex WiFi RDS
Just tested and I'm able to set 31250 as baudrate on the serial.
I'm able to receive using termite terminal emulator that permit to set this custom speed.

So I don't see any issue.

Bugs

unread,
Jun 18, 2019, 5:14:16 PM6/18/19
to Annex WiFi RDS
Very strange.  I will check again tomorrow and report back. 

Bugs

unread,
Jun 19, 2019, 11:20:50 AM6/19/19
to Annex WiFi RDS
Well that took some time.

I downloaded Termite so we were using the same program but got the previous garbage received by the PC with a simple Annex program
serial.mode 31250
pause 1000
print"running"
print "1234567890"

Received output shown on left below (com9):-

cp2102.jpg



I then swapped to another Lolin module instead of the usual Amica and it worked (com8 below left)!

ch340g.jpg


The screen dumps on the right each time are a simultaneous connection via an FTDI adapter to the TX pin of each ESP module.
This shows that Annex is innocent and the CP2102 (or driver) is guilty.
The CH340G in the Lolin functions as expected.

Sorry to have wasted any of your time - but at least my first post just asked a question without any statements...




cicciocb

unread,
Jun 19, 2019, 1:52:07 PM6/19/19
to Annex WiFi RDS
No problem,
I was just surprised as there are no particular limits to the serial speed.

This will be probably useful for our Ham radio fan.

Dwight

unread,
Jun 19, 2019, 2:45:06 PM6/19/19
to annex_w...@googlegroups.com
might be helpful to connect an oscilloscope to monitor the bitstream of the offending module and compare it to the good module.
If you don't have one and have a spare $349 usd I highly recommend the Rigol DS1054Z.
you can flash new firmware to bump it from 50MHz to 100 MHz and also add in serial decoding, I2C, etc.

as you probably know, an oscilloscope is a very useful troubleshooting tool for your electronics workbench.

dwight

Bugs

unread,
Jun 20, 2019, 8:17:56 AM6/20/19
to Annex WiFi RDS
Hi Dwight,

I was resisting hauling out the scope but did some checks this morning to confirm previous findings.
As a sanity check I looked at the midi output from a Yamaha keyboard and confirmed calculation of about 32 uS per bit at 31250 kHz.
Then checked the FTDI serial output was correct when a terminal program on PC sending a string at 31250 baud.
Just triggering and monitoring the start bit is sufficient to detect the difference between 28800, 31250 and 38400 baud,

With the scope connected to the RX pin in each case, thus just monitoring the UART output to the processor/ESP, I then connected the PC usb cable (transmitting the character string) to:-
Amica Nodemcu with CP2102 UART         = 35uS = 28800 baud
Lolin ESP with CH340G UART                  = 32uS = 31250 baud
Arduino UNO with CH340G UART             = 32uS = 31250 baud
which confirmed my previous suspicion that the CP2102 is just dropping back to the nearest standard rate.

I think the CP2102 can be programmed for non-standard rates but don't know if this can be done in the field or just to factory order.

Now must really tidy up and do something useful...


Bugs

unread,
Jun 21, 2019, 9:42:52 AM6/21/19
to Annex WiFi RDS
Just a postscript - the intended tidying did not happen - instead further googling found:-

The process explained in their application note here:-

The baud rates for the CP2102 UART are in a table which can be edited so I changed an unused baud rate (4000 baud) to give 31250 when 3125 requested by the PC via USB..

I don't expect anyone else to be interested but if I don't write it down it will be forgotten in a week or two...
Gonna shut up now.

Dwight

unread,
Jun 21, 2019, 9:51:23 AM6/21/19
to Annex WiFi RDS
Very good research Bugs!
This is fascinating to me.  So were you successful in changing it ( I assume you were)?

I support your choice of focus :-)
At least this one gives a burst of endorphins when you succeed!

Thanks for sharing!
dwight

Electroguard

unread,
Jun 21, 2019, 10:24:10 AM6/21/19
to Annex WiFi RDS
Sounds like a meeting of the 'Serial Masochists Club"   :-)
Reply all
Reply to author
Forward
0 new messages