Hello...!!
I am a new arduino user and i need some help with interrupts. i was able to get the TIMER INPUT CAPTURE INTERRUPT running by looking at some libraries. whenever there is a change on PB0(pin 8 on the FREEDUINO SB) it triggers the ISR without any issues. i then tried to read the TCNT1 register and the ICR1 registers to know the difference between 2 edges but it doesn't work. anyone with any suggestions??? below is the code i used.
Please help... and Thank you in Advance...

/*
* This code explores the external interrupts on the Freeduino SB
* as of 7/03/09 i was able to get the led on and off when there is a
* rising edge on INPUT CAPTURE1 PORTB0 pin 8 on the Freeduino SB Board.
* I am still trying to figure out how to read the Timer regs..
* I succesfully completed the setting up of the ISR and writin an ISR
*/
boolean state = HIGH;
int ledPin = 13; // LED connected to digital pin 13
unsigned int iCountnew = 0;// iCountold = 0;
void setup() // run once, when the sketch starts
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
TCCR1B = 1<<ICES1;
// iCountnew = ICR1;
TIMSK1 = (1 << ICIE1);
Serial.begin(115200);
}
void loop() // run over and over again
{
// Serial.print("OLD: ");
// Serial.println(int(iCountold));
Serial.print("NEW: ");
Serial.println(iCountnew, DEC);
digitalWrite(13, state);
delay(10);
}
ISR(TIMER1_CAPT_vect)
{
// iCountold = iCountnew;
iCountnew=ICR1;
state = !state;
}