The difficult place to debug is at the boundary between the real world and software. I can use my 'scope to look at the voltage on a given input pin as a function of time. I do this with high confidence in the information. I can also insert print statements into my code and know where it is going. But if I use software to look at a signal associated with an input pin, I will affect its realtime performance. On many occasions, these extra print statements ended up being why my program didn’t work.
I am proposing a program that temporarily replaces the existing code. After triggering on a change in state, it only looks at the input, and as fast as it can, saves it to memory. After taking 255 samples, it stops recording and starts printing it out to my PC. Then the cycle repeats.
The user defines which pin they want to read plus the sampling rate. With my Pro Micro, I can sample as fast as every 6 microseconds. This will be faster than my program can read the input so I get a good idea of what it sees. There is no limit on how slowly I sample if I'm looking for slow moving disturbances.
If you are interested, please see
https://rick.sparber.org/DigitalRecorder.pdf
Your comments are welcome. All of us are smarter than any one of us.
Thanks,
Rick
Bookmarks