cancel
Showing results for 
Search instead for 
Did you mean: 

SPI last bit spoilage

oscar_fridman
Associate II
Posted on December 25, 2011 at 17:34

Hello

I'm using stm32f103 controller and via SPI trying to read data from EEPROM Microchip 25LC080B.

The problem I deal with, is last bit corrupting when reading from eeprom, sometimes 0->1 and sometime 1->0, I've verified with scope. I assune writing to eeprom is OK becasue i got a response.

Thats how I'm initializing SPI port

{

  SPI_InitTypeDef SPI_InitStructure;

  SPI_StructInit(&SPI_InitStructure);

  SPI_Cmd(SPIx, DISABLE);  

  SPI_I2S_DeInit(SPIx);

  /* SPIy Config */

  SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;

  SPI_InitStructure.SPI_Mode = SPI_Mode_Master;

  SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;

  SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;

  SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;

  SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;

  SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;

  SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256; 

  /* Configure SPI */

  SPI_Init(SPIx, &SPI_InitStructure);

  /* SPI enable */

  SPI_Cmd(SPIx, ENABLE); 

}

Thanks

#spi-stm32f103
10 REPLIES 10
stepanovr
Associate II
Posted on June 17, 2016 at 22:09

Thank you for valuable information.

Clock pin usage as a clock for receiver at least explains why a capacitive load on clock influences on the read data. On recent ST seminar I was explained by a ST representative that the only support way is the e2e forum. I hope to get some explanations of what am I doing wrong. The problem is not listed in errata and I believe that I am doing anything wrong.