Hi,
If you have a T?CKI pin on your pic you can use that pin to check for black stripes. This is the pin for the external clock signal connected to the internal timer/counter. This way you can get an interupt every black stripe or every 2:nd or once per wheel rotation (or anything else more or less). This is all depending of what you preload the counter with. If you have a 8-bit counter and load FF into it, next clock pulse will overflow the counter and you will get an interupt. If you preload it with FF-(dec 48) it will overflow once every full rotation of the wheel.
If you just want to count the stripes preload it with 0 and off you go....
This way your PIC will do most of the counting by itself and giving you more instruction time for something more useful.
If you use the RA2/INT for the magnetic switch you can use RA5/T1CKI the external clock input for the stripes phototransistor
/me
Bookmarks