AnsweredAssumed Answered

Problem SPI STM32F405 for TLC5971

Question asked by ip on Aug 31, 2017
Latest reply on Sep 1, 2017 by Vangelis Fortounas

Hi everyone,

 

I'm trying to program a TLC5971, with the SPI1 of STM32f405. Unfortunatly the PWM of the TLC5971is not working. It is a LED driver

 

I have checked the inpunt of the TLC5971, Vcc= Vreg=3.3V, GND is also good. And the data and clock of the spi arrives ok to the TLC5971. It is even propagated to SCKO  and SDTO. To be honest, the signal SCKI is perfect on the input

 

In order to give the right parameters, I have to send  the 224 bits register, with the first 6 MSB being 0x25. This is the write instruction who actionates the latch.

 

I feel maybe the SPI1 of my STM32f4 is not doing the job, because I don't have pwm. At the end 8 cicles scki should be down for the tlc5971 to produce the latch and register the parameters.

The code of programming is the following : 

 

uint8_t PWM_buffer[28] = {0x94, 0x5F, 0x0F, 0xFF, 0xFF,0xFF, 0x03, 0x03,0x03,0x03,0xFF, 0xFF,0xFF,0xFF, 0xFF, 0xFF, 0xFF,
                  0xFF,0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0x5,0x5, 0x5, 0x5}; /// Commands to program TLC5971 + data of colors for an example
    HAL_SPI_Transmit(&hspi1, PWM_buffer,28,1); /// I send  all the commands + data to the TLC5971
    HAL_GPIO_WritePin(MCU_SCKI_GPIO_Port,MCU_SCKI_Pin,GPIO_PIN_SET); /// I set the SCKI High so TLC5971 creates the latch and register.
 
while(HAL_GetTick()<150){}; /// Delay
SPI : ( slow baud rate; 328.125Kbits/s; CPOL Polarity Low; Phase CPHA: 1 Edge)
Any idea what I'm doing wrong?
Thank you in advance
ip

Outcomes