-->
Page 2 of 2

Re: ESP8266 TIMER INTERRUPT

PostPosted: Thu Apr 29, 2021 3:21 pm
by clarkegriffinx
Timer Interrupt Considerations
These routines

need to be extremely fast to execute, and it is often best to simply set a number of flags or states within the Interrupt Service Routine, then evaluate them when required in your normal thread code in loop().
only fire when the configured timer overflows
are restricted to a small number of timers depending on the MCU hardware in use.
can only set values to variables declared with VOLATILE, which ensures they arent optimized away, and can be used reliably in the ISR and in the main loop() code
NOTE - Timer interrupts may interfere with other functionality (PWM for example) depending on the timer chosen to configure.

e.g. ESP8266 gas 2 x Timers available:

0 (Used by WiFi), 1 is available to configure.

e.g. Arduino Uno has 3 x Timers available:

Timer0 - An 8 bit timer used by Arduino functions delay(), millis() and micros().

Timer1 - A 16 bit timer used by the Servo() library

Timer2 - An 8 bit timer used by the Tone() library

The Mega boards have Timers 3,4,5 which may be used instead


hope this helps

Re: ESP8266 TIMER INTERRUPT

PostPosted: Thu Sep 09, 2021 4:08 am
by lumusislight
What other variants have you tried? I'm struggling with this task to do my assignment



Hi,

I used a generic ESP8266 + Arduino Core and AsyncWebserver + Wi-fi for a phase angle control.
Have you tried to use an Attiny85? It may be used as a slave interrupt generator. And you could also send your control commands over I2C.

Re: ESP8266 TIMER INTERRUPT

PostPosted: Fri Jan 14, 2022 6:28 pm
by Robmort
Don't know if the original poster is still here, but it would be useful to see his sketch to see where any problem may lie.