Troubleshooting Events

The 3DM-CV7 provides a few ways to help determine why an event configuration might not be working as intended. This page offers some ways to gain insight into why your configuration may not be working properly.

 

General Procedure

Check the Action Trigger ID

Actions have a trigger ID field which must be set to the instance ID of the trigger which should cause it to activate. If this is not set correctly, the action may never activate, or may activate at inappropriate times if the wrong trigger is selected.

To check the action ID, use either the Get Action Status (0x0C,0x2D) command or the Event Action Configuration (0x0C,0x2F) command. The Action Status command will return the action type and associated trigger. The Action Configuration command will return all of the action's parameters including the trigger ID.

Verify the Associated Trigger is Configured

Use the Get Trigger Status (0x0C,0x2C) command or the Event Trigger Configuration (0x0C,0x2E) command to check the trigger referenced by the action is configured. Pass the action's trigger ID as the instance ID for either command. The Trigger Status command will return the trigger type and its current state. The Trigger Configuration command will return all of the trigger's parameters.

Check if the Trigger is Enabled

The Get Trigger Status (0x0C,0x2C) command will return the trigger type and its current status. The enabled bit must be set for it to work properly. Use the Event Control (0x0C,0x2B) command to change it to the enabled state if necessary.

Test the Action using the Trigger Test Mode

If your action is not activating at all, you can put the trigger into test mode. Use the Event Control (0x0C,0x2B) command with the trigger ID and the TEST mode. This will force the trigger into the active state and trigger the action continuously.

  • If the action works when testing the trigger, there is a problem with your trigger's configuration.
  • If the action still does not work, the problem is in your action's configuration.

An additional test mode, TEST_PULSE, is provided to test what happens when the trigger activates for a single event cycle. After the test cycle, the trigger will return to the previous enabled/disabled state.

Don't forget to set the trigger back to the ENABLED mode after you're done testing.

 

GPIO Events

If a GPIO trigger or action is not functioning as desired, ensure that the pin has been configured properly using the GPIO Configuration (0x0C,0x41) command as described here:

  • For GPIO Actions, the pin must be set to the General Input / Output (GPIO) feature. The behavior must be either OUTPUT_LOW or OUTPUT_HIGH. If you've selected the open drain option, ensure the pin has either the internal pullup enabled or is pulled up externally.
  • For GPIO Triggers in state mode, the pin must be configured for the GPIO feature with the INPUT behavior.
  • For GPIO Triggers in edge mode, the pin must be configured for the TIMESTAMP feature with the behavior set to the desired edge direction.

See Trigger: GPIO and Action: GPIO for details.

If a GPIO event component doesn't work after a device reset, make sure the GPIO configuration is saved along with the event configuration.

Test the GPIO

In some cases, it may be useful to test the GPIO pin by itself using the GPIO State (0x0C,0x42) command. The pin must be configured for the GPIO feature to perform this test (it will not work when set to TIMESTAMP).

  • For inputs, use the READ function selector. Verify that changing the state of the pin externally affects the value read back by the command.
  • For outputs, use the WRITE function selector. Verify that sending the command with high or low states changes the pin's voltage. Note that if there is a GPIO action configured for ACTIVE_HIGH or ACTIVE_LOW on this pin, it will override your changes with the GPIO State command, making this test difficult. If you use an oscilloscope, you may observe the changes briefly between event cycles. It is recommended to disable the action by temporarily changing the pin, mode, or action type (disabling the trigger is not enough).

 

Message Actions

Message actions will usually work if the trigger is configured properly. If you're not seeing any MIP packets even when the trigger is in test mode, there are a few things to check.

  • Is the device set to idle? Try sending the Resume (0x01,0x06) command to enable packet output.
  • If you've selected oneshot mode, try continuous mode (decimation > 0). This will cause packets to be output continuously instead of just once, which increases the likelihood of noticing it.

 

Testing Triggers

The Get Trigger Status (0x0C,0x2C) can be used to get the current status of a trigger. This returns the trigger type, along with a bitfield of status information. Contained in the bitfield are flags for the following:

  • Is the trigger currently activated? This is an instantaneous reading of the trigger's current state as seen by any associated actions.
  • Is the trigger enabled? Triggers must be enabled to be active. Use the Event Control (0x0C,0x2B) command to enable it if necessary.
  • Is the trigger in test mode? In test mode, the trigger is continuously active. Use the Event Control command to change it back to the enabled state if this is not intended.

Threshold Triggers

Threshold triggers can be tricky to test because they depend on particular data quantities. A few things to check in the configuration are:

  • Are the descriptor set and field descriptor correct?
  • Is the parameter ID correct? This value is the parameter number of the quantity within the MIP field. E.g. for a 3-vector like Scaled Accel (0x80,0x04), 1 = X, 2 = Y, 3 = Z.
  • If using WINDOW mode, are the thresholds correct? Check if the trigger activates when the thresholds are swapped. Swapping them reverses the window. If the low threshold is lower than the high threshold, the trigger will be activated when the data value is between them. Otherwise, the trigger will activate when the data value is from negative infinity to the high threshold (which is lower), or when the value is from the low threshold (which is higher) to positive infinity.
  • If using INTERVAL mode, are the interval and threshold correct? The threshold represents the activation point which repeats periodically at every interval. If the value is lower than the threshold, the trigger is active, and otherwise it is inactive. Often the threshold is set to half the interval.

If the configuration is correct, check if the data is actually meeting the condition specified. Sometimes this can be difficult to reproduce, but a good method of testing it is to set up scheduled streaming and monitor the value continuously. If using a Message Action, it should be easy to see when the trigger is active by comparing the scheduled stream with the event messages. Select the Event Source (0xFF,0xD0) and a timestamp field (e.g. Reference Timestamp (0xFF,0xD5)) in both messages. If you're not using a Message Action, you can add one using a free action slot and the same trigger ID as your other action. Both will be activated from the same trigger.

Combination Triggers

There are two ways a combination trigger might not work as expected. The first is that the input triggers may not be working properly. Try testing them individually first. Make sure the inputs are set correctly. Unused inputs should be set to trigger 0. The second possibility is that the logic is not configured as intended. The logic can be verified by using the Event Control (0x0C,0x2B) command on each of the input triggers. By setting them to DISABLED or TEST, work through all of the possible disabled / enabled cases. Follow the logic table on the Trigger: Combination page and identify any bits which are incorrect.