attachInterrupt CHANGE and FALLING

Hi,

I am using attachInterrupt to receive data from RF module. I have a nice code that works really great with CHANGE in the attacInterrupt. But it consumes lots of processing cause it triggers the interrupt every time the pin changes from high/low.

So I decided to not use change and use FALLING. I changed just a little bit the code to make sure I could receive the bits on the FALLING event. The problem: my range dropped from 100m to 30m.

So I am wondering: is the FALLING event slower than CHANGE, I mean, does it make arduino spending more time to check if there was a fall instead of just checking if it changed?

There is absolutely no difference in the timing. CHANGE calls the handler every time the input changes, whether from LOW to HIGH, or HIGH to LOW. FALLING only calls the handler when the input changes from HIGH to LOW. RISING only calls the handler when the input changes from LOW to HIGH.

Regards,
Ray L.

Perhaps if you posted this code? The one that doesn't work as well.

I changed just a little bit the code to make sure I could receive the bits on the FALLING event.

This undisclosed change is probably the reason.

I'm moving your "programming" questions with no code imbedded in them to more appropriate sections of the forum.

A programming question involves posting code, and asking a question about it.