Hallo,
wenn es in einem Sensor Datenblatt zu der SPI Anbindung heißt:
Data format: 16 data bits
Frame Sync: None
Module-Selection: SS-Pin
Clock Edge Select: Serial output data changes on transition from idle
to active clock state
SPI Data Input Sample Phase: Data sampled on transition from active to
idle
clock state
Clock Polarity: Idle state is high level, active is low level.
entspricht dies dann meiner Konfiguration?
Das Problem ist nämlich das SDO (MISO) nicht high ist im idle state.
1 | SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
|
2 | SPI_InitStructure.SPI_DataSize = SPI_DataSize_16b;
|
3 | SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;
|
4 | SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
|
5 | SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
|
6 | SPI_InitStructure.SPI_BaudRatePrescaler = baudrateprescaler; //SPI_BaudRatePrescaler_8;
|
7 | SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
|
8 | SPI_InitStructure.SPI_CRCPolynomial = 7;
|
9 | SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
|
10 |
|
11 | SPI_Init(SPIx, &SPI_InitStructure);
|
12 |
|
13 | /* Configure the RX FIFO Threshold */
|
14 | /* Enable SPI */
|
15 | SPI_Cmd(SPIx, ENABLE);
|
16 |
|
17 | /*Config SPI to generate Interrupts on Tx buffer empty and Rx buffer not empty*/
|
18 | SPI_I2S_ITConfig(SPIx, SPI_I2S_IT_TXE|SPI_I2S_IT_RXNE, DISABLE);
|
Vielen Dank
Anhang: Ist-Zustand und der Soll-Zustand (gezoomt im Analyzer)