Accelerometer

The Waspmote accelerometer is used to get the acceleration in 3-axes. Besides, it can generate different types of interruptions. But only one type of interruption at a time.

Enable interruption

The Waspmote accelerometer can generate several types of interruption: free fall, inertial wake up, 6D movement and 6D position. Different functions have been created in order to enable each kind of interruption (only once at a time).

The ACC.setFF() function enables the accelerometer free-fall interruption and enables the RXD1 interruption pin.

The ACC.setIWU() function enables the accelerometer inertial wake up interruption and enables the RXD1 interruption pin.

The ACC.set6DMovement() function enables the accelerometer 6-direction movement interruption and enables the RXD1 interruption pin.

The ACC.set6DPosition() function enables the accelerometer 6-direction position interruption and enables the RXD1 interruption pin.

Interruption event

The accelerometer generates a rising-edge interruption through the RXD1 pin. It also has a unique monitoring pin. When the interruption occurs in the RXD1 pin, the subroutine ‘onHAIwakeUP’ is run marking the corresponding flags.

The alarms are generated when defined thresholds are reached. These thresholds determine what is the needed acceleration for triggering the interruption. These thresholds are defined in ‘WaspACC.h’.

Disable interruption

Depending on the type of interruption previously enabled, it is necessary to call a specific function in order to disable the interruption.

The ACC.unsetFF() function disables both accelerometer interruption and RXD1 interruption pin.

The ACC.unsetIWU() function disables both accelerometer interruption and RXD1 interruption pin.

The ACC.unset6DMovement() function disables both accelerometer interruption and RXD1 interruption pin.

The ACC.unset6DPosition() function disables both accelerometer interruption and RXD1 interruption pin.

After calling any of these functions, no module will be able to interrupt the microcontroller via RXD1 because it has been disabled.

Check ACC interruption

In order to check the interruption capture, it is necessary to poll intFlag as seen below:

if (intFlag & ACC_INT)
 {
 // Accelerometer interruption treatment
 }

IMAGEN

It is also possible to use the interruptions generated by the ACC without the need for the microcontroller to be in energy saving modes.

Related API libraries: WaspACC.h, WaspACC.cpp

All information about their programming and operation can be found in the document: Accelerometer Programming Guide.

Last updated