- Last edited 4 years ago ago
How to set trigger for starting an acquisition
This article describes how to use the trigger feature. This feature is usable in direct mode and snapshot mode. Nevertheless, the snapshot mode requires a modification of the embedded application.
This feature allows to start the trace when a predefined level is reached.
In the embedded application:
Only in snapshot mode, add the C source code acqTrigger.c and acqTrigger.h in the embedded application. This source code is provided in the “snapshot_embedded_SW.zip as described in the article Snapshot.
In the STM32CubeMonitor tool:
The trigger is settable in the “variables” node. Open the “Acquisition parameters” section, three fields are dedicated for configuring the trigger.
- Trigger start mode:
- - “off” means there is no trigger.
- - “rising edge” the trace starts when the value measured is lower than threshold and the next value is higher or equal to threshold.
- - “falling edge” the trace starts when the value measured is higher than threshold and the next value is lower or equal to the threshold.
- Trigger name: This is the variable used as trigger signal, the pick list is from the variable list.
- Trigger threshold: The level to reach for starting the trace.
When the acquisition is launched, what happens?
- In direct mode the triggering is managed by the "processing" node. While the threshold level is not reached the "processing" node filters the values. the processing node sends an empty value for the first measurement to indicate that the measurement is started.
- In snapshot mode, the triggering is done by the on-board software, the buffer is filled as soon as the threshold level is reached. The STM32CubeMonitor reads continuously the buffer and as long as it is empty returns an empty measure.
On the graphical side, no value appears in the graph as long as the threshold is not reached, only one message "Acquisition stated - waiting for value" appears at the top. As soon as the threshold is reached the values appear in the graph, the first value must correspond to the trigger setting, in the example below the variable named "double1" starts at the first value greater than or equal to -8000.