cancel
Showing results for 
Search instead for 
Did you mean: 

Uneven DMA SPI transfer

benoit2
Associate II

Hi,

I am trying to control a lot of RGB leds at the same time through TLC5955 RGB SPI controllers/

I have 11 of them daisy chained to my STM32F7. Each one of them needs 1 bit (0 for data transfer) and then 768 bits of data (96 bytes). As you can see data is not aligned and i need to add a bit to 0 before each of my 11 controllers.

I managed to do this by sending 1058 (96x11 + 2) bytes through SPI DMA with a huge overhead by populating my buffer bit by bit.

My dream is to be able to send 1 bit and then my 96 bytes. Do you have any idea of how to do this ?

I already tried to send 9 bits ( hspi4.Init.DataSize = SPI_DATASIZE_9BIT;) and then 95 bytes ( hspi4.Init.DataSize = SPI_DATASIZE_8BIT;) with no success.

Do you think it's even possible to send 9 bits through DMA..?

Or to force SPI to send one clock before my 96 bytes DMA transfer ?

Thanks in advance for your help,

Cheers.

1 REPLY 1

Switch the SCK and MOSI pins to GPIO between the frames and do the one bit manually.

JW