I need help on how to continuously write fast data to pin
Posted: Sat Apr 09, 2022 3:08 am
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 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);
}
}