I decomposed my ps2 tracking ball old mouse and I want to use from it those IR emitter and detector(optocoupler), the ball and
those cilinders with slotted disc in a end.Between transmitter and receiver will be that slotted disc that will rotate.
From the IR detector I'll take the pulse signal and it would go in an amplifier with histerezis (Schmitt trigger), so if the signal
would be in sinus form or sinus with lot of noise I can make it digitaly one with 0 and 1 logical applied to PIC18F2620.
And the data goes to RS232 so I can read the data in hyperterminal of WinXP.

I am new to the world of PIC programming and it will be very much useful for me if anybody can give me some advices
and a code that will read the pulse signal continuously and display the digital values in hyperterminal of WinXP of how fast is spinning the cilinders by force of the ball.

I made a block schematic for moment but in short time I need to go deeper.

Thanks in advance.Your valuable help will help me to complete my project.