while experimenting with:
https://github.com/HrRossi/RedPitaya/tr ... ac_trigger
which enables a trigger input input generated by a overflow of the arbitrary signal generator
and reading this post:
viewtopic.php?f=14&t=1035&start=10
I noticed that the pitaya seems to only trigger 99 out of 100 times with the while loop provided by the example on the red pitaya github repo:
Code: Select all
rp_acq_trig_state_t state = RP_TRIG_STATE_TRIGGERED;
while(1){
rp_AcqGetTriggerState(&state);
if(state == RP_TRIG_STATE_TRIGGERED){
break;
}
}
This problem is only apparent when triggering often, with low Decimation rate DEC_1 to DEC_8 and only if the system's cpu is loaded. This will lead to a hang inside the while loop and will stall the further programm execution, for testing porpuses I hence programmed a deltaTime function which breaks the loop when time waited exeeds a certain value. To make sure this does not cause any side effect the time is selected as 1.0s while the waveform repeats every 0.1s.
A quick fix for this seems to be using
Code: Select all
do{
rp_AcqGetTriggerSrc(&trgsrc);
}while(trgsrc==RP_TRIG_SRC_AWG_PE);
Code: Select all
do{
rp_AcqGetTriggerState(&state);
}while(state!=RP_TRIG_STATE_TRIGGED);
To reproduce this behavior I have prepared a minimal example of my code where you can change the triggering while loops by commenting line 9 (#define triggerBySrc)->(//#define triggerBySrc), and the problem will appear in the commented version.
Compile with the provided makefile (I had to add .txt file extension to upload it),
then "export LD_LIBRARY_PATH" as usual.
After that start the ./server application and then with another putty-ssh-terminal cause load on the system to get the error faster, I used htop and pressed F-10 to force a refresh.
I know that this bug is found on an old version of the ecosystem (0.94), but since I need the trigger on wavegenerator functionality moving to the lastest version is not an option. I have not tested if this bug also happend on the vanilla image, but I would guess so.
If someone could shine some light on the inner workings of the acq block and the triggering mechanics I would be grateful. Also please let me know if you experienced the same issue.
Best,
Benjamin