PIC18F rising/falling edge trigger input

Status
Not open for further replies.

adrianvon

Member
Hi all,

I made a slotted disc (with one slit) to detect the rotations of a motor, The sensor will send pulses at a maximum frequency of 350Hz. Now my problem is to detect the rising or falling edge only using an I/O pin. I do not want the sensor to stop in the slit position and the counter keeps on counting the pulses. What is the easiest way to do this please? (note that interrupt pins are already used, so that is not an option).

Any help would be highly appreciated.

Thanks.
 
Give new and old positions, a rising edge is indicated by (new xor old) and new. However, your problem will be when it stops with the slit half blocking the beam and then noise will be a problem. A schmitt trigger input will solve the later problem.

Mike.
 
It doesn't really matter about schmitt inputs, the normal pins are fine.

But the input won't keep counting, regardless of where it stops as you count the changes in level, not sit there counting just because it's low.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…