Dear all,
I'm trying to measure the time it takes an 100nF capacitor to discharge via a 100kΩ resistor to about 1V after being fully charged to 3.3V, using analog comparator 1 of a Teensy 3.2, Arduino 1.8.12/Teensyduino 1.51 and the test program View attachment LightCmpTestSimple.ino.
CMP1_OUT signals the voltage transitions properly on the scope, and they are also properly reflected in CMP1_SCR.
However, I don't get the interrupt service routing to work. It seems to be called, as when I implement a naked empty isr just ahead of setup, upon interrupt the setup routine is executed again.
But whenever I try to do something in the isr, the Teensy hangs up (in the sense that it doesn't upload new software automatically anymore, only by pressing the program button).
I've spent now over six hours trying all kind of combinations and examples of isr as found in misc libraries, but nothing works.
How do I write such an isr? Which __attribute do I have to declare, and what asm preamble and postamble to use on the K20?
Kind regards,
Sebastian
I'm trying to measure the time it takes an 100nF capacitor to discharge via a 100kΩ resistor to about 1V after being fully charged to 3.3V, using analog comparator 1 of a Teensy 3.2, Arduino 1.8.12/Teensyduino 1.51 and the test program View attachment LightCmpTestSimple.ino.
CMP1_OUT signals the voltage transitions properly on the scope, and they are also properly reflected in CMP1_SCR.
However, I don't get the interrupt service routing to work. It seems to be called, as when I implement a naked empty isr just ahead of setup, upon interrupt the setup routine is executed again.
But whenever I try to do something in the isr, the Teensy hangs up (in the sense that it doesn't upload new software automatically anymore, only by pressing the program button).
I've spent now over six hours trying all kind of combinations and examples of isr as found in misc libraries, but nothing works.
How do I write such an isr? Which __attribute do I have to declare, and what asm preamble and postamble to use on the K20?
Kind regards,
Sebastian