RTC Interrupt Handling

skywave
Posts: 19
Joined: Sun May 17, 2015 3:33 am

RTC Interrupt Handling

Postby skywave » Mon Nov 16, 2015 3:36 am

I am generating a 1000Hz PWM signal on GPIO with 0.5us ON. On RTC interrupt I set the pin (ON), wait for 0.5us (nops) and then clear GPIO, clear interrupt and reset RTC timer. However more than once a second the interrupt instead of taking 0.5us takes 2us (at 160MHz) or 3us (at 8MHz). I don't know why this occurs. Is it possible that the RTC interrupt is beign "interrupted" by another one (some other ESP8266 task)? Or is it a bug?

dkinzer
Posts: 52
Joined: Fri Jul 31, 2015 7:37 am

Re: RTC Interrupt Handling

Postby dkinzer » Mon Nov 16, 2015 9:21 am

skywave wrote:Is it possible that the RTC interrupt is beign "interrupted" by another one (some other ESP8266 task)?
The ESP has non-maskable interrupts. These can interrupt "normal" interrupt service routines even if interrupts are disabled.

I've see discussion of a method to block non-maskable interrupts but I haven't tried it.
http://www.esp8266.com/viewtopic.php?f= ... 9&start=20
Don Kinzer
Beaverton, OR, USA

User avatar
rosematters
Posts: 1
Joined: Mon Nov 16, 2015 1:12 pm
Location: Banks, AL

Re: RTC Interrupt Handling

Postby rosematters » Mon Nov 16, 2015 5:44 pm

It might be because the general problem with RTC. I think you know that the RTC is less flexible, and thus it is not widely used. It shows some irritating behavior as well. Sometimes it switches off before the time expires and toggles between time periods. It has the ability to handle only 15 possible interrupt rates. I think this characteristic maybe the cause of getting delay.

Who is online

Users browsing this forum: No registered users and 24 guests