How to lower GPIO/PCNT ISRs service time on CORE0 or get rid of FreeRTOS?

ky3orr
Posts: 1
Joined: Sun Jul 07, 2024 12:15 pm

How to lower GPIO/PCNT ISRs service time on CORE0 or get rid of FreeRTOS?

Postby ky3orr » Sun Jul 07, 2024 12:36 pm

Hi All,

I am working on DPLL design where I am synchronizing external 10MHz OCXO to the external GNSS PPS signal.
I am using PCNT to get OCXO readouts and PPS ISR to lock PCNT readouts as this signal gates the measurements.
PCNT overflow ISR handles data queueing which is picked up next by the application task running on Core1.

During my testing time sensitive operations were moved to Core0 while the application is running on Core1.

Having pretty stable readouts from PCNT from time to time I have glitches on read PCNT value because of PPS ISR waiting for PCNT ISR to be finished (PPS kicks in while PCNT ISR is still being serviced).
PPS ISR latches PCNT value and set the flag that PPS just happened.
PCNT overflow ISR is responsible for data preparation as it starts data processing after PPS was handled (by loking at the flag PPS ISR set). It just needs to finish processing before its own next overflow but that is not an issue here at all.

I am looking for a ways to decrease ISRs time handling when under FreeRTOS control. Because of that I have few questions:
- Is it possible in Arduino environment to turn off FreeRTOS completely on Core0?
- If so is it possible to easily read PCNT value and serve GPIO/PCNT ISRs in assembly?
- Is there any documentation showing how to deal with time-critical operations in Arduino environment for ESP32?

Thanks for any suggestions and sources to read.

Who is online

Users browsing this forum: No registered users and 97 guests