2020-11-03 01:05 PM
Hi Guys,
I have an F7 and want to read in a data stream.
Transfer is synchronous, constantly on and data rate is about 2kBaud.
1 Frame consist of 64 bits, in which i have to find a pattern for the start.
I want to use a DMA with maybe 128 bit transfer width to get at least 1 frame in there, while i do not need to grab every frame.
I do not have a lot of experience in USART and SPI peripherals of the F7. But i think both should work.. Does somebody has any suggestion which works better for my usecase?
Cheers
2020-11-03 02:15 PM
I would use UART at that speed simply because it uses less wires and doesn't need to be synced up with a CS line and it has some amount of built-in protocol checks in that errors in the start/stop/parity bits will likely be caught.
Receive into a circular buffer and process on the half and full complete interrupts, or poll periodically.
2020-11-03 02:18 PM
The USART Synchronous mode doesn't take an INPUT CLOCK, it only outputs one.
The SPI can be used in a SLAVE mode which will take an INPUT CLOCK.
You could probably do it on a continuous loop, you'd need to fish out the data dealing with any sync/preamble data, and the byte/frame alignment.
With DMA you can trigger an interrupt at half and full buffer points to fish the bit stream.
2020-11-03 02:38 PM
That's a clear plus to SPI. I thougth USART can also input clock. However i could use UART without clock since i have a fixed clock, but why not using it when having it ;-).
Thanks for both comments