Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.
 
There are pins fitted with Scmitt trigger input.
 
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.

New Articles From Microcontroller Tips

Back
Top