How to do a fast loop on core 0 or core 1 without it stops/crash/reset by the stack length.
I use: xTaskCreatePinnedToCore but it keeps resetting on my oscilloscope because of /* Stack size of task */.
How to bypass the stack so it can run continuously without stopping.
very very short and lazy example below
xTaskCreatePinnedToCore(
taskon2core, /* Task function. */
"Task2", /* name of task. */
10000, /* Stack size of task */
NULL, /* parameter of the task */
1, /* priority of the task */
&Task2, /* Task handle to keep track of created task */
1); /* pin task to core 1 */
delay(500);
}
void taskon2core( void * _newPointer ){
for(;;){
digitalWrite(led2, HIGH);
delay(700);
digitalWrite(led2, LOW);
delay(700);
}
}
I need help on how to continuously write fast data to pin
Re: I need help on how to continuously write fast data to pin
1400ms period isn't really very fast.
In a FreeRTOS task you should be calling `vTaskDelay`, not `delay`.
For a periodic pulse you might also consider using a FreeRTOS software timer rather than using a task with delays. For your example you would set up a 700ms timer that keeps track of a static state for the pin, toggling it on or off. That would not involve using a delay at all.
In a FreeRTOS task you should be calling `vTaskDelay`, not `delay`.
For a periodic pulse you might also consider using a FreeRTOS software timer rather than using a task with delays. For your example you would set up a 700ms timer that keeps track of a static state for the pin, toggling it on or off. That would not involve using a delay at all.
Re: I need help on how to continuously write fast data to pin
How about using the LEDC (LED Controller) ?
Who is online
Users browsing this forum: Usama Masood and 112 guests