Serial Communication at 1Mb

Hi everyone,

I was just wondering if it is possible to communicate at 1 Mb/s using the UART peripheral and if there is any example code to start with. In the case that it is not possible, I would appreciate if you can explain why it is not possible and which is the maximum speed using the UART. .

Thank you

See:-
http://forum.arduino.cc/index.php?topic=21497.0

Well technically, the UART is capable of up to 8Mhz in Synhronous Master Mode.

I've had the UART set to run at 8Mhz and outputting video data smoothly in Master SPI mode. I believe the max rate in UART Synchronous master mode is 8Mhz as well. It is double buffered, so actually seems to perform better in some ways than the actual SPI hardware. This would put the maximum transfer rate at 8mHz/8bytes = 1MB/s minus overhead (start, stop bytes etc) So 1MB/s or 8Mbps would be the max rate minus overhead. In non-synchronous modes, the limit is 2mbps according to the datasheet (250KB/s minus overhead).

An example sketch for outputting NTSC video at 8mhz is a bit messy but is here: GitHub - TMRh20/Sketches: Arduino Audio Streaming Realtime, NTSC Video

I did a bit of a writeup on ensuring the output is timed correctly and smooth, which can be found at my blog:

It may not work that well at 8mhz for actual communication, I haven't tested that specifically. It might require a kind of custom solution as well, as the Arduinos would not be able to stream at 8MHZ continuously without a large memory buffer.

*Edit to add: Just remembered, that I have used it at 8mhz in SPI mode for controlling a radio module and it worked well for that communication, so there is no reason it wouldn't work otherwise.

Hi,

thank you very much for your answer and for your code, this will be very helpful for my problem. I have one question though, is it possible to communicate with the PC using SPI mode? I have read that the serial communication limitation is on the PC side, since it is only possible to configure up to 115200 bps, even though I am using a USB cable. And if that is the case, is it possible to overcome this problem using Linux?

Thanks again for all your help

is it possible to communicate with the PC using SPI mode?

Only if your PC has an SPI interface. Most don't but things like the Raspberry Pi does.