Ettan
Posts: 2
Joined: Fri Jun 12, 2015 7:36 am

What is the max baud rate for UART/SPI on RPi2 model B

Fri Jun 12, 2015 8:49 am

Hi Forum,

Does anyone know what is the max baud rate for Raspberry Pi 2 - Model B ?
I've done some research without any luck.

Im woundring if RPI2 could handle ~6 Mbps on either UART or SPI?

Thank you for your inputs.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2850
Joined: Thu Jul 11, 2013 2:37 pm

Re: What is the max baud rate for UART/SPI on RPi2 model B

Fri Jun 12, 2015 10:18 am

The UART clock is divided from the core clock frequency and uses 16x oversampling, so the "max" baud rate is 250MHz/16 = 15.6Mbaud/s.

At such a high frequency, you will get throughput issues as the FIFOs in the UART are not very deep - 16 / 8 entries. As each entry is only 8 bytes of data, you have to service a lot of interrupts to push that much data through. 6Mbps is reasonable, but expect a core to be quite busy when running at this level of data rate.
Rockets are loud.
https://astro-pi.org

Ettan
Posts: 2
Joined: Fri Jun 12, 2015 7:36 am

Re: What is the max baud rate for UART/SPI on RPi2 model B

Fri Jun 12, 2015 11:06 am

Thank you jdb for you quick and good answer.

Not a very deep FIFO indeed, do you know any UART shields that could supply the RPi2 with a better UART?

User avatar
joan
Posts: 16214
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: What is the max baud rate for UART/SPI on RPi2 model B

Fri Jun 12, 2015 11:26 am

SPI should be fine at 6Mbps, it can probably do twice that without too many problems.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2850
Joined: Thu Jul 11, 2013 2:37 pm

Re: What is the max baud rate for UART/SPI on RPi2 model B

Fri Jun 12, 2015 11:49 am

One significant difference between SPI and UART - neither UART has DMA wired up, so you have to use either polled or interrupt-driven I/O.
Rockets are loud.
https://astro-pi.org

Return to “Interfacing (DSI, CSI, I2C, etc.)”