Skip to main content
Explorer
June 17, 2020
Question

ISM330DLC device ID

  • June 17, 2020
  • 3 replies
  • 2598 views

Hi,

I have made a module using ISM330DLC IC. I made the schematic by taking reference from STEVAL-IDP005V1 schematic. PFA, both the schematics.

Now, I am using Nucleo -F44RE board to interface this module using SPI.

Also, using the libraries for the ISM330DLC.

When I am using the ism330dlc_device_id_get(&dev_ctx, &whoamI); API, the ID coming is 0x7F but in datasheet it is 0x6A.

But when I am using the STEVAL-BFA001v1b kit , I am getting the correct ID of the ISM330DLC which is there on the kit already.

Please, let me know the possible problem.

Thanks

    This topic has been closed for replies.

    3 replies

    ST Employee
    June 17, 2020

    Hi @RJain.1​ , are you sure you are correctly reading the WHO_AM_I (0Fh) register? It seems like "FFh" on 7-bit... Can you read another register to check if you get back the same value? And could you share the digital signal pattern? Just to check if you are receiving back the ack from the slave device. Regards

    RJain.1Author
    Explorer
    July 5, 2021

    HI @Eleon BORLINI​ , when I try to read any register of ISM330DLC, it is giving the same value i.e. 0xf. What can be the problem?

    here is the code:

    HAL_GPIO_WritePin(ISM_CS_GPIO_Port,ISM_CS_Pin,GPIO_PIN_RESET);

          //HAL_Delay(10);

          //2. Transmit registers + data

          spi_txBuf[0] = 0x0E|0x80;

          HAL_SPI_Transmit(&hspi3,spi_txBuf,1,50);

         //receive data

         HAL_SPI_Receive(&hspi3,spi_rxBuf,1,50);

        // HAL_Delay(10);

         HAL_GPIO_WritePin(ISM_CS_GPIO_Port,ISM_CS_Pin,GPIO_PIN_SET);

    ST Employee
    July 7, 2021

    Hi @RJain.1​ ,

    if you are receiving all 0xff there should be some issue on the line. Are the GPIO pins ok? Is the SPI correctly configured at application processor level?

    -Eleon

    RJain.1Author
    Explorer
    June 17, 2020

    Hi @Eleon BORLINI​ 

    I am getting the same value i.e. 0xFF while reading other registers also.

    Where is the problem?

    Here is the SPI code, I am writing 0x11 at CTRL1_XL (10h)

    //SPI transmit steps

     // 1. Bring slave select to low

    HAL_GPIO_WritePin(GPIOA,GPIO_PIN_10,GPIO_PIN_RESET);

    //2. Transmit registers + data

    spi_txBuf[0] = 0x10;

    spi_txBuf[1] = 0x11;

    HAL_SPI_Transmit(&hspi3,spi_txBuf,2,50);

    // 3. Bring slave select high

    HAL_GPIO_WritePin(GPIOA,GPIO_PIN_10,GPIO_PIN_SET);

    //SPI receive steps

     // 1. Bring slave select to low

    HAL_GPIO_WritePin(GPIOA,GPIO_PIN_10,GPIO_PIN_RESET);

    //2. Transmit registers + data

    spi_txBuf[0] = 0x10|0x80;

    HAL_SPI_Transmit(&hspi3,spi_txBuf,1,50);

    //receive data

    HAL_SPI_Receive(&hspi3,spi_rxBuf,1,50);

    HAL_GPIO_WritePin(GPIOA,GPIO_PIN_5,GPIO_PIN_SET);

    RJain.1Author
    Explorer
    June 18, 2020

    Solved.

    I used wrong GPIO_PIN in WritePin API (Last line).