Thanks, you have been very helpful

Here is what I have setup at the moment

I have the optial sensor(phototransistor OPB703 from Optek) connected to PORTA.4.

Count PORTA.4,100,counts
rpm=counts*600

Do I have this right? Because I still get bunch of numbers when I pass the reflective surface. The sensor picks up the signal the count keeps adding "counts" rather than counting 1 at each pass.
Any clue why?


Now, since the schmitt trigger is set automatically when it is digital and you said that I need a extrenal resistor at the output.

What I don't understand is that, I am thinking that I am using the PORTA.4 as an input for the schmitt trigger. Where will the output be for this then?

Thanks
Randy

p/s-I guess you can see that I am really new at this.