Uneven/increasing/decreasing elapsed time by stm32 timer
Hello everyone,
I am working with the board STM32F446RE with SX1261 on mbed os.
SITUATION: I want to measure the time difference between the send moment and the receive moment of a packet (transmitted by LoRa). Basically, when I send packet A (send time) from 1st board, the second board receives the packet and immediately responds back. 1st board receives (receive time) the response. I measured this period 30 times to get the time difference but this value kept increasing/decreasing until it reached a point before dropping/rocketing.
SET UP: I used timer 2 with 90MHz clock frequency. Two boards are at fixed distance.
WHAT I HAVE DONE: Considering that changing measurement, I also measured the time difference between the receive time and the response time on the 2nd board with timer 2. The same dropping/rocketing still occurred.
QUESTION: What might be the cause of this change? I suspect it might be the timer that has a rollover.
The pattern is something as below. “Dedicated�? means the 1st board sends a packet and receives a response. The 2nd board receives the packet and sends a response. “Reverse�? means the opposite.
Kind regards,
Huy Nguyen.
