AnsweredAssumed Answered

AIS3624DQ WHO_AM_I returning 0XFF

Question asked by saket thool on Jan 4, 2018
Latest reply on Jan 18, 2018 by saket thool

the following code i have written for STM32F103C8T6 for interfacing with AIS3624DQ accelerometer. But while checking , when i read register WHO_AM_I (0x0F) it should return me 0X32 default but it is returning me 0XFF. for any output register it is returning me the same value as 0xFF. please help in this. i know some thing is wrong but i am not getting it. 

thanks in advance. the code is as follows.

////////
unsigned int x=0;
void main()
{
GPIO_Digital_Output(&GPIOA_BASE, _GPIO_PINMASK_4); //chip select CS
SPI1_Init_Advanced(_SPI_FPCLK_DIV2, _SPI_MASTER | _SPI_16_BIT | _SPI_CLK_IDLE_HIGH | _SPI_FIRST_CLK_EDGE_TRANSITION | _SPI_MSB_FIRST | _SPI_SS_ENABLE | _SPI_SSM_ENABLE | _SPI_SSI_1, &_GPIO_MODULE_SPI1_PA567);

Delay_ms(100);

 

while(1)
{
GPIOA_ODR.B4=0; //chip select low
x=SPI1_Read(0X0F);
Delay_ms(10);
GPIOA_ODR.B4=1; ////chip select high
}
}

Outcomes