The application is very similar to a mail box (for paper mail), whit the >same hole to insert mail. (2 x 6 inch). > >Each time a envelope in feeded trought the hole an IR barrier intercept it >and count. > >As a principle of operation, I would like use only 16F84 resource, on one >pin I modulate the LED and charging a capacitor, and on other pin i read >trought a phototrasnistro the light until the capacitor is discharged. > >Do you agree?? Why is the capacitor used? The '84 is perfectly able to time off a sampling period. Cheers, Win