I have taken two GPT timers with one timer 1ms and another 42 seconds timer.
In my application i need to send a command for every 42 seconds with 0 milli second accuracy. I have set a flag in callback and in while(1) loop i'm comparing if flag is set i'm sending the command.
In 1ms call back i'm just doing increment of a variable for comparison of time in milli seconds.
I'm printing log in UART when command has sent, when i compare with 1ms variable count the command is being sent accurately every 42 seconds with 0ms accuracy every time.
But when i take the log and compare with system time i found few milliseconds variation in every command sent. Please help me fixing this issue.
I'm using Renesas S7G2-SK Controller with 1.3.0 SSP, e2 studio. I have 3 threads,
1st - GUI and Touch, (Ticks 10, priority 3)
2nd - three UART's, one pwm control, 1 QSPI, 1 external IRQ, 1 RTC (Ticks 10, priority 2)
3rd - 42sec timer, 1ms timer, one pwm, one ADC (Ticks 10, priority 1)
Only timers (42sec and 1ms) has 0 Interrupt priority, other than all have greater than 0 Interrupt priority.
In reply to garyj:
In reply to Naresh: