I'm sorry, but I'm not sure what you mean.
here is the next part of the code where it appears.
void begin() { // The following is to setup Interrupts / Timers
pinMode(8, INPUT); // Timer1 interrupt handler uses pin 8 as input, do not change it
ChannelNum = 0;
State = NOT_SYNCHED;
// Timer 1 used to trigger on PPM edge
TIMSK1 = 0x21; // enable input capture(ICIE1 is bit 5) and overflow (TOIE1 is bit 0) interrupts for timer 1, 0x20 = capture, 0x21 = capture and overflow
TCCR1A = 0x00; // Timer/Counter 1 to Normal Port operation
TCCR1B = PRESCALE; //(1<<ICES1) | (0<<CS12) | (1<<CS11) | (1<<CS10); // (ICES1) = capture rising edge on pin ICP1(a.k.a Pin 8), set prescaler to 64 for 16Mhz = 0X43
// TCCR1B = 0x03; //(0<<ICES1) | (0<<CS12) | (1<<CS11) | (1<<CS10); // (ICES1) = capture falling edge on pin ICP1(a.k.a Pin 8), set prescaler to 64 for 16Mhz
And here is the full original code. Sorry that I didn't say it before, the code is used to convert ppm signals (what our RC transmitters output) to serial, so that we can use an external module and transmit different protocols.
Thanks!
DSM2_5.zip (5.74 KB)