cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F051 SPI problems

gabor
Associate
Posted on July 02, 2014 at 19:05

Hi!

Sorry for interrupting you guys, but I would like to ask for some help! I'm currently trying to use the SPI in my STM32F051C8 MCU.

I'm trying to use the SPI int Full Duplex mode. I'm trying to set some registers in my slave device, but there is a problem with the communication. I want to send out two bytes, the first is the address of the register I want to set and the second is the data I want to set. The MCU send first sends out the address byte, then a byte full of 0s (0x00), then it's sending out the data byte I wanted and then another 0x00. Because of that my slave device ''thinks'' I want to set a register as 0x00.and the rest is ignored. I tested it with an oscilloscope and a logical analyzer too.

This kind of behavior is perfect, when I want to read out a register, but not when I want to set it and I cant fill a whole page in a slave memory device.

Just so you know this is for my thesis and I'm not allowed to use the Peripheral libraries, I have to write my own.

Thank you for your help!

#stm32f0-spi
0 REPLIES 0