2011-08-02 11:24 PM
Hai,
I am using STM32F103ZE I am not getting SPI data correctly. Master is transmitting correctly. But always read as zero where a non zero value has been sent. Master config: (MSP430) The master configuration is correct. (I tested it.) Master Mode, MSB First, 8-bit SPI, Inactive state is high., ss grounded, 1 MHz clock, no dividers Slave Config (STM32F103ZE) Using SPI2. SPI_InitStructure.SPI_Direction = SPI_Direction_1Line_Rx; SPI_InitStructure.SPI_Mode = SPI_Mode_Slave; SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b; SPI_InitStructure.SPI_CPOL = SPI_CPOL_High; SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge; SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2; SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; SPI_InitStructure.SPI_CRCPolynomial = 7; Anybody have an answer, Thanks Hari #stm32 #versaloon #stm32f103ze-spi #spi2011-08-05 06:42 AM
Thanks for your reply.
In My master I am configuring CPHA = low, and CPOL = high That was my problem. The I thought that the CPHA must be same for both master and slave Thanks a lot for your help clive1.2013-09-27 05:42 AM
Yes, same CPOL and CPHA is very important for SPI interface, it was also some problem for me with using it via versaloon programmer and stm32 spi slave, and
are some detail description about SPI modes in versaloon SPI interfaces.