Hi Richard @rtel sir, i hope you are fine during this corona pandemic.
I am using PIC32MZ2048EFH144 micro-controller custom board. I am using a system timer which runs at 1 msec and systiccount = 1000 ticks/sec. But when i defer the ISR to a separate task, the timer is running at 1 msec but systiccount = 20 ticks/sec. I don’t know the reason for this unexpected slow down.
In application, i am using the timer to send data to server for every 20 sec. This slow running of timer adversely affecting the application.
Here i am providing the details specific to application:
1. In general the system service timer is as below:
void __ISR(_TIMER_2_VECTOR, ipl1AUTO) IntHandlerDrvTmrInstance0(void)
{
DRV_TMR_Tasks(sysObj.drvTmr0); // The API which is to be deferred and provides **
** systiccount
}
- But as per Freertos rule, non RTOS api shoud not be called in ISR so i decided to defer the ISR
- I deferred the Timer ISR with a task delay of 100 msec and given the highest priority.
But after deferring the timer ISR runs at 1 msec/sec but Systiccount provided by the "DRV_TMR_Tasks(sysObj.drvTmr0) " API is 20 Ticks/sec. - Without ISR deferring , ISR runs at 1 msec and Systiccount is 1000 tics/sec which is same as ISR.
- i guess task delay might be affecting the timer and scheduler tick timer runs at 4.048 msec. Also i tried to run the tick timer at 1 msec but no change in result.
So, what might be the reason for this huge reduced timer count? Does context switching causing the error?