Skip to main content
Visitor II
January 4, 2018
Question

AIS3624DQ WHO_AM_I returning 0XFF

  • January 4, 2018
  • 1 reply
  • 1886 views
Posted on January 04, 2018 at 13:18

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

}

}

#stm32f103c8t6 #acceleration #ais3624dq
    This topic has been closed for replies.

    1 reply

    Graduate II
    January 4, 2018
    Posted on January 04, 2018 at 15:12

    Could also be that device is not wired up properly or not powered.

    You should perhaps use a scope or logic analyzer and confirm the pins are functioning in the expected manner.

    Not familiar with the library you're using, perhaps try with some of the SPL or HAL example code for SPI, making sure clocks and pins enabled. Do you enable the GPIOA and SPI1 clocks somewhere.

    Visitor II
    January 5, 2018
    Posted on January 05, 2018 at 05:36

    Clock and Chip select pin is working as seen on RTO. what additional things i can check ?

    any guide for HAL library for the same ?

    Graduate II
    January 5, 2018
    Posted on January 05, 2018 at 18:39

    So do you see the WHOAMI (0x0F) request going out and the data coming back? Do you see 0xFF coming back or 0x32 ?

    If you see 0xFF you're going to have to examine what's going on with the AIS3624DQ in your design. Is it wired/powered correctly?