BMI160: How do you properly use "softreset"?

I'm able to configure the BMI160 to run both its accelerometer and its gyroscope at 400Hz ODR with Data Ready coming out of INT1. I'd like the ability to reset the chip if something goes wrong. There's a "softreset" command available by writing 0xB6 to the CMD register at 0x7E.

I've tried writing 0xB6 to 0x7E, but when I do the chip becomes completely unresponsive. I've included a 100mS delay after the softreset command but that doesn't fix it. I've even tried much longer delays, manually by stalling the debugger, but again that doesn't fix it.

To be precise: If I write my configuration values without first doing a "softreset" via CMD (0x7E), the BMI160 configures fine, my configuration values can be read back from the chip, the INT1 pin indicates Data Ready, and data is available by reading the Acc and Gyro registers. But if I change nothing else except precede the above sequence with a "softreset", the chip never starts working... no INT1, no changing data in the Acc and Gyro registers.

Why would resetting the chip cause an otherwise successful configuration to fail? My natural presumption was that I wasn't waiting long enough after softreset before starting to write configuration values, but no amount of delay seems to fix this.

What are the tricks to using "softreset"? Any assistance gratefully appreciated... thanks!

Best reply by Vincent

Here is a short example made under COINES, the programable UI from our website.

data = 0xB6;

rslt = bmi160_set_regs(BMI160_COMMAND_REG_ADDR, &data, 1, &bmi160dev);

coines_delay_msec(200);

rslt = bmi160_get_regs(BMI160_PMU_STATUS_ADDR, &data, 1, &bmi160dev);

printf("power status is 0x%X\n", data);

data = 0x11;

rslt = bmi160_set_regs(BMI160_COMMAND_REG_ADDR, &data, 1, &bmi160dev);

coines_delay_msec(65);

rslt = bmi160_get_regs(BMI160_PMU_STATUS_ADDR, &data, 1, &bmi160dev);

printf("power status is 0x%X\n", data);

 

From the result, you can see the power mode are successfully changed after softrest. 

 

If you still have problem using softrest, please post your source code here. 🙂

View original
1
7 replies
Resolved