- Mon Oct 29, 2018 5:27 am
#78931
Okay, thanks for the tips. I was making the interrupt routine a few lines, and putting in yield() every other line in the loop and I was still having problems. Well, I used a GPIO as output and turned it on at the start of the interrupt and turned it off at the end, and then looked at this on my scope to measure the interrupt time. To my amazement, instead of an interrupt every millisecond, I saw a lot of high frequency fuzz, and realized that I was looking at the wrong problem all the time.
For testing, I had an Arduino Nano output a square wave at 1000Hz for 2 seconds and then rest for 10 seconds to simulate the radar return from a car. Well, the square wave looked clean to me, so it did not occur to me that there would be any trouble triggering on the edge.
Well, there was maybe 25mv noise on this output and that was enough to trigger the interrupt multiple times.
So, I give up on interrupts. I went back to sampling the period periodically in the main loop.
I did think about using the Nano to do the measuring and (somehow) get the message to the ESP8266, but I will try polling first before I add a processor.
Thanks for the advice.