Dale Finney
Dale Finney

Reputation: 41

Arduino esp32 freertos changing tick from 1 ms

I'm trying to use esp32 freeRTOS in Arduino. I want to run tasks at multiples of a power cycle (for example, 1/Frequency/8 = 2.083 ms in north america). Evidently I can't change the tick rate from 1000 hz to 480 hz. I could use a hardware timer and ISR but it's disappointing since it's my first attempt to use freeRTOS. Solutions or suggestions?

Tried to change sdkconfig but appears to be read-only.

Upvotes: 0

Views: 906

Answers (1)

user_cr
user_cr

Reputation: 120

managing the timing of a task is done using vTaskDelay() or vTaskDelayUntil() A scheduler is used to make the delay, because of this the delay time can be only a multiple of scheduler tick (usually multiple of 1ms), your 2.083ms (nano second accuracy) won't be possible.

And yes you can use hardware or software timers instead of the vTaskDelay. What is your goal/use case? maybe an interrupt every 2.083 ms isn't what you want.

The sdkconfig is configurable using menuconfig, not sure if or how this is configurable in Arduino. (I'd move away from Arduino and use pure ESP-IDF to fully utilize low level libraries).

Upvotes: 0

Related Questions