| ??? 05/17/03 14:30 Read: times |
#45746 - RE: Hans / Kai Responding to: ???'s previous message |
Hans:
Did you do it as a scheme with subroutine that can be called on periodic basis? If so then 8 versions of this subtoutine could be called once per mSec to support detecting the dialing on the 8 lines. On a slower procssor it may be necessary to lower the sample rate to say 5 msec so there is enough time to complete the filtering activity. Kai: The job of detecting the dial pulses is several days work to implement in my estimation to work it out for dealing with 8 lines efficiently. With a sampled mode state machine I would guess that the state processing in any given state would not exceed about 35->40 instructions (maybe less). On a standard 8051 @ 12 MHz this probably translates to something like 60 uSec per state per interrupt per line. Since only one state of the state machine for each line runs at a time it seems to me that the filtering activity for the pulse dialing can be done in 60 x 8 = 480 usec for the 8 lines. Loading the processor with about a half of millisecond load in a 1 mSec timer interrupt would work pretty good if the processor did not have to do a lot more other foreground processing. It may be a better design to run the state machines at a slower pace, say 8 mSec. In this configuration you could run the timer still at 1 msec rate and then call the state machines for lines 1-2-3-4-5-6-7-8 in a round robin manner one per interrupt. ------------ For everyone. In my past experience of doing phone line work with an 8051 some decade or more ago I found it necessary to filter the off-hook switch by 5 msec for normal off/on hook detection. However I found, for some reason, that the pulse dialing activity did not need the filtering of the opto-coupler output. (I was working on a product at the time that monitored pulse dialing and/or tone dialing on a phone line as a line logger product while the phone was connected to the centeral office wiring). It could be that the higher rate of the pulses occuring were not as effected by the ring coil isolation capacitor as when the phone line has been on/off hook for longer than the normal hook flash time. It could also be that the phone company was changing what was connected to their end of the line after the expiration of the hook flash time. Michael Karas |



