Page 1 of 1

Directional pulse Counter

Posted: Sun Mar 13, 2016 11:28 am
by sysprofessional
Hello,

I had design a high speed pulse counter using tmr0 external interrupt almost a year ago.That can count 14KHz pulse (840000 RPM). It is working perfectly.

Now i want to design reverse forward pulse counter.My first counter is working with single proximity sensor (Metal Detector).i know there is one more

sensor required for directional counting.But have no idea how to use second sensor.I am using PIC16f887 with 12MHz Crystal and tmr0 external interrupt with

11718.750Hz interrupt frequency.

Please guide me,

Best regards

Re: Directional pulse Counter

Posted: Mon Mar 14, 2016 12:27 pm
by Benj
Hello,

Encoders use a system called gray codes to allow you to count the number of ticks and the direction of movement. Basically only one bit is allowed to change state at a time.

Forwards
00
01
11
10

Backwards
00
10
11
01

if more than one bit changes at a time then you know you have missed a count and you can throw a warning that re-calibration is needed.

There are some encoder examples available from here and these will give you a positive or negative count depending on the direction of movement.
http://www.flowcode.co.uk/wiki/index.php ... afda8467dc

This might not be enough to cover the range of frequencies you need but might be a good starting point.

Re: Directional pulse Counter

Posted: Tue Mar 15, 2016 9:59 am
by sysprofessional
Hello Benj,

Thanks your reply ,I am too much busy in my office work today's ,I 'll check it later and touch you again if i need help.

Best Regards

Tahir