I'm making a project with Arduino, and I have a question about a chip I'm using, the MPU9150, a 9-axis accelerometer+gyroscope+magnetometer.

I wanted to know if its registers are wiped when the power is off. I'll explain: In the Arduino sketch, I'll try to change some of them (the measuring range, configuring interrupts and such) and I don't know if they all reset to a default state when disconnected from the power, or if I have so specifically reset them, to their orgiinal values (through the use of a reset register, I believe it has one).

Thank you!

  • 3
    \$\begingroup\$ How is this not directly answered in the datasheet!? \$\endgroup\$ – Olin Lathrop Sep 8 '15 at 10:45

From the register map of the MPU9150:

The reset value is 0x00 for all registers other than the registers below.

  • Register 107: 0x40.

  • Register 117: 0x68.

So yes, the chip will also reset the registers to some default value after a power up.

Most of the chips I encountered have a reset of the registers to some default value but not for RAM, which can contain some random values at times.

Sometimes there is also a bug on the chip which will prevent it from resetting to the default register values, but such information should be available in the errata (if available).


Usually Arduino boards have a power-on-reset meaning that a reset is performed every time the power is switched on. So yes, all registers will be wiped at power-on. Anything that you want to be set while the Arduino is working you have to include in the setup part of your Arduino sketch and flash that in the Arduino. That way it will be initialized after power-on-reset :-)

  • 1
    \$\begingroup\$ You are right about the Arduino, but I think the question was really about the registers on the MPU9150 - which probably does't keep register settings over power cycle either. \$\endgroup\$ – JRE Sep 8 '15 at 10:34
  • \$\begingroup\$ Ah, I read too quickly, I didn't see that it was about the sensor. \$\endgroup\$ – Bimpelrekkie Sep 8 '15 at 12:08

All registers in all microcontrollers have the their "Reset state". It is their initial state after any reset (Power-On reset, Watchdog reset, Brown-Out reset, so on). This state is necessary because registers often controls chip's peripherials and after reset all of them must return to known state.

Otherwise, microcontroller's RAM memory has unpredicted state after reset

You must save your sensor data to non-volatile memory (EEPROM). Almost every microcontroller have it. Regards.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.