Timers and Interrupts
Posted: Wed Apr 25, 2018 3:01 pm
Hi all, I'm hoping the ESP8266 can provide a regular timer interrupt. Unfortunately, after a couple of days of poking around in various locations, I've failed to find out if this is even something the hardware can provide, let alone how to do it.
My need would be to generate a continuous interrupt stream at a rate that the program can alter (ideally within in the range of perhaps 10 Hz on the low end, to maybe 4kHz on the high end (faster is fine, I guess, I can always divide in software).
If the interrupt rate cannot be configured, I'd need a much faster interrupt so I could divide it down with the resolution that I'll need.
I don't need the WiFi to work for this program (I mention this because something I read in my searching seemed to hint that this might be possible, but that it would screw up the WiFi system).
I need the interrupt stream to be such that the timing doesn't "slip". That is, I need the next cycle to start automatically and immediately in hardware, so that any jitter int he time that the software takes to service the interrupt does not create any kind of accumulation of timing error (though it's fine if the service routine for a particular interrupt is delayed, e.g. by a higher priority interrupt or NMI).
For more background, I have achieved this in the arduino, using timer 1 in it's compare mode (CTC), I'd like to reproduce that on smaller/cheaper/better hardware
Can anyone tell me if this is even possible? And better yet, if it is, where I might find docs to help with the hardware configuration?
Cheers
Toby.
My need would be to generate a continuous interrupt stream at a rate that the program can alter (ideally within in the range of perhaps 10 Hz on the low end, to maybe 4kHz on the high end (faster is fine, I guess, I can always divide in software).
If the interrupt rate cannot be configured, I'd need a much faster interrupt so I could divide it down with the resolution that I'll need.
I don't need the WiFi to work for this program (I mention this because something I read in my searching seemed to hint that this might be possible, but that it would screw up the WiFi system).
I need the interrupt stream to be such that the timing doesn't "slip". That is, I need the next cycle to start automatically and immediately in hardware, so that any jitter int he time that the software takes to service the interrupt does not create any kind of accumulation of timing error (though it's fine if the service routine for a particular interrupt is delayed, e.g. by a higher priority interrupt or NMI).
For more background, I have achieved this in the arduino, using timer 1 in it's compare mode (CTC), I'd like to reproduce that on smaller/cheaper/better hardware
Can anyone tell me if this is even possible? And better yet, if it is, where I might find docs to help with the hardware configuration?
Cheers
Toby.