- Wed Jan 21, 2015 1:51 am
#7837
Hi. I try to fix problem.
First problem is GPIO speed from LUA. Setting GPIO high and low from lua takes about 80us which is 16x longer then servo deadband. This is problem when I can try write code completely in LUA.
I can try add small function in timer module called "servo_pulse" that have 2 parameters (pin, time) this function disable interrupts, set GPIO to HIGH, delay specified amount of time in us and set GPIO back to LOW and enable interrupts... In C Its prety acurate. But if you have tmr.alarms or comunicate over wifi while servo pulse is running, communication can be broken or ESP8266 make reboot.
I update my servo function to work without interrupt disabling, its not precise as previous function, but causes less problems. I have lot of communication over wifi, every cca 8ms send packet and receive another one... and communication hangs in random interval, if servo_pulse is used.
I do not have a lot of other ideas how to solve it.
If program is in delay loop, wifi or other event is freeze and not work.