Accelerometer interrupts

The Waspmote's accelerometer can provide an interrupt signal and offers several possibilities for personalizing this signal. The registers involved in the interrupt generation behavior are:

  • CTRL_REG3

  • INT1_CFG:

  • INT1_SRC

  • INT1_THS

  • INT1_DURATION

Free Fall interrupt

Free-fall detection refers to a specific configuration of the interrupt registers that allows the recognition of device free-fall. In real cases, a "free fall zone" is defined around the zero-g level, where all accelerations are small enough to generate the interrupt.

Setting the Free Fall interrupt

The setFF() function sets the Free Fall interrupt.

First of all, it clears previous interruptions and writes into the below explained registers the selected values. After writing the registers, the hardware interruption is attached to the pin.

It returns flag to check if there was any error while writing to registers or attaching the interruption.

Example of use:

{
ACC.setFF();
}

The default free-fall zone margin is set to 448 mG. It can be changed when calling the setFF() function. For this purpose, the new margin has to be defined as input in mG units.

Example of use:

{
ACC.setFF( 300 );
}

Unsetting the Free Fall interrupt

The unsetFF() function clears and unsets the Free Fall interrupt.

First of all, it clears CTRL_REG3 and INT1_SRC registers and the hardware interruption is detached to the pin.

It returns flag to check if there was any error while writing to registers or attaching the interruption.

Example of use:

{
ACC.unsetFF();
}

Inertial Wake-Up interrupt

The wake-up interrupt will generate an event when the acceleration on axis X, Y or Z exceeds a threshold.

Setting the Inertial Wake-Up interrupt

The setIWU() function sets the Inertial Wake-Up interruption.

First of all, it clears previous interruptions and writes into the below explained registers the selected values. After writing the registers, the hardware interruption is attached to the pin.

It returns flag to check if there was any error while writing to registers or attaching the interruption.

Example of use:

{
ACC.setIWU();
}

The default inertial wake-up threshold is set to 448 mG. It can be changed when calling the setFF() function. For this purpose, the new margin has to be defined as input in mG units.

Example of use:

{
ACC.setIWU( 300 );
}

Unsetting the Inertial Wake-Up interrupt

The unsetIWU() function clears and unsets the Inertial Wake-Up interruption.

First of all, it clears CTRL_REG3 and INT1_SRC registers and the hardware interruption is detached to the pin.

It returns flag to check if there was any error while writing to registers or attaching the interruption.

Example of use:

{
ACC.unsetIWU();
}

6D movement interrupt

The 6D movement interrupt is generated when the device moves from one direction to a different direction.

Setting the 6D movement interrupt

The set6DMovement() function sets the Inertial 6D movement interruption.

First of all, it clears previous interruptions and writes into the below explained registers the selected values. After writing the registers, the hardware interruption is attached to the pin.

It returns 'flag' to check if there was any error while writing to registers or attaching the interruption.

Example of use:

{
ACC.set6DMovement();
}

Unsetting the 6D movement interrupt

The unset6DMovement() function clears and unsets the Inertial Wake-Up interruption.

First of all, it clears CTRL_REG3 and INT1_SRC registers and the hardware interruption is detached to the pin.

It returns flag to check if there was any error while writing to registers or attaching the interruption.

Example of use:

{
ACC.unset6DMovement();
}

6D position interrupt

The 6D position interrupt is generated when the device is stable in a direction. The interrupt is active as long as the position is maintained.

Setting the 6D position interrupt

The set6DPosition() function sets the 6D position interrupt.

First of all, it clears previous interruptions and writes into the below explained registers the selected values. After writing the registers, the hardware interruption is attached to the pin.

It returns flag to check if there was any error while writing to registers or attaching the interruption.

Example of use:

{
ACC.set6DPosition();
}

Unsetting 6D position interrupt

The unset6DPosition() function clears and unsets the 6D position interrupt.

First of all, it clears CTRL_REG3 and INT1_SRC register and the hardware interruption is detached to the pin.

It returns flag to check if there was any error while writing to registers or attaching the interruption.

Example of use:

{
ACC.unset6DPosition ();
}

Last updated