| ??? 05/12/03 16:27 Read: times |
#45298 - RE: DMTF and Pulse Dialing -- IJAZ Responding to: ???'s previous message |
Waqar:
Your algotirhm is going to require a state machine. It will have a state variable that describes what the current decode condition is. The you need a piece of code for each state that is vectored to based on the current value of the state variable. Within each state code block you look at what is going on and then either update counters and / or flags that specify the timing seen on the input within the current state. Then based upon these conditions the state block may change the state variable to signal a new state starting. You would call the state machine dispatch code in a repeatitive manner such as from a timer interrupt routine. This repeatitive calling allows you to sample the input in each state so that you can "measure" how long a pulse period is by incrementing a memory counter variable or sensing how long an interdigit time is or to detect that you have gone beyond the interdigit time and thus have seen all the pulses in a dial sequence. Designing this kind of algotithm is not a trivial exercise and often requires detailed planning. Many people work out the scheme by designing a flow chart. You need to use a state machine concept that is called on a periodic sampled basis if you ever have hope of supporting the decoding for more than one line at a time. If you write inline code for one line then you will only be able to detect one line at a time. With the state machine concept you would have one state machine for each line that are called in a round robbin manner to interleve the detections so that you can make the processor do all lines at once. Michael Karas |



