Shop OBEX P1 Docs P2 Docs Learn Events
Irregular Pulse counting — Parallax Forums

Irregular Pulse counting

SSchaafSSchaaf Posts: 6
edited 2004-10-24 23:37 in BASIC Stamp
Hello.
I have a situation I need help on, PLEASE!

I have to decode a string of pulses like those from an old rotary telephone. I intend to use 567 tone decoders to 'hear' the pulses. The pulses go: "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 " would be 54321. Pulse width would be 10 or 20 BPS. I need to not only separate each digit, ie.5 4 3 2 1, but also determine the BPS rate, (10 or 20 BPS). In 'analog land', I used a missing pulse detector to tell the space between the digits, but this time, I don't know if they'll be 10 OR 20 BPS...


I considered using PULSEIN to measure the first pulse for BPS, and count to count the number of pulses. However, how do I detect the end of one digit, and the start of another, OR, the end of the pulses altogether?????

Any help will be GREATLY appreciated.

Thank you,
Scott...

Comments

  • SSchaafSSchaaf Posts: 6
    edited 2004-10-24 23:20
    BTW,,, the pulse string DID NOT print the way I TYPED it!!! It should be like this:
    "1 1 1 1 1_____1 1 1 1_____1 1 1_____1 1_____1"
    Hope this makes more sense....
    Scott..
  • K de JongK de Jong Posts: 154
    edited 2004-10-24 23:37
    Hi Scott,

    You could use a PULSIN PIN, low, Datain (low=0). This, placed in an appropriate loop, will detect pulses going from high to low and up again. You will see the duration of the low levels.

    If you have an oscilloscope, or know somebody who has one, you can see more of the behavior of your signals. Experimenting with PULSIN and some clever debug statements in your code can give you similar information in the longer run.

    Success,

    Klaus
Sign In or Register to comment.