Best practice measuring pulse train
noobydoob
Posts: 14
I have a coin counter that outputs pulse trains. The pulses are high for 30ms and 120ms peak-to-peak. If I insert a quarter, I get 25 pulses.
How would you implement this on a BS2 that has other things to do than waiting for pulses all the time? Is there a buffer circuit (for example with a binary counter) that would work?
How would you implement this on a BS2 that has other things to do than waiting for pulses all the time? Is there a buffer circuit (for example with a binary counter) that would work?
Comments
It sounds like the pulses are coming in slow enough that you could monitor the states directly with the BS2.
BTW, the counters on the Propeller can be used for this sort of application. You just set up the counter and it will store the number of pulses received in one of the counter registers. The code attached to this post uses three different techniques to count incoming pulses.
I know what you mean about the BS2, waiting for pulses. I faced this issue with rain gages and other kinds of sensors used in meteorology. My solution for that was an external counter chip based on a PIC chip, which you can find here. It is not exactly what you are looking for, but it might work if you have some other indication that a coin has dropped.
Before that I was using an RC time circuit to hold the events as charge on a capacitor until PBASIC could get around to looking at the pin. I see you have another thread about that. My article about the rain gage is here.