Very frustrating last few days on this one. I'll try to be as specific as possible:
-ATTiny85 is generating a pulse using Timer1. By changing the OCR value, I can arbitrarily adjust the frequency of said pulse
-ATTiny85 pin 4 is the output of that pulse and is connected to Mega Pin 53 (I assume this is PB0 or PCINT0, which is also ICP1???)
-Maga is meant to capture the falling edges and calculate the time delta for what will become a serial out stream sending time deltas to a graphing function for RPM
The Tiny is producing the pulses but I had to use interrupts to do it because I couldn't output the raw wave to one of the pins directly from the timer. Thus I have a slightly buggy interrupt doing it manually. This is a problem but a LOW priority at this time, since I am still getting a good enough wave to test with
The REAL problem is on the Mega side where I must utilize the INPUT CAPTURE feature to get the most responsive and noise free measurement of the delta T between falling edges.
a) I do not know if the ICP is pin 53 or not. I've read that it is PBO or PCINT0, which is pin 53 but I'm not getting anything on pin 53
b) I'm not entirely sure how to activate the input capture feature. I know the bit that controls noise cancelling and the bit that activates the input capture interrupt vector but my ISR does not execute despite this.
1) Can somebody please tell me the absolute minimal code to tell the Mega to monitor pin 53 for INPUT CAPTURE. If this is not the right pin to use, which pin is it and how do I enable input capture on that pin?
2) Absolute minimum code to set up the appropriate timer and/or input capture registers to trigger off that pin's falling edge and call the TIMER1_CAPT_vect ISR so that I can record the delta T in the 16 bit buffer (ICR is it?). I think ICR has 2 bytes that need to be copied, correct? What's the syntax for doing that?
Thank you very much.