Speed of uart
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Speed of uart
What's the fastest i can make uart go?
What's the biggest number i can enter for baudrate?
I try 9600 things work.
I move up to 112500 still ok.
From a raspberry pi header file i find a rate 1125000 things still seem ok.
When i try another number from that header like 16000000 my data transfer still happens, but it now takes a couple of milli seconds, previously it took micro seconds at 1152000.
What's the biggest number i can enter for baudrate?
I try 9600 things work.
I move up to 112500 still ok.
From a raspberry pi header file i find a rate 1125000 things still seem ok.
When i try another number from that header like 16000000 my data transfer still happens, but it now takes a couple of milli seconds, previously it took micro seconds at 1152000.
Re: Speed of uart
I've used the UART on the pyboard at 1 Mbit (1000000) to talk to bioloid servos.
Re: Speed of uart
We regulary use STM32 UARTs up to 3Mbaud. I have to admit that we are also using proper 20 Mbaud differential line drivers
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: Speed of uart
So i use one of these line drivers between Rx and Tx on my 2 devices and this microchip allows for a higher data throughput
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: Speed of uart
I'm using 2 pyboards with headers. Connected with 'arduino ' wires. I can only run for 6minutes before i get some data corruption
Will i be better of buying some more pyboards, but soldering wires to them?
Will i be better of buying some more pyboards, but soldering wires to them?
Re: Speed of uart
Since you are communicating between two physically-close boards, have you considered SPI?
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: Speed of uart
I found spi prone to dropping packets. I wrote a little dummy program passing data between SPI(2) and SPI(1) on one pyboard.
What I'm doing the reciever is busy writing data to SD card i have a big buffer on my uart (16kb)
What I'm doing the reciever is busy writing data to SD card i have a big buffer on my uart (16kb)
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Speed of uart
SPI slave mode is not supported.
UARTs are reliable at speeds of a few Mbaud but, as with any fast communication, you need to consider electrical issues. The serial protocol requires clean edges. The receiver starts timing on the leading edge of the start pulse, sampling subsequent bits in the middle of the bit period. If edges of the start bit or data bits are slow or of poor quality, bit errors can occur.
The solution is to use short wires and a good ground connection. If long distances have to be covered, special line driver chips exist. These normally use differential signalling and expect shielded twisted-pair cabling with termination resistors.
UARTs are reliable at speeds of a few Mbaud but, as with any fast communication, you need to consider electrical issues. The serial protocol requires clean edges. The receiver starts timing on the leading edge of the start pulse, sampling subsequent bits in the middle of the bit period. If edges of the start bit or data bits are slow or of poor quality, bit errors can occur.
The solution is to use short wires and a good ground connection. If long distances have to be covered, special line driver chips exist. These normally use differential signalling and expect shielded twisted-pair cabling with termination resistors.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.