Chat freely about anything...

User avatar
By CRF
#61233 I have many ESPs running without problems.
But now I have one, with random watchdog reset. This is the only one using an interrupt routine, and just to get in more trouble I use "long" delays in that routine.

It is a light dimmer function, and it kinda needs to wait for up to 10ms until it triggers the triac and than exits.

Do you think this is the cause of WDT running out?

Can I disable the WDT? What do you suggest?
User avatar
By martinayotte
#61312 You should never do something that take long time in interrupt routine.
Interrupt should be execute as quickly as possible, and should not call anything that could itself produce interrupts, such as Serial.print().
If you have a long process to be execute when interrupt is triggered, the interrupt routine should simply set a flag to true and return, then your main loop will check that flag and process the lengthy execution.
User avatar
By CRF
#61415 Well, I solved this. In case anyone finds this usefull.
I used this microtimer http://onetechpulse.com/esp8266-microse ... lay-timer/
Now I can controll the fireing delay after zero crossing down to 10 microseconds, without any blocking code.
I have not had a reset since.