cancel
Showing results for 
Search instead for 
Did you mean: 

My Test Code to Initialize LSM6DSM Gryo to Observe Pulses on INT1 coming from the Device does not work - Any Suggestions to Fix?

design23
Associate II

Here is my test code, that I single-step to observe the reg_status first, then write what I think should start the device, but I see nothing on INT1. Each reg_status read show the correct data (same as what I am writing):

   reg_status = ReadReg(LSM6DSM_CTRL2_G);

   WriteReg(LSM6DSM_CTRL2_G, 0x70);      // set ODR = 833 Hz, set Scale = 250 dps

   reg_status = ReadReg(LSM6DSM_DRDY_PULSE_CFG);

   WriteReg(LSM6DSM_DRDY_PULSE_CFG, 0x80);   // use pulses for INT1

   reg_status = ReadReg(LSM6DSM_CTRL7_G);

   WriteReg(LSM6DSM_CTRL7_G, 0x40);      // enable Gyro high performance

   reg_status = ReadReg(LSM6DSM_INT1_CTRL);

   WriteReg(LSM6DSM_INT1_CTRL, 0x02);      // enable Data Ready on INT1

   reg_status = ReadReg(LSM6DSM_CTRL3_C);

   WriteReg(LSM6DSM_CTRL3_C, 0x04);      // active-H, Auto Increment for multi-byte operations

   reg_status = ReadReg(LSM6DSM_CTRL4_C);

   WriteReg(LSM6DSM_CTRL4_C, 0x30);      // enable Data Ready on INT1

   reg_status = ReadReg(LSM6DSM_MASTER_CONFIG);

   WriteReg(LSM6DSM_MASTER_CONFIG, 0x80);   // enable Data Ready on INT1

0 REPLIES 0