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.
ESP8266 microsecond timer missing, what can I do?
Re: ESP8266 microsecond timer missing, what can I do?
Could you use PWM instead?
Re: ESP8266 microsecond timer missing, what can I do?
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?
I think what you suggested about implementing it in C (i.e. custom firmware) is probably your best bet.