# STM32F0 SPI programming of MAX7219

I am new in the world of embedded software. But I was having normal challenge in blinking LED and SPI bridge communication on STM32F0-Discovery. All this work fine. Now I was planing to go to next level, but for sure I do not really understand some things. To program I am using STM32Cube for configuration ( 8 Bit datasize, 187,5KBits/s and MSB first) as usual.

For testing I define:

uint8_t display[8] = {0,0x7F,0xFF,0xCC,0xCC,0xCC,0xFF,0xF}; //A


For sending the data, as through the STM32Cube all the initialization is done, I wrote the following code in the while-loop:

HAL_GPIO_WritePin(GPIOC,GPIO_PIN_4, GPIO_PIN_RESET); //here is chip select
trasnmit = HAL_SPI_Transmit_IT(&hspi1, display, 8);
//HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_SET);
HAL_Delay(5);
HAL_GPIO_WritePin(GPIOC,GPIO_PIN_4, GPIO_PIN_SET);


Of course I am getting my CLK on the oscilloscope but no data at the DIN-Pin of the MAX7219 (see: https://www.ebay.de/i/273605021101?chn=ps)

While debugging, I can see that the transmit function is being skipped, what could be the cause? But the return value is always on HAL_OK.

Could somebody help me with a step by step config of the MAX7219 based on STM32, so that I can better understand where my problem is.

• I edited the question to make it more readable. If you feel like I changed to much, please rollback to the original. – Arsenal Apr 30 at 15:02