2014-06-03 07:47 PM
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 #stm322014-06-03 08:56 PM
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.2014-06-03 09:04 PM
Thanks a lot.
2014-06-03 10:25 PM
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?
2014-06-04 04:18 AM
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.2014-06-09 02:27 AM
Thanks Clive.
2014-06-10 11:51 AM