Get Data from the user and the GPS channel at the same time

Hi everybody,

I am using the OpenIMU300ZA.
While using the GPS serial channel with 20 Hz, I want to get messages from the user serial channel at the same rate.

Unfortunally always data from only one of those channels is saved for each period as you can see in the picture. But I need both messages from the same time.

The time in the picture is the particular time when he signal was measured, every 50 ms a message with a new signal is arriving at each port and the unit in the picture is ms.

time_diff.PNG

I never use _GenerateDebugMessage for debug message. Usually, I write my own code for debug message output.
What I mean by ODR is the ODR of user serial port. You can use our web GUI to set the ODR, or you can prepare your own code to do that.
For web GUI, you can refer to:
https://openimu.readthedocs.io/en/latest/tools/ans.html
https://developers.aceinna.com/connect.

Thanks for your answer.

How do I set the ODR to 20 Hz?
Because on the picture you can see is the output for the command:
_GenerateDebugMessage(dacqRate, 20);
For which I thought the OutputRate would be 20 Hz. But you are correct because it obviously isn't.

The time given in the picture is coming from the sensors calculated with the GPS time. So it is increasing correctly by itsself and it is the same timer for both signals.

I am implemented it in one task, I don't need a sync mechanism.

I think there are a few things to do.
First, make sure the timer is correctly increased at each step. If the ODR is 20Hz, timer increment should be 50ms. From the picture, the timer increment seems to be 50ms. But there are repeated timer in the output of each channel. This is not right.
Second, make sure the ODR is really 20Hz and fix the issue of repeated timer. That means each port can output timer you desire (+50ms each time)even if they are not synced.
Third, a sync mechanism should be added if sending data via two ports is implemented in two tasks, or you can do this in one task.
Finally, just a reminder: make sure you are outputing the same timer.