Page 1 of 1

ESP8266 microsecond timer missing, what can I do?

Posted: Thu Mar 26, 2020 4:46 pm
by mark
I am new to micropython and I noticed that the ESP8266 port sadly does not provide timer interrupts with microsecond precision.
As I workaround I tried to use sleep_us inside the zero_cross isr but it did not work (obviously using sleeps in isr is not a good idea).
What would be the best strategy for me? Implementing in C and adding the C function to micropython.

I am working on a dimmer based on BTA16. This would be the Arduiono code for this:
https://github.com/RobotDynOfficial/RBD ... SP8266.cpp

Not sure if this is relevant but I am using a wemos d1 mini board and I am hesitant to move to another board.

Re: ESP8266 microsecond timer missing, what can I do?

Posted: Thu Mar 26, 2020 11:43 pm
by jimmo
Could you use PWM instead?

Re: ESP8266 microsecond timer missing, what can I do?

Posted: Fri Mar 27, 2020 12:38 am
by mark
jimmo wrote:
Thu Mar 26, 2020 11:43 pm
Could you use PWM instead?
what I am trying to do actually is pwm (even the dimmer module pin is called that). I am guessing you are refering to the PWM module and as far as I know this one does not support zero cross detection. Please expand a bit what you mean. Thanks

Re: ESP8266 microsecond timer missing, what can I do?

Posted: Tue Apr 14, 2020 5:24 am
by jimmo
mark wrote:
Thu Mar 26, 2020 4:46 pm
What would be the best strategy for me? Implementing in C and adding the C function to micropython.
I think what you suggested about implementing it in C (i.e. custom firmware) is probably your best bet.