First steps with UART

A project log for Linear CCD module

TCD1304-based linear CCD module driven by a Nucleo F401RE + Raspberry Pi.

esben rosselesben rossel 07/08/2016 at 14:573 Comments

I will keep this short.

Transmitting data with DMA+UART is now working. I can send and receive data through the nucleo's built-in ST-link. However the maximum baud rate I've been able to achive is 230400bps, which means that transmission of data worth a full CCD takes:

I won't have access to an oscilloscope until august, so I can't verify the figure, but from simple tests it does not seem completely unreasonable.

The same amount of data is moved in 4ms with SPI, so communication with UART is roughly 80x slower than with SPI. It's acceptable, but I really wish I could get it under 100ms.

The 230400bps is with 16x oversampling. The STM32F401 can also do 8x oversampling, but neither setting gets me a higher baud rate.


esben rossel wrote 08/04/2016 at 16:10 point
thx for the suggestion,

 I will try that out in the coming days.

  Are you sure? yes | no

jnk0le wrote 08/01/2016 at 14:19 point

try setting baudrate in 500k steps.

It might be the same problem, as in the ft232 where 230400bps is the maximum supported "standard" baudrate.

  Are you sure? yes | no

esben rossel wrote 08/15/2016 at 17:48 point

I've been playing a bit with the baud rates again. It turns out it wasn't the nucleo that was setting the speed limit. It was the terminal settings on my laptop. Running:

stty -F /dev/ttyACM0 1152000 (insert your desired baud rate)

before connecting to the device, allows for baud rates up to 1.5 Mbps (at 2Mbps errors start sneaking into the transmission). It can probably be tweaked to work even faster ..the maximum baud-rate for USART2 on the STM32F401RE is 5.25Mbps according to the datasheet, and the STM32F103 (inside the ST-link) has a max baud rate for its USARTs of 4.5Mbps or 2.25Mbps).

Anyway I'm perfectly happy with 1.15 Mbps.

  Are you sure? yes | no