Because INT0 and INT1 trips on EITHER the rising OR falling edge which means that you either get x1 decoding or that you need to reconfigure the interrupt edge every interrupt. The IOC feature handles that automatically since it interrupts on change - any change.
The circuit in your link provides up/down count but still only x1 decoding, see the pink trace only pulses on the rising edge of the yellow trace, same thing for the green trace. It's effectively using only 25% of the encoders available resolution. A 720CPR encoder, when "properly" read will give you 2880 "pulses" per revolution.
If that's enough resolution it's perfectly fine but in that case I probably wouldn't use interrupts to count the pulse. I'd have hardware timer/counters in the PIC count the pulses and periodically update the position register.
/Henrik.




Bookmarks