claire

I'm trying to create a code to interpret the output of a Vishay receiver. i.e. code that measures the length of a pulse (but I don't want to use PulseIn). I initially wrote a big long code that would interpret it all for me, but I'm having trouble making it go into the interrupt so I reduced my code down to:

So that all I'm trying to do is get the program to enter the interrupt and print "G" (I know, I know, shouldn't print from an interrupt) at the moment. Does this seem right? It's only printing me a line of Ls, not a G in sight.I'm testing it with a 2Hz, 5 V peak to peak square wave signal.

Pins 2 & 3 are the hardware interrupt pins, you attach an interrupt to them.I don't see that happening with your code (but I'm not much into the register stuff either).What is pin 8 supposed to be doing?

If you can get that working, then you will see a G on each rising edge.Next you can change it to have the ISR beg_flag = 1-g_flag;and not clear g_flag with the serialprint, but hold it,and let the state will change in the interrupt 1-0-1-0 with each edge.