cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with STM32F103ZE SPI data send

ayanmukherjee
Associate II
Posted on June 04, 2014 at 04:47

Hello I am trying to send opcode bytes MCBSTM32 to GP22. But as I debug in Keil I observe the the byte to be sent(0x50) is nit being written on the SPI data register in stm32f10x_spi.c. Instead the data register is showing 0xx00FF. I fail to understand why this is happening. Please help. Thanks.

#spi #stm32
6 REPLIES 6
Posted on June 04, 2014 at 05:56

The SPI->DR is TWO distinct peripheral registers, it is not a memory cell, and you and the debugger cannot read the value you wrote to the outgoing register buffer.

Reading it will also effect bits in SPI->SR

Don't park a register view over peripheral registers that will be altered by doing so. The debugger can and will do things which are invasive.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ayanmukherjee
Associate II
Posted on June 04, 2014 at 06:04

Thanks a lot.

ayanmukherjee
Associate II
Posted on June 04, 2014 at 07:25

Sir, Can you please suggest any method by which I can confirm that the correct opcode has been transmitted to the GP22 IC from STM32f103ZE?

Posted on June 04, 2014 at 13:18

Can you please suggest any method by which I can confirm that the correct opcode has been transmitted to the GP22 IC from STM32f103ZE?

If you want to examine the signalling on the wire you'd use an oscilloscope or a logic analyzer.

Then, if you believe the hardware is doing it's job, you can also print the bytes out before you send them.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ayanmukherjee
Associate II
Posted on June 09, 2014 at 11:27

Thanks Clive.

ayanmukherjee
Associate II
Posted on June 10, 2014 at 20:51

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6b1&d=%2Fa%2F0X0000000brP%2FWJjCPlEqg0YCbZCgajNCGOzRDn5rdAhXWoESSF7tr4o&asPdf=false