Self-diagnostic apparatus and method for cellular-transceiver systems
Abstract
A self-diagnostic system for checking all functions of a cellular-transceiver system having a cellular-interface unit (10), which interface unit (10) couples a standard telephone set (T,R) to a cellular transceiver, which interface unit (10) converts the DTMF or pulse-type dialing signals into digital format for transmission to the cellular transceiver in which, the dialed number made on the landline telephone may be used to call a number over the cellular system. The present invention not only monitors and checks the proper functioning of the transceiver and associated power supply (figure 11), but will also monitor and check the interface unit (10).

Term
No projected expiry on record.
- Priority
- Filed
- Published
- Today
43 claims: 8 independent, 35 dependent
- 1WHAT WE CLAIM IS:CLAIM 1. In a cellular, or cellular-like, transceiver apparatus comprising a cellular, or cellular-like, transceiver, a cellular, or cellular-like, interface unit, and a standard, land telephone-like set coupled to said cellular, or cellular-like, transceiver, said interface unit converting DTMF or pulse-type of dialing signals into digital format for sending to said cellular, or cellular-like, transceiver, whereby the dialed number made on the landtype of telephone may be used to call a number over the cellular, or cellular-like, system, the improvement comprising: auto-diagnostic means for monitoring and reporting the proper functioning of said cellular, or cellular-like, transceiver and said cellular,, or cellular-like, interface unit;means for alternately coupling said auto-diagnostic means to said cellular, , or cellular-like, interface unit;said means for alternately coupling said autodiagnostic means comprising means for uncoupling the connection of said standard, land telephone-like set from said cellular, or cellular-like, interface unit when said autodiagnostic means is coupled to said cellular, , or cellularlike, interface unit;said auto-diagnostic means comprising means for simulating the functions performed by said standard, land telephone-like set for generating in said cellular, , or cellular-like, interface unit respective, corresponding responses in said cellular, or cellular-like, interface unit, in order to determine if said cellular, or cellularlike, interface unit is operating correctly.
- 9CLAIM 10. A testing apparatus for testing the proper operation of a cellular, or cellular-like, interface unit, which cellular, or cellular-like, interface unit is capable of being coupled to a land-type telephone or telephone-like instrument, said cellular, or cellular-like, interface unit capable of converting DTMF signals or pulse-type dialing signals from a land-type telephone instrument coupled thereto into digital data format for sending the digital data to a cellular, or cellular-like transceiver, said testing apparatus comprising:diagnostic means for monitoring and reporting the proper functioning of said cellular, or cellular-like, interface unit.
- 10CLAIM 11. The testing apparatus according to claim 10, wherein said testing apparatus further comprises means for alternately coupling said diagnostic means to said cellular, or cellular-like, interface unit;said diagnostic means comprising means for simulating the functions performed by a standard, land telephone-like instrument for generating in said cellular, or cellularlike, interface unit respective, corresponding responses in s said cellular, or cellular-like, interface unit, in order to determine if said cellular, or cellular-like, interface unit is operating correctly.
- 11CLAIM 12. The testing apparatus according to claim 11, wherein said means for alternately coupling said diagnostic means comprises means capable of uncoupling the connection of a standard, land telephone-like instrument from said cellular, or cellular-like, interface unit when said diagnostic means is coupled to said cellular, or cellularlike, interface unit.
- 13CLAIM 14. The testing apparatus according to claim to claim 13, wherein said diagnostic means comprises means for detecting the presence of a dial-tone signal generated from said cellular, or cellular-like, interface unit in response to said generation of said off-hook signal.
- 15CLAIM 16. The testing apparatus according to claim 15, wherein said diagnostic means comprises means for detecting the DTMF signal output by said cellular, or cellular-like, interface unit in response to the DTMF signal generated by said means for generating a DTMF signal.
- 18CLAIM 19. The testing apparatus according to claim 18, wherein said diagnostic means further comprises means for generating an off-hook signal to said cellular, or cellularlike, interface unit during the time that said cellular, or cellular-like, interface unit is generating its ring-signal, in order to determine that the cellular, or cellular-like, interface unit properly disconnects the ring-signal upon the answering of an incoming telephone call.
- 20CLAIM 21. A method of testing for the proper operation of a cellular, or cellular-like, interface unit by means of a diagnostic unit, which cellular, or cellular-like, interface unit is capable of being coupled to a land-type telephone or telephone-like instrument, said cellular, or cellular-like, interface unit capable of converting DTMF signals or pulse-type dialing signals from a land-type telephone instrument coupled thereto into digital data format for sending the digital data to a cellular, or cellular-like transceiver, said method comprising:(a) monitoring and reporting the functions performed by said cellular, or cellular-like, interface unit.
- 21CLAIM 22. The method according to claim 21, wherein said step (a) comprises:(b) alternately coupling said diagnostic unit to said cellular, or cellular-like, interface unit;(c) simulating the functions performed by a standard, land telephone-like instrument for generating in said cellular, or cellular-like, interface unit respective, corresponding responses in said cellular, or cellular-like, interface unit, in order to determine if said cellular, or cellular-like, interface unit is operating correctly.
- 22CLAIM 23« The method according to claim 22, wherein said step (b) comprises uncoupling the connection of a standard, land telephone-like instrument from said cellular, or cellular-like, interface unit when said diagnostic unit is coupled to said cellular, or cellular-like, interface unit.
- 24CLAIM 25. The method according to claim to claim 24, further comprising detecting the presence of a dial-tone signal generated from said cellular, or cellular-like, interface unit in response to said generation of said off-hook signal.
- 26CLAIM 27. The method according to claim 26, further comprising detecting the DTMF signal output by said cellular, or cellular-like, interface unit in response to the DTMF signal generated.
- 29CLAIM 30. The method according to claim 29, wherein said step (a) further comprises generating an off-hook signal to said cellular, or cellular-like, interface unit during the time that said cellular, or cellular-like, interface unit is generating its ring-signal, in order to determine that the cellular, or cellular-like, interface unit properly disconnects the ring-signal upon the answering of an incoming telephone call.
- 31CLAIM 32. In a radio-transceiver apparatus comprising a radio transceiver, an interface unit, and a communications device coupled to said radio transceiver, said interface unit operatively coupling said communications device to said radio transceiver for either calling out or receiving calls through said radio transceiver, the improvement comprising:auto-diagnostic means for monitoring and reporting the proper functioning of said radio transceiver and said interface unit;means for alternately coupling said auto-diagnostic means to said interface unit;said means for alternately coupling said autodiagnostic means comprising means for uncoupling the connection of said communications device from said interface unit when said auto-diagnostic means is coupled to said interface unit;said auto-diagnostic means comprising means for simulating the functions performed by said communications device for generating in said interface unit respective, correspending responses in said interface unit, in order to determine if said interface unit is operating correctly.
- 32CLAIM 33. The cellular-transceiver apparatus according to claim 32, wherein said means for simulating the functions performed by said communications device comprises means for generating an off-hook signal to said interface unit.
- 33CLAIM 34. The cellular-transceiver apparatus according to claim 33, wherein said auto-diagnostic means comprises means for detecting the presence of a dial-tone signal generated from said interface unit in response to said generation of said off-hook signal.
- 35CLAIM 36. The cellular-transceiver apparatus according to claim 35, wherein said auto-diagnostic means comprises means for detecting the DTMF signal output by said interface unit in response to the DTMF signal generated by said means for generating a DTMF signal.
- 38CLAIM 39. A testing apparatus for testing the proper operation of an interface unit, which interface unit is capable of being coupled to a communications device for operatively coupling the communications device to a radio transceiver for either calling out or receiving calls through the radio transceiver, comprising:diagnostic means for monitoring and reporting the proper functioning of said interface unit.
- 39CLAIM 40. The testing apparatus according to claim 39, wherein said testing apparatus further comprises means for alternately coupling said diagnostic means to said interface unit;said diagnostic means comprising means for simulating the functions performed by a communications device for generating in said interface unit respective, corresponding responses in said interface unit, in order to determine if said interface unit is operating correctly.
- 40CLAIM 41. A method of testing for the proper operation of an interface unit by means of a diagnostic unit, which interface unit is capable of being coupled between a communications device and radio transceiver, so that the communications device may make outgoing calls or receive incoming calls by means of the radio transceiver, said method comprising:(a) monitoring and reporting the functions performed by said interface unit;(b) alternately coupling said dignostic unit to said interface unit, and (c) simulating the functions performed by a communications device for generating in said interface unit respective, corresponding responses in said interface unit, in order to determine if said interface unit is operating correctly.
- 41CLAIM 42. The method according to claim 41, wherein said step (b) comprises uncoupling the connection of a communications device from said interface unit when said diagnostic unit is coupled to said interface unit.
Independent claims21
1,979 paragraphs in 5 sections, as filed
SELF-DIAGNOSTIC SYSTEM FOR CELLULAR-TRANSCEIVER SYSTEMS
A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent & Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
BACKGROUND OF THE INVENTION
The present invention is directed to a self-diagnosis system for checking all functions of a cellular-transceiver system. The present invention has especial relevance to a cellular-interface system, such as that disclosed in U.S. Patent Nos. 4,658,096 and 4,737,975, which are incorporated by reference herein. In the systems of these patents, an interface unit couples a standard telephone set, facsimile machine, modem, or other communications devices, to a cellu£ lar, or cellular-like, transceiver, which interface unit allows for normal operation of the communications device through the radio transceiver. The interface unit may also convert DTMF or pulse-type of dialing signals into digital format for transmission to the radio transceiver, whereby the dialed number made may be used to call a number over the radio system by means of the transceiver. The system of the invention tests for the proper operation of all functions of the adapter interface unit, as well other characteristics, such as the power output of the radio transceiver, which can be varied by either signals from the transceiver or from the radio network, or the frequency at which the transceiver is utilizing, which can be changed selectively by either the transceiver or the cellular network.
The diagnostic and testing system of the present invention may be used in any cellular-like system, such as a pure cellular system, or cellular-like systems, such ISDN and other personal communication systems, where a cellularlike adapter or interface unit is provided for converting the DTMF or pulse-type of dialing signals into digital format for transmission to the cellular-like transceiver associated with the cellular-like system.
It is known to provide diagnostic and testing equipment for entire cellular systems. It is also known to provide a self-contained unit that tests itself. The latter is disclosed in U.S. Patent Number 5,016,269 - Rogers, which is incorporated by reference herein, which discloses a cellular-telephone, emergency call-box. This patent discloses self-diagnostics that are performed by the call-box itself. The call-box of this patent has self-diagnostics within it, and periodically reports the status of items checked to a central station through the cellular network. Rogers discloses a cellular handset and transceiver and associated auto-diagnostic system for checking on the system and for reporting back to a central station. However, this patent does not disclose the monitoring and self-diagnostic function of a DTMF converter, such as used in the above-mentioned U.S. Patent Nos. 4,658,096 and 4,737,975, nor does Rogers disclose the initiation of a ring-back tone from the central office to check on nrooer workina of the svstem.
The types of cellular-like systems, besides the puretype of cellular systems, in which the present invention may be used, are those that relate generally to a wireless digital personal communications systems having a plurality of intelligent base stations and intelligent portable handset terminals, each having a predetermined radio cell coverage area, and more particularly to a digital, radio cell, radio-telephone, personal communications system (or PCS) having a full ISDN interface, thereby facilitating direct interconnection and switching of PCS call traffic through the ISDN interface and the public switched telephone network, or any switched network, the personal communications system having voice/data/image (or any combination thereof) and two-way full-duplex incoming and outgoing calling capability, and being fully operational and compatible with any modulation approach selected, with the intercell protocol hand-off being provided through distributed logic which is t
implemented in software that is resident in the intelligent portable handset terminals, the intelligent base stations, and the public switched telephone network (or any switched network) equipped with a PCS service control data base.
The increasing availability of mobile and portable communications over the past decade is freeing business and residential users from the physical constraints of a totally wired telecommunications network. Particularly, cellular communications systems, together with paging and other complementary services, brought true mobility to telecommunications services for the first time, significant tech nical advances in mobile and portable technologies, as well as in new technologies such as digital transmission with respect to wireless telecommunications, have substantially expanded the number and types of wireless telecommunications services using the radio spectrum that can be made available to the user. These prospective services include, but are not limited to, advanced forms of cellular telephone service, advanced digital cordless telephone service, portable facsimile services, wireless centrex, wireless private branch exchange services, and wireless local area network services, and may be used through the existing public switched network or through alternative local wired networks (such as cable television systems). As such, digital personal communications systems can exist independently of, and in conjunction with, local wired networks, filling gaps that are existing in current communications systems, and also in creating new markets, many of which are yet to be defined. The advent of PCS will have a great impact on the future development and configuration of all telecommunications networks by significantly improving their flexibility and functionality. Accordingly, providers of PCS will have the ability to reach and serve existing and new markets nationally in an economic and responsive manner.
Personal communications requirements in the United States are rapidly changing as the demand for instantaneous communications increases due to increased mobility of the user. One of the advantages of PCS is that it will use a single communications device to reach anyone, anytime, anvwhere. PCS will facilitate increased mobilitv and flex ibility of the user, since this approach solves the underlying problem of being in constant communications with user. PCS wireless will enable users not to miss important calls, as well as reduce the time and expense in returning calls. PCS combines the functionality of radio and the Public Switched Telephone Network (PSTN) technologies and infrestructure, and will accommodate full-duplex capabilities (two-way incoming and outgoing calling) and hand-off between radio cells (allowing users to freely move from one radio cell to another without interrupting the user's call). It is important to remember that there has been a steady increasing demand for new PCS services and technologies for numerous, sometimes incompatible, applications, namely, wireless private branch exchanges, smaller lighter portable cellular phones, portable fax machines, multi-channel cordless telephones, and additional services which are targeting the facilitation of contacting a particular individual user (rather than contacting a particular station). Current radio equipment and related services presently offered (i.e., cordless telephones, radio paging, and cellular radio) cannot fully meet the demands for these new types of PCS services. For example, cordless telephones are used in and around the home or office, operate on only a very few channels (10 or so) that are congested, and are limited to use in the immediate vicinity of their associated base station. Radio paging services are only one-way and have limited capabilities. Cellular and specialized mobile radio services cannot meet the full range of expected demand for PCS. Over time. PCS will have standardized eauioment with common modules in hardware resulting in improved reliability in the associated equipment which will also be less vulnerable to transient interference from external sources, have automatic call registration, automatic call forwarding, voice mail, faxing capability, easy roaming features, remote data transfer, increased privacy protection/caller ID/class services, increased battery life, and common protocols. In order to best fulfill this marketplace mandate, a digital PCS is a necessity. Wireless PCS may eventually eliminate the need to have a building hard-wired for communications. Generally speaking, PCS will facilitate communications equipment with additional features. A digital PCS will facilitate improvements in technical communications equipment, systems and design.
The present invention, therefore, may be used in those ISDN or other PCS systems where there is provided a cellular-type adapter or interface board that allows for the use of a standard, land-type telephone instrument in this systern, or other communications device, by converting the DTMF or pulse signals thereof into digital format that may be sent to a PCS transceiver unit, or by providing other functions that may be specific to the system. For example, in dedicated alarm systems where only outgoing calls are made by the radio transceiver, the interface unit need not provide ring generation, busy signal generation, and the like. Alternatively, in those systems where only incoming calls are required, the interface unit need not convert dialed DTMF or pulse signals into digital format. Such a PCS-cellular adaoter also nrovides all of the other functions required, such as the generation of dial tone, ringing, and the like, as the cellular interface board set forth in U.S.
Patent Nos. 4,658,096 and 4,737,975.
SUMMARY OF THE INVENTION
It is, therefore, the primary objective of the present invention to provide a self-diagnostic system for a checking all functions of a cellular-transceiver system having a cellular-interface unit, which interface unit couples a standard, land-like telephone set, or other communications device, to a cellular transceiver, or to a cellular-like, such as a PCS or ISDN transceiver, which interface unit converts the DTMF or pulse-type of dialing signals into digital format for transmission to the cellular, or cellular-like, transceiver, whereby the dialed number made on the land-type of telephone instrument, or its equivalent, may be used to call a number over the cellular, or cellularlike, system. The present invention not only monitors and checks the proper_ functioning of the cellular, or cellular-like, transceiver and associated power supply, and the like, but will also monitor and check the cellular, or cellular-like, interface unit.
The testing apparatus of the invention is capable of being coupled to an interface unit which couples a communications device to a radio transceiver for either calling out or receiving calls through the radio transceiver, the testing apparatus having its own diagnostics for monitoring and reporting the proper functioning of the interface unit.
The testing apparatus alternately couples the diagnostics to the interface unit, which said diaanostics simulates the functions performed by a communications device, such as a land line telephone, facsimile machine, modem, and the like, for generating in the interface unit respective, corresponding responses in the interface unit, in order to determine if the interface unit is operating correctly.
The testing apparatus will also generate an off-hook signal to the interface unit, as well as detect the presence of a dial-tone signal generated from the interface unit in response to the of the off-hook signal.
The testing apparatus will also generate a DTMF signal and send the signal to the interface unit, as well as detecting the DTMF signal output by the interface unit in response to the DTMF signal generated.
The testing apparatus also generates an on-hook signal to the interface unit, as well as an off-hook signal to the interface unit during the time that the interface unit is generating its ring-signal, in order to determine that the interface unit properly disconnects the ring-signal upon the answering of an incoming telephone call. The testing apparatus also generates an outgoing telephone call through the telephone network, when said the interface unit is coupled to a transceiver, and back to the transceiver, whereby the diagnostics causes the transceiver to make a telephone call to itself, with the diagnostics detecting the generation of a busy-signal by the transceiver in response to the telephone call.
BRIEF DESCRIPTION OF THE DRAWINGS
The invention will be more readily understood with reference to the accomnanvina drawina. wherein:
Figs. IA and IB show a general flow chart for the steps involved for the self-testing according to the invention;
Fig. 2 is a flow chart showing the steps involved for the subroutine of the self-testing of off-hook according to the invention;
Figs. 3 is a flow chart showing the steps involved for the subroutine of the self-testing of dial tone generation according to the invention;
Fig. 4 is a flow chart showing the steps involved for the subroutine of the self-testing of DTMF tone generation according to the invention;
Figs. 5A through 5C show a flow chart for the steps involved for the subroutine of the self-testing of ring generation according to the invention;
Fig. 6 is a flow chart showing the steps involved for the subroutine of the self-testing of ring-answer process according to the invention;
Figs. 7A and 7B show a flow chart showing the steps involved for the subroutine of the call-test which checks for proper call-detection and answering of an incoming call according to the invention;
Figs. 8A and 8B show the error-code generation subroutine according to the invention;
Fig. 9 is a flow chart showing the reset subroutine according to the invention;
Fig. 10 is a block diagram of the system of the invention;
Figs. 11 - 15 are schematics showing the various circuits used for testing the cellular, or cellular-like, interface and transceiver by simulating the events to be tested.
DETAILED DESCRIPTION OF THE INVENTION
The auto-diagnostic maintenance system of the present invention is for use in cellular, or cellular-like, interface boards and systems, such as those disclosed in U.S. Patent Nos. 4,658,096 and 4,737,975. In addition, the autodiagnostic maintenance system of the present invention may be used with other radio-transceiver systems, such as IMTS, where there is provided a wireless link between a base station and master stations, and which transceiver is associated with an adapter interface board, such as that disclosed in U.S. Patent Nos. 4,658,096 and 4,737,975, for example, which allows for connection and normal functioning of a communications-type instrument, such as a land-line telephone, facsimile machine, modem, and the like, to the radio transceiver. The interface unit provides a number of functions depending upon its intended use. For example, in dedicated alarm systems, where only outgoing calls are made by the radio transceiver, the interface unit need not provide ring generation, busy signal generation, and the like, to the communications device. Alternatively, in those systems where only incoming calls are required, the interface unit need not convert dialed DTMF or pulse signals into digital format. According to the invention, software is provided which communicates with the microprocessor of the cellular interface board or other radio-transceiver interface board, disclosed in U.S. Patent Nos. 4,658,096 and 4,737,975, which software may be activated either manually or automatically for activating an auto-diagnostic interface board of the invention, which software diagnoses the proper functioning of all the software and hardware systems contained within the entire system of these above-mentioned patents. Every single item can be checked. For example, on the interface board, the DTMF converter will be checked, the four-line interface to two-wire connection will be checked, the busy-tone software will be checked, as well as all other functioning aspects of the interface. In addition, the transceiver will be checked, the battery will be checked, as well as any other aspects of the interface. The maintenance system of the invention is capable of making a call over the cellular, or cellular-like, network to a predetermined telephone number of a central station, or base station, which central station will then send back either a tone-back or will dial the current number of the interface system to get a busy signal. This will be considered a test. The invention will also send another telephone number over the cellular, or cellular-like, system to call the same or a different central station, so that it may send back a 1000 hertz precision tone, whereby the software of the present invention will compare that 1000 hertz tone to its own predetermined configuration in order to determine whether there is a line-connection and that the cellular, or cellular-like, system is operatina correctlv. This is a oarticularlv useful svstem. since it allows the end-user to activate the phone in the event the user believes there is a problem with a phone. This test will then tell the telephone company whether or not the error is at the cellular system's central office or it is a problem with the base unit of the end-user.
According to the invention, there are two different modules. The first one is the telemaintenance circuit and the second is the teletariff circuit. The telemaintenance circuit generates a multiple test, as set forth below in detail, that includes a generation of a telephone call to a predetermined number. The circuit will report the results of the test to this particular number. In addition, the circuit can dial out to its own number in order to assure that the reception and transmission of the unit is working by receiving a busy signal. These sets of tests can be initiated by the subscriber by pressing a push button that is located on the side of the unit. When the button is pressed, the LED_. located near the button will continue flashing identifying the test is in progress. If at the end of the test the LED continues to stay on, that indicates there is a problem with the unit. This test generally takes no more than 40 seconds maximum. On the other hand, if the LED stops blinking and turns off, it indicates that the test was successful, and that the unit is in proper working order for the items that were checked on the test. As an option, the software and hardware provide that the test can be conducted from an outside number, provided that the transmission media allows it, (i.e., that the transceiver is in workina order to receive a ohone number).
The second circuit consists of the following: It utilizes the tariffing signal from the cellular, or cellular-like, system and generates the corresponding tariffing pulses for a standard table phone or pay phone. The device interprets the signal coming in from the cellular, or cellular-like, system, and does not need any local tariff. It operates in a similar manner for generating the long tones. It can be used with any cellular, or cellular-like, system that is capable of sending the tariff signals.
Telemaintenance Modules Flow Chart Description
The user may invoke the operational test sequence by pressing the autodiagnostic push button. When invoked, the interface board control is transferred to the autodiagnostic main subroutine of the telemaintenance module for performing the auto-testing.
FIGS. 1A and IB show the DO_TEST subroutine, or the autodiagnostic main subroutine. A number of calls to various test procedures are performed. After each procedure, the error flags are checked. In the event of any failure, the test sequence is stopped. Then, the status is coded, and the result is shown to the user through four LEDs, as described below.
Referring to FIG. 1A, In STEP 1, the operational test sequence starts with the initialization of variables and flags. In STEP 2, the program calls up the Hook_Test subroutine. In Hook_Test, the user's telephone is disconnected from the TIP & RING lines, while the Telemaintenance Module (׳described below in detail) is connected in its olace. to the interface board, such as that disclosed in U.S. Patent Nos. 4,658,096 and 4,737,975, in preparation for the test. STEP 3 checks for any error detected in Hook_Test. If any error was found, the test sequence stops, and the program proceeds to STEP 14 in FIG. IB. However, if no error was detected, the program calls up the Dial_Tone Test subroutine in STEP 4. STEP 5 checks for any dial tone error. If any error was found, the test sequence stops, and the program proceeds to STEP 14 in FIG. IB. However, if no error was detected, the program calls up the next test, the DTMFTest subroutine in STEP 6. The program continues in FIG. IB STEP 7, where any DTMFJTone subroutine is checked. If any error was found, the test sequence stops and the program proceeds to STEP 14. However, if no error was detected, the program calls up the next test, the Ring_Test subroutine in STEP 8. STEP 9 checks for any ring error. If any error was found, the test sequence stops and the program proceeds to STEP 14. However, if no error was detected, the program calls up the next test, the RingAnswerTest subroutine in STEP 10. STEP 11 checks for any ring-answer error. If any error was found, the test sequence stops, and the program proceeds to STEP 14. However, if no error was detected, the program calls up the next test, the Make_Call_Test subroutine in STEP 12. STEP 13 checks for any calling-out error. If any error was found, the test sequence stops, and the program proceeds to STEP 14. However, if no error was detected, the program calls up the next test, the Fin_Self_Test subroutine in STEP 15. If any error was found durina the execution of anv subroutine, the oro15 gram jumps to STEP 14. In STEP 14, the program calls up the
Error Acc subroutine. Finally, the test sequence ends after
STEP 15 has cleared all variables and flags, returning the control back to the telephone set, and resuming normal operations of the Interface.
The following explanations of FIG. 2 to FIG. 9 correspond, and describe in detail, the individual test-subroutines above-mentioned.
Referring to FIG. 2, the Hook_Test subroutine (Step 2 of FIG. 1A) starts with the initialization of variables and flags in STEP 16. In STEP 17, the program clears any output of the LEDs. In STEP 18, the user's telephone is disconnected from the TIP & RING lines of the interface board, while in STEP 19, the telemaintenance module of the invention is connected in place of the telephone. STEP 20 is a time delay to allow enough reaction time for such connection. In STEP 21, the telemaintenance module of the invention simulates and generates an off-hook. STEP 22 is a time delay to allow enough time for the off-hook. In STEP 23, the program checks the hook status of the interface board, which has now been coupled to the telemaintenance module. STEP 24 test for off-hook. If off-hook is not detected, the program continues to STEP 25, where the ERROR_FLAG is set and the MAIN_FLAG_ERROR is set to 1. However, if no error was detected, the program continues to STEP 26, where the dial tone is enabled for the next test shown in FIG. 3. Finally, this subroutine ends, and the program returns to the main subroutine Do_Test of FIGS. 1A and IB.
Referrina to FIG. 3. the Dial Test subroutine starts with the initialization of variables and flags in STEP 27. STEP 28 is a time delay to allow enough time for a proper dial tone. STEP 29 tests the dial tone. If the dial tone fails, the program continues to STEP 30, where the ERROR_FLAG is set and the MAIN_FLAG_ERROR is set to 3. However, if no error was detected, the program continues to STEP 31, where the program loops back to STEP 29, testing the dial tone for at least 711 milliseconds. After no errors have been detected after the 711 milliseconds has expired, this subroutine ends, and the program returns to the main subroutine Do_Test of FIGS. 1A and IB.
Referring the FIG. 4, the DTMF_Test subroutine, which tests for the proper DTMF conversion into digital data by the interface board, starts in STEP 32 by disabling the dial tone from the previous subroutine test. STEP 33 sets the first DTMF tone to 0. In STEP 34, the telemaintenance module sends the DTMF tone corresponding to this value. STEP 35 is a time delay to allow enough time for the tone to be on. STEP 36 disables the DTMF tone. STEP 37 is a time delay to allow the interface to detect the DTMF tone pulse. In STEP 38, the interface reads the tone. STEP 39 checks the received DTMF tone. If the DTMF tone sent is not equal to DTMF tone received, or no DTMF tone is received, then the program continues to STEP 40, where the ERROR_FLAG is set, and the MAIN_FLAG_ERROR is set to 4. However, if the DTMF tones are equal, the program continues to STEP 41, and the next DTMF digit is selected. In STEP 42, the program verifies that all DTMF tones have been tested; otherwise the nroaram loons back to test the next diait. Finallv. after all the DTMF tones have been tested, the subroutine ends, and the program returns to the main subroutine called
Do_Test of FIGS. LA AND IB.
Referring to FIGS. 5A & 5B, the Ring_Test subroutine is shown. This subroutine tests the timing of the two pulses of the ring generated by the ring circuitry of the interface board. Referring to FIG. 5A, the subroutine starts with the initialization of variables and flags in STEP 43. In STEP 44, the telemaintenance module generates an on-hook. Step 45 is a time delay to allow the interface to detect the onhook. In STEP 46, the interface is set to believe that an incoming call is in progress; therefore, the interface board will generate its ring sequence. The objective of STEPS 47 to 53 is to verify that the ring starts within the next two seconds, and that off-hook is not detected. In STEP 47, the timer is cleared. STEP 48 tests for off-hook. If off-hook is detected, then the test is stopped, and the program jumps to STEP 49 in FIG. 5C for error-indication. However, when on-hook is detected, the program continues to STEP 51, where the telemaintenance module checks for the ring to be active. STEP 52 tests if the ring has started. If the ring has started, the program continues to STEP 54 in FIG 5B. However, if the ring had not yet started, the program checks the timer in STEP 53. If the time is less than two seconds, the program keeps looping back to STEP 48 until the ring starts. However, if the two second timer had expired, the test stops and the program jumps to STEP 49 in FIG. 5C for indicating error. Referring to FIG. 5B, STEP 54 is a time delav.
The obiective of STEP 55 to STEP 59 is to verifv that the ring will last for at least one 1.3 seconds, and that off-hook is not detected. In STEP 55, the timer is cleared. STEP 56 tests for on-hook. If off-hook is detected, the test stops, and the program jumps to STEP 49 in FIG 5C for indicating error. However, when on-hook is detected, the program goes to STEP 57, where the telemaintenance module checks for the Ring to be active. STEP 58 tests if the ring has stopped. If the ring has stopped, the program continues to STEP 49 in FIG. 5B. However, if the ring has not yet stopped, the program checks the timer in STEP 59. If the timer is less than 1.3 seconds, the program keeps looping back to STEP 56 until the ring stops. However, if the time has expired, the test stops, and the program jumps to STEP 49 in FIG. 5C. The objective of STEP 60 to STEP 62 is to verify that the ring will not last more than 2.5 seconds. In STEP 60, the telemaintenance module checks if the ring is active. STEP 61 tests if the ring has stopped. If stopped, the program jumps to STEP 63 in FIG. 5C. However, if the ring has not yet stopped, the program checks the timer in STEP 62. If the timer is less than 2.5 seconds then, the program keeps looping back to STEP 60 until the ring stops. However, if the time has expired, the test stops and the program jumps to STEP 49 in FIG. 5C.
Referring to FIG. 5C, the objective of STEP 63 to STEP 65 is to verify that no off-hook is detected for a period of two seconds. In STEP 63, the timer is cleared. STEP 64 tests for on-hook. If off-hook is detected, then the test stops and the program continues in STEP 49 for indicating error. However, if off-hook is not detected, the oroaram checks the timer in STEP 65. If the timer is less than two seconds, the program keeps looping back to STEP 64 until the ring starts. However, if the time has expired, then the program continues in STEP 66, where the program checks how many cycles this subroutine has tested the ring. If the ring has been tested for only one cycle, the program continues in STEP 67, where the flag called Ring_Second is set. Thereafter, the program loops back up to STEP 47 in order to test the ring for a second time. However, if the ring has been tested twice, the subroutine ends and the program returns to the main subroutine called Do_Test. If an error was detected during any part of the Ring_Test subroutine, the program jumps to STEP 49. STEP 49 clears the incoming call status; therefore, the ring sequence stops. Then, the program continues in STEP 50, where the ERROR_FLAG is set and the MAIN_FLAG_ERROR is set to 5. Then, the subroutine ends, and the program returns to the main subroutine called Do_Test.
Referring to FIG. 6, the Ring_Answer_Test subroutine is shown. This subroutine tests the response of the interface board when an off-hook is presented to the interface board during the ring-cycle, when answering the telephone for an incoming call. The objective of STEP 68 to STEP 69 is to verify that the ring will start within the next two seconds and that off-hook is not detected. In STEP 68, the timer is cleared. STEP 69 tests for on-hook. If off-hook is detected, then the test stops and the program jumps to STEP 73. However, if on-hook is detected, the program continues with the rina active. STEP 71 tests if the rina has started. If the ring has started, the program continues to STEP 74. However, if the ring has not yet started, the program checks the timer in STEP 72. If the timer is less than two seconds, then the program loops back to STEP 69 waiting for the ring to start. However, if the two-second timer has expired, the test stops and the program jumps to STEP 73. In S 73. In STEP 74, the telemaintenance module generates an off-hook. STEP 75 is a time delay that allows the interTEP 74, the telemaintenance module generates an off-hook. STEP 75 is a time delay that allows the interface board to detect the off-hook. In STEP 76, the interface checks the hookstatus. If off-hook is not detected in STEP 77, then the test stops and the program jumps to STEP 73. However, if the interface board detects the off-hook, the program continues in STEP 78. If an error was detected during any part of the Ring_Answer_Test subroutine, then the program jumps to STEP 73, where the ERROR_FLAG is set and the MAIN_FLAG_ERROR is_set to 6. ׳ Then, the program continues in STEP 78. In STEP 78, the incoming call status is cleared; therefore, the interface board will stop the ring sequence. Then, the subroutine ends, and the program returns to the main subroutine called Do_Test.
Referring to FIGS. 7A & 7B, the CallTest subroutine is shown. This subroutine tests the cellular, or cellular-like, transceiver coupled to the interface board, by first checking the power, and, secondly, generating a call to its own telephone number. Referring to FIG. 7A, STEP 79 checks if the transceiver's power is on. If the power is off, the MAIN1 FLAG ERROR is set to 1 in STEP 81. and then the program jumps to STEP 93 in FIG. 7B. However, if the power is on, the program proceeds to STEP 82, where the interface board requests and gets the transceiver's assigned telephone number. STEP 83 is a time delay to allow reaction time for the transceiver. In STEP 84, the interface board generates a telephone call to itself. STEP 85 is a time delay to allow time for connection between the cellular, or cellular-like, network and the transceiver. In STEP 86, the interface board requests the IN USE status from the transceiver. STEP 87 checks the status of the call. If the status is not IN USE, the MAIN1_FLAG_ERROR is set to 4 in STEP 88, and then the program jumps to STEP 93 in FIG. 7B. However, if the transceiver is IN USE, the program proceeds to STEP 89 in FIG 7B. In FIG. 7B, the telemaintenance module checks the busy-tone in STEP 89. If the busy-tone is detected in STEP 90, then the program jumps to STEP 93 for an indication that all is operating correctly. However, if the busy-tone is not detected, the program proceeds to STEP 91, where the timer is checked. If the timer is less than
18.2 seconds, then the program loops back to STEP 86. This allows more time to the cellular, or cellular-like, network to return the busy-response. However, if the time has expired, the program proceeds to STEP 92, where the MAIN1_FLAG_ERROR is set to 3. In STEP 93, the interface board sends an END of call to the transceiver. Then, the telemaintenance module presents an on-hook to the interface board in STEP 94. Finally, the subroutine ends and the program returns to the main subroutine Do_Test.
The objective of FIG. 8A and FIG. 8B is to aenerate a an ERROR_CODE from the previously-described error flags, in such a way that the results can be output later through LEDs. Referring to FIG. 8A, the subroutine starts checking the value of one of two error flags, the MAIN_FLAG_ERROR. STEP 95 checks if MAIN_FLAG_ERROR is equal 1 or Hook Slic Error. If true, the ERROR_CODE is set to 1 in STEP 96, and then the program returns to the main subroutine Do_Test. However, if false, the program continues in STEP 97. STEP 97 checks if MAIN_FLAG_ERROR is equal 2 or hook-ring error. If true, the ERROR_CODE is set to 2 in STEP 98, and then the program returns to the main subroutine Do_Test. However, if false, the program continues in STEP 99. STEP 99 checks if MAIN_FLAG_ERROR is equal 3 or dial-tone error. If true, the ERROR_CODE is set to 3 in STEP 100, and then the program returns to the main subroutine Do_Test. However, if false, the program continues in STEP 101. STEP 101 checks if MAIN_FLAG_ERROR is equal 4 or DTMF tone error. If true, the ERROR_CODE is set.to 4 in Step 102, and then the program returns to the main subroutine Do_Test. However, if false, the program continues in STEP 103. STEP 103 checks if MAIN_FLAG_ERROR is equal 5 or ring-detection error. If true, the ERROR_CODE is set to 5 in STEP 104, and then the program returns to the main subroutine Do_Test. However, if false, the program continues in STEP 105. STEP 105 checks if MAIN_FLAG_ERROR is equal 6 or ring-answer error. If true, the ERROR_CODE is set to 6 in STEP 106, and then the program returns to the main subroutine Do_Test. However, if false, the program jumps to STEP 107 in FIG. 8B. In FIG 8.B, the subroutine starts checkina the value of the second error flag, the MAIN1_FLAG_ERROR. STEP 107 checks if MAIN1_FLAG_ERROR is equal 1 or power-radio error. If true, the ERROR_CODE is set to 7 in STEP 108, and then the program returns to the main subroutine DoJTest. However, if false, the program continues in STEP 109. STEP 109 checks if MAIN1_FLAG_ERROR is equal 2 or call error. If true, the ERROR_CODE is set to 8 in STEP 110, and then the program returns to the main subroutine DoJTest. However, if false, the program continues in STEP 111. STEP 111 checks if MAIN1_FLAG_ERROR is equal 3 or busy-tone error. If true, the ERROR_CODE is set to 9 in STEP 112, and then the program returns to the main subroutine DoJTest. However, if false, the program continues in STEP 113. STEP 113 checks if MAIN1_FLAG_ERROR is equal 4 or ’<sup>,</sup>In Use error. If true, the ERROR_CODE is set to 10 in Step 114, and then the program returns to the main subroutine Do-Test. However, if false, the program continues in STEP 115. STEP 115 checks if MAIN1_FLAG_ERROR is equal 5 or 1000 Hz. error. If true, the ERROR_CODE is set to 11 to STEP 116 DoJTest. However, if false, the program returns to the main subroutine DoJTest.
Referring FIG. 9, FIN_SELF subroutine, the objective of this subroutine is to reset the interface board to its normal functioning, and to show the end of the test by flashing the LEDs four times. The subroutine starts with STEP 117, where the telemaintenance module generates an onhook. In STEP 118, all variables and error flags are cleared. STEP 119 turns off all LEDs. STEP 120 is a time delay. STEP 121 turns on all LED's. STEP 122 is a time delav. STEP 123 nermits to looo back to STEP 119. so that the flashing is performed four times. Finally, STEP 124 clears all LEDs, and then the program returns to the main subroutine Do_Test of FIGS. 1A & IB.
The following is a description of the operation of the of the invention, with reference being had to Fig. 15, which is followed by the description of the individual circuits used for carrying out the above-described auto-test, which is followed by the software program for carrying out the operations detailed therein.
Referring to FIG. 10, there is shown a block diagram of the telemaintenance circuit module, which is indicated generally by reference numeral 10. The telemaintenance circuit module 10 is installed in a cellular, or cellularlike, adaptor system such as that disclosed in U.S. Patent Nos. 4,658,096 and 4,737,975, and is designed to initiate a process of automatic testing from the facilities of the telephone subscriber by push-button activation or by automatic testing at intervals of approximately 12 hours, according to the flow charts of Figs. 1A - 9, as described above in detail. The final result of this autotest will be provided to the user by way of an orange-colored light indicator (LED) installed in the right wall of the cellular, or cellular-like, adaptor. The telemaintenance circuit module 10 has the capacity of reporting the results of the test to a remote service center. This report will be accomplished by way of an automatic call to the assigned number for the service center. This function requires that the service center be equipped with the hardware and software necessarv to establish communication, and to internret the received reports. The autodiagnostic test of the invention verifies the correct operation of the cellular, or cellularlike, adaptor, including its components, such as: principal circuits of the interface card, data cable between the radio and interface, transmission line, antenna, cellular, or cellular-like, transceiver, tollcharge circuit and supply source. The telemaintenance circuit has been configured in order to call the same number assigned to the adaptor transceiver where the test is carried out. The autodiagnostic circuit is programmed to detect a busy or line-congestion signal as an indication that a call can be made, and that the transmission circuit is operating correctly.
The telemaintenance circuit module 10 is designed to be utilized in the cellular, or cellular-like, adaptor unit in order to verify that the latter is operating correctly without necessitating sending technical personnel to the site where the equipment is installed. The telemaintenance circuit module 10 is supplied directly from the cellular, or cellular-like, interface board. The advanced telemaintenance circuit is not an autonomous circuit'. Its operation depends on control signals that it receives from the auditor localized in the cellular, or cellular-like, interface board. The auditor compares the results of the tests with the parameters of the system's operating program. The autodiagnostic circuit of the telemaintenance circuit module 10 conducts the following tests:
Answering errors [wrong number] - This test is conducted by two alternate methods; ring voltage - the circuit generates a call and detects the nresence of rina voltaae that the interface card produces; Call answer - verifies that the ring stops once it is answered; Dial tone - verifies the presence of the dial tone; MFTD Operation - assures that the interface card properly detects the receipt of the MFTD [multifrequency tone detector] tones; transceiver test; reception circuit test; transmission circuit test; tollcharge circuit test - verifies the frequency characteristic of the pulses generated at 12 KHz; transceiver power supply; performance of the power supply system. These tests have been detailed above in the description of the flow charts of FIGS. IA to 9.
The telemaintenance circuit module 10 is connected to the conventional, cellular, or cellular-like, interface card by a 20-position plug connector. The test routine is initiated by way of a manual switch installed on the right side of the adaptor box. Upon finding an abnormality in the operation of the telephone, as, for example, not hearing the dial tone upon picking up the receiver, the subscriber proceeds to the adaptor box and presses a test pushbutton, which is properly identified. The telemaintenance circuit module 10 proceeds to disconnect the connection of the subscriber's telephone to the cellular, or cellular-like, interface board, and to accomplish a sequence of autodiagnostic tests, as described above. The telemaintenance circuit module 10 is also programmed to initiate the test routine automatically at intervals of approximately 12 hours from the moment the cellular, or cellular-like, interface board is turned on. When the test is automatically initiated. the seauence of the outaoina test call is not aenerated.
By means of further development, the autodiagnostic test start-up function can be initiated from a remote center. This telemaintenance function carries a modification to the operating software of the interface board, and has an auxiliary development for the hardware and software of the telemaintenance center. Upon initiating the autotest routine, the orange-colored light indicator (LED) will flash to indicate to the subscriber that the test is taking place. There are pauses in the indicate flash of approximately one second between each of the tests accomplished by the circuit. The complete test will last approximately 40 seconds. Upon finishing the test, the success of the test is shown by the light indicator remaining on. In this case, the existing problem would be related to the wiring or to the telephone apparatus connected to the cellular, or cellular-like, interface board. Once the light indicator stays lit continuously, the cellular, or cellular-like, interface board returns to its normal operating condition. When a breakdown of the cellular, or cellular-like, interface board is determined from the tests, the light indicator will be extinguished indefinitely. This indicates to the user that a breakdown exists in the cellular, or cellular-like, adaptor. Once the test routine is finished, the cellular, or cellular-like, interface board returns to its normal operating condition irrespective of what breakdown was detected. The user may continue using the adaptor even with the existing limitations due to the detected breakdown.
The 4-light indicator (LEDs) in the circuit of the cellular. or cellular-like. interface board will be utilized to identify the detected breakdown. This presentation is of help to the service technician who can gain access to the inside of the box in order to ascertain the nature of a possible breakdown. The combination of on and off״ LED's will identify the primary detected breakdown in the test. This combination will remain lit for 60 seconds once the test ends. A list of the possible breakdown codes indicated by the LED's of the cellular, or cellular-like, interface board is given below.
On concluding the autotest, a call will be initiated to the telemaintenance center if a breakdown has been detected. Once the communication is established, the detected breakdown will be reported. This telemaintenance function will allow the establishment of a database for each unit. If the test was manually initiated by way of the pushbutton, the complete result of the finished test, irrespective of whether breakdowns were detected, will be reported to the telemaintenance center;.
The following is a listing of the codes as displayed by the LED array:
<td colspan="5"> 4.10 ERROR CODE</td>
<td> Type of Error</td><td> LED 5</td><td> LED 4 LED</td><td></td><td></td>
<td> 3 LED 2</td><td></td><td></td><td></td><td></td>
<td> No Breakdowns</td><td> OFF</td><td> OFF</td><td> OFF</td><td> OFF</td>
<td> Loop Error</td><td> OFF</td><td> OFF</td><td> OFF</td><td> ON</td>
<td> Loop Error</td><td> OFF</td><td> OFF</td><td> ON</td><td> OFF</td>
<td> Dial Tone</td><td> OFF</td><td> OFF</td><td> ON</td><td> ON</td>
<td> MFTD Detector</td><td> OFF</td><td> ON</td><td> OFF</td><td> OFF</td>
<td> Ring Detector</td><td> OFF</td><td> ON</td><td> ON</td><td> ON</td>
<td> Call Answer</td><td> OFF</td><td> ON</td><td> ON</td><td> OFF</td>
<td> Transceiver Feed</td><td> OFF</td><td> ON</td><td> ON</td><td> ON</td>
<td> Transmitter (Call)</td><td> ON</td><td> OFF</td><td> OFF</td><td> ON</td>
<td> Receiver (Busy)</td><td> ON</td><td> OFF</td><td> OFF</td><td> OFF</td>
<td> Tone Detection at 12 KHz</td><td> ON</td><td> OFF</td><td> ON</td><td> ON</td>
<td> Feed from Power Source</td><td> ON</td><td> OFF</td><td> ON</td><td> OFF</td>
<td> NO SERVICE</td><td> ON</td><td> ON</td><td> ON</td><td> ON</td>
<td> Transmission Circuit</td><td> ON</td><td> ON</td><td> ON</td><td> OFF</td>
<td> Undetermined</td><td> ON</td><td> ON</td><td> OFF</td><td> ON</td>
<td> Undetermined</td><td> ON</td><td> ON</td><td> OFF</td><td> OFF</td>
The sequence of the autotest is as follows. The first action accomplished by the telemaintenance circuit is disconnecting the installation of the subscriber. Then, a condition of ״answer the subscriber's telephone״ is simulated. In this condition, the correct detection of the loop closing can be checked, thus generating the dial tone. Then, the correct generation of the dial tone can be verified within a minimum frequency and level range. Next, a test of the multi-frequency tone detector of MFTD begins. This consists of the telemaintenance circuit module's autodiagnostic card generating the entire sequence of 16 MFTD tones, sending it to the conventional, cellular, or cellular-like, interface board of_the cellular, or cellular-like, adapter, and verifying that these tones are correctly detected. Then, a test is carried out for verifying the correct functioning of the ring generator. The ring-current is generated, verifying its frequency and level within an established minimum range. Then, the condition of answering the telephone is simulated anew, or call answer, in order to check the function of the ring circuit, which should deactivate before the telephone is answered. The next test detects the capacity of the tollcharge circuit to generate pulses at 12 KHz within a minimum frequency and level range, for the case of cellular, or cellular-like, -adaoter oav teleohones. The pulses generated by the tollcharge card will be detected by a precise pulse detector in the telemaintenance circuit module 10 in a manner that is well-known. For cellular, or cellular-like, adapter systems that do not have a tollcharge module, then the connector JI.3 of the cellular, or cellular-like, interface card is configured with the bridge removed. The bridge will be installed in those units that have the tollcharge module installed.
The next tests verify the functioning of the cellular, or cellular-like, transceiver. First, supply to the transceiver is verified. This test is made by means of the detection of +12 VDC derived from the data connector of the transceiver. Secondly, the transceiver is verified that it is in a condition of providing cellular, or cellularlike, access-service, indicated by the absence of the NO SERVICE signal. The presence of the NO SERVICE signal will be recognized as a breakdown. This condition can be caused by a cover defect, and not just a breakdown of the cellular, or cellular-like, transceiver. Next, a call is generated through the cellular, or cellular-like, network, to the number owned by the subscriber. The transceiver function is checked in this manner, detecting it as receiving a busy signal from the system, since, it is calling itself. In the case of finding the network congested, this will inform the transceiver of a PATH ENGAGED condition. The transceiver then generates a congestion (busy) tone. This tone is interpreted as a correct transceiver function, the same as the busy signal. This test will be accomplished onlv when the routine is manuallv initiated bv nushbutton.
This test will not be accomplished in units that initiate the process automatically. The voltage of the supply system power is also checked. If the voltage is less than 13.5
VDC, a breakdown in the supply source is detected.
In Fig. 10, the main telemaintenance module 10 is coupled to the standard cellular, or cellular-like, adapter or interface board 14. Within the telemaintenance module, there are a number of individual circuits that are used for performing the self-diagnosing tests, as described above. These circuits are: The busy-signal detector 16 used during the test for proper reception of a call made by the telemaintenance module during the call-back self-testing described above with reference to Fig. 7A; the 12,000-cycle detector circuit 18 used for tollcharge testing, which verifies the frequency characteristic of the pulses generated at 12 KHz; the MFTD generator circuit 20, which generates the DTMF signals converted by the cellular, or cellular-like, interface card, as> described above with reference to Fig. 4; the ring-signal detector circuit 22, which is used for detecting the ring-signal generated by the cellular, or cellular-like, adapter interface board during the ring-test and ring-answer subroutines, described above with reference to Figs. 5A through 6; the dial-tone detector circuit 24, which detects for the proper generation of dial tone by the cellular, or cellular-like, adapter interface board 14, as described above with reference to Fig. 3; the voltage-detector circuit 28 for testing the power supply of the transceiver and the entire system; and the telemaintenance control unit 30. which is the control unit and which is also used for calling and reporting to the central reporting station the results of the autotest. The actual configuration of each of the above-noted circuits is shown in Figs. 11-14, which are described below in detail.
Referring now to the FIGS. 11-14, there are shown the hardware circuits for performing the simulation tests described above during the entire self-testing process. Referring to Fig. 11, there is shown the interconnection circuit of the telemaintenance circuit module 10. The part of the schematic of Fig. 11 labeled ״A shows the location where the telemaintenance circuit is hooked into the lines of TIP & RING of the conventional cellular, or cellular-like, adapter interface board. The relay labeled RELY1 is used to disconnect the user's telephone from the cellular, or cellular-like, interface during the maintenance operation test. Instead thereof, the telemaintenance circuit is hooked up to the TIP & RING in order to perform the tests. When the ״ENABLE-TEST signal is set to HI, the transistor Q3 is forced into saturation, and then energizes RELY1, connecting the maintenance circuit to the TIP and RING. The part of the schematic of Fig. 11 labeled B shows the user-telephone hook-up connector, where the user's telephone can be hooked to the board in two possible ways. JI is a two terminal connector of Pl of a normal RJ11 telephone type socket.
The section of the schematic of Fig. 11 labeled C is the audio interface circuit, which is used as an interface between the TIP and RING lines and the Audio. T1 is a teleohone matchina transformer. Its function is to maintain similar AC and DC current characteristics of a telephone while allowing audio signals to be received and transmitted. Zener diodes DI & D2 are used to cut up any signal with voltages higher than +/-4.5V. Also included is an optoisolator SSR1 that, in conjunction with transistor Q4, offers a mechanism to close the TIP & RING circuit. When the Conn-Loop״ signal is set to HI, the transistor Q4 is forced into saturation, which then energizes SSR1, closing the circuit and performing an off-hook.
The section of the schematic of Fig. 11 labeled D is the ring-detection circuit, which contains two main parts: U2, which is a ring-detector integrated circuit, and U9 with opto-isolator that provides a proper Cmos signal level output. A current is provide between pin 4 and pin 7 of U2 as an output signal when a ring-voltage is present at the TIP & RING lines. This current is then transformed by the opto-isolator U9, which then provides an active Low signal to the I/O. t
The section of the schematic of Fig. 11 labeled E shows the loop-current detector, which contains an optoisolator used to detected loop current. When the test is enabled (the Enable-Test signal is HI in part A) and an off-hook is performed, (the Conn-Loop signal is HI in part C), the TIP & RING lines go into close-circuit providing an off-hook current. This current is then transformed by U17 into an active Low signal to the I/O.
The section of the schematic of Fig. 11 labeled F is the input-output audio circuitry composed of 1/4 of Ul, an operational amplifier IC. The main function of this circui34 try is to isolate and pre-amplify the incoming audio signals. The output of this circuit is called Audio-In״.
Also, in this section the DTMF output generated by the telemaintenance circuit of the invention is sent to the TIP & RING lines. This DTMF signal is labeled as Tone-Out.
Referring now to Fig. 12, the part of the schematic of Fig. 12 labeled ״G״ is the DTMF tone generator, which is composed of U4, a DTMF tone generator, and 1/4 of U1 used as an output amplifier. To generate a DTMF tone, first a four bit code is presented to the input pins labeled DTMFOOUT, DTMF1-0UT, DTMF2-0UT and DTMF4-OUT in U4. Then, while keeping the four bit code, the enable signal labeled DTMF-OUT is changed from Low to HI level, thus allowing the tone to be generated. The audio is output at TONE-OUT after the audio had been amplified by U1:C. To stop the tone, the DTMF-OUT signal is returned to low level.
The section of the schematic of Fig. 12 labeled H is the input/output port, the ׳I/O Port IC labeled U8. This integrated circuit is used by the microcontroller of the cellular, or cellular-like, interface board to read the input data and to control all of the output of the telemaintenance module. Ports A and C are input ports, while port B is an output port. Jumper J4 is the selector for the automatic periodic test with possible selections of 12 or 24 hours. J5 is used as an enable for the call to the automatic answer.
The sections of the schematic of Fig, 12 labeled I.l and 1.2 are the power, data and control connectors, and contain J2. a 2 bv 10 male header connector used to brina power, as well to send and receive data to the I/O Port. It also includes a 4 pin header connector for the external LED used to show the status of the test, and an external push button used to manually activate the test. The section of the schematic of Fig. 12 labeled J is the power regulator, and has U7, a 5 Volt fix-positive regulator that supplies the voltage necessary for the digital circuits.
The telemaintenance module 10 contains six single tone detectors used for testing the receiving audio path, frequency and timing cadence of ROH, Dial, Busy and Congestion tones. Each of the tone detectors is composed of an operational amplifier and a single tone detector IC. The input of the Opamp is connected to line AUDIO-IN״. The frequency of detection is set by a resistor located between pin 5 and 6 and a capacitor located between pin 6 and ground. When a valid tone matches the programmed tone by the RC, the tone detector output pin is forced from HI to Low.
Section K״ of Fig. 12. shows the dial-tone detector circuit. When a valid dial tone is present at the input of U3, the ״DIAL-DETECT״ line is forced to go Low. Section L shows the busy-tone detector circuit. When a valid busy tone is present at the input of U6, the ״BUSY-DETECT line is forced to go Low.
Section M of FIG. 13 shows a 400 Hz. tone-detector circuit. When a valid 400 Hz. tone is present at the input of U14, the 400-DETECT״ line is forced to go Low.
Section N of FIG. 14 shows a 800 Hz. tone-detector circuit. When a valid 800 Hz. tone is present at the input of U13. the 800-DETECT line is forced Low. Section 0 shows a 1020 Hz. tone-detector circuit. When a valid 1020
Hz. tone is present at the input of U16, the 1020-DETECT line is forced Low. Section *P shows a 12 KHz. tone-detector circuit. When a valid 12 KHz. tone is present at the input of U12, the 12״KHZ-DETECT line is forced Low.
Section ״Q״ of FIG. 13 shows a DTMF tone decoder, which is composed of Uli, a DTMF tone detector and 1/4 of U1 used as an input pre-amplifier. When a valid DTMF tone is present at the input pin (IN-), the control line DTMF-STROBE is forced Low, while the IC is decoding. After the tone has been decoded, a four bit code is output to pins labeled ״DTMFO-IN״ ,״DTMF1-IN״ ,״DTMF2-IN and DTMF4-IN in Uli. The control line ״DTMF-STROBE״ is then returned to HI again. Section R is an AC monitor, having U10, a 4.5V under-voltage detector. Resistors R17 and R33 form a voltage divider that will make U10 sense voltage under 13 volts instead of 4.5 volts. The circuit works on the assumption that when the supply voltage comes from the־ power supply, a 14V is present at the entrance of the telemaintenance module. On the event of an AC power failure, the voltage drops to the battery back-up level, which is not greater than 13 volts. The circuit will detect the drop, and U10 will drive line labeled AC-DETECT to Low.
The following is a listing of the source code for performing the invention.
$nopi nosb db noge nomo nopr ep
Snolist $include(reg252.pdf)
Slist ,»#»♦♦♦»**♦»**♦*♦♦»*#«»»**#«*»»»»»»»»»»*.*»»»»»*»♦»»*♦♦*♦*♦************** » ; Maxjack by Alexis V. Torres for Codecom Rural Comm. Inc.
; (C) Copyright Codecom Rural Comm. Inc. 1993 ; Telephone/cellular interface:
; Main program with the maintenance board ; 11-29-92 maint.asm i
♦♦***♦***♦****נ»***♦♦♦*♦♦♦♦♦♦«♦♦♦♦♦♦♦♦♦**«*.♦**♦.*****♦.**.»***♦**♦«♦*♦♦.
; These are the universal landline phone key codes.
<td> zero star pound</td><td> equ equ equ</td><td> Oah Obh Och</td><td> ; [0] key code ; [*] key code ; [#] key code</td>
<td colspan="4"> ; Buffer area pointers for the HS display and the TRU messages.</td>
<td> dspbuf_start equ</td><td> 80h</td><td></td><td> ; Start of 16 byte LCD display buffer</td>
<td> dspbuf_end equ</td><td> 90h</td><td></td><td> ; End of LCD display buffer</td>
<td> msgbuf_start</td><td> equ</td><td> 90h</td><td> ; Start of TRU (etc) msg buffer</td>
<td> msgbuf_end equ</td><td> Oh</td><td></td><td> ; End of TRU msg buffer</td>
<td> main_flag equ</td><td> ObOh</td><td></td><td> ; use indirect address for test flag</td>
<td> ;hook_slic</td><td> 1</td><td></td><td></td>
<td> ;dial</td><td></td><td> 2</td><td></td>
<td> ;dtmf_</td><td></td><td> 3</td><td></td>
<td> ;ring_test</td><td> 4</td><td></td><td></td>
<td> ;ans__test</td><td> 5</td><td></td><td></td>
<td> main_flag_error</td><td> equ</td><td> Oblh</td><td></td>
<td> :hook_slic_error</td><td> 1</td><td></td><td> ; hook error</td>
<td> ;hook_ring_error</td><td> 2</td><td></td><td> ; hook error</td>
<td> ;dial_error</td><td> 3</td><td></td><td> ; dial tone error</td>
<td> ;dtmf_error</td><td> 4</td><td></td><td> ; dtmf error</td>
<td> ;ring_test_error</td><td> 5</td><td></td><td> ; ring error</td>
<td> ;ans_test_error</td><td></td><td> 6</td><td> ; ring answer error</td>
<td> mainl_flag equ</td><td> 0b2h</td><td></td><td> ; ditto</td>
<td> ;power_radio</td><td></td><td> 1</td><td> ; power radio error</td>
<td> ;call_test</td><td> 2</td><td></td><td> ; call error</td>
<td> ;call_tone</td><td> 3</td><td></td><td> ; call audio error</td>
<td> mainl_flag_error equ</td><td> 0b3h</td><td></td><td> ; ditto</td>
<td> ;power_radio_error</td><td> 1</td><td></td><td> ; spare</td>
<td> ;call_test_error</td><td> 2</td><td></td><td> ; call spare error</td>
<td> ;call_tone_error</td><td> 3</td><td></td><td> ; call audio spare error</td>
<td> ;inuse</td><td></td><td> 4</td><td> ; inuse error</td>
<td> ;lOOOhz</td><td colspan="3"> 5</td><td> ; lOOOhz error</td>
<td> error_code equ</td><td> 0b4h</td><td></td><td colspan="2"> ; final indication LED indication</td>
<td> ;hook_slic_error</td><td> 1</td><td></td><td> ; hook</td><td></td>
<td> ;hook_ring_error</td><td> 2</td><td></td><td> ; hook</td><td></td>
<td> ;dial_error</td><td> 3</td><td></td><td> ; dial</td><td></td>
<td> ;dtmf_error</td><td> 4</td><td></td><td> ; dtmf</td><td></td>
<td> ;ring_test_error ;ans_test_error</td><td> 5</td><td> 6</td><td> ;ring</td><td> ; ring answer</td>
<td> ;power_radio_error</td><td> ד</td><td></td><td colspan="2"> ; radio power</td>
<td> ;call_test_error</td><td> 8</td><td></td><td> ;call</td><td></td>
<td> ;call_tone_error ;inuse</td><td> 9</td><td> 10</td><td> ; call audio</td><td> ;inuse</td>
<td> ;lOOOhz</td><td></td><td> 11</td><td></td><td> ; 1000 hz</td>
<td> cero</td><td> equ</td><td> OOh</td><td></td><td></td>
<td> uno</td><td> equ</td><td> 08h</td><td></td><td></td>
<td> dos</td><td> equ</td><td> 04h</td><td></td><td></td>
<td> tres</td><td> equ</td><td> Och</td><td></td><td></td>
<td> cuatro</td><td> equ</td><td> 02h</td><td></td><td></td>
<td> cinco</td><td> equ</td><td> Oah</td><td></td><td></td>
<td> seis</td><td> equ</td><td> 06h</td><td></td><td></td>
<td> siete</td><td> equ</td><td> Oeh</td><td></td><td></td>
<td> ocho</td><td> equ</td><td> Olh</td><td></td><td></td>
<td> nueve</td><td> equ</td><td> 09h</td><td></td><td></td>
<td> estrella equ</td><td> Odh</td><td></td><td></td><td></td>
<td> libra</td><td> equ</td><td> 03h</td><td></td><td></td>
.**««*********φφφφφφφφφφφφφφφφφφφ***************** ; Internal Ram variable definitions ,***«***;*******««**«****«*]It;******«*«:*«****:»#****«* ; Registers occupy bytes 00h-07h (reg. bank 0)
<td> ;r0</td><td> storage pointer (also address pointer for I/O expander)</td>
<td> ;rl</td><td> pointer to storage of data from TRU</td>
<td> ;r2</td><td> digit count</td>
<td> ;r3</td><td> delay loop for bus timer</td>
<td> ;r4</td><td> delay loop for bus timer</td>
<td> ;r5</td><td> used in rohtone timer</td>
<td> ;r6</td><td> used in send_timc</td>
<td> ;r7</td><td> used in rohtone timer</td>
; Variable storage locations
<td> time_offl</td><td> data</td><td> lOh</td><td> ;Measures off-hook time</td>
<td> time_off2</td><td> data</td><td> llh</td><td> ;Measures off-hook time</td>
<td> time_off3</td><td> data</td><td> 12h</td><td> ;Measures off-hook time</td>
<td> time_onl</td><td> data</td><td> 13h</td><td> ;Measures on-hook time</td>
<td> time_on2</td><td> data</td><td> I4h</td><td> ;Measures on-hook time</td>
<td> pulse_digit</td><td> data</td><td> 15h</td><td> ;Value of pulse dialed digit</td>
<td> in_use_off_</td><td> timer data</td><td> 16h</td><td> ;Checks for 2 sec after in use lamp</td>
; goes out to do cpd
<td> ring_timer data</td><td> 17h</td><td> ;Timer checks time between rings</td>
<td> bell_timer data</td><td> 18h</td><td> ;Timer generates 20hz for ringer</td>
<td> bell_timer2 data</td><td> 19h</td><td> ;Timer for ringer</td>
<td> gndstart_timerl data</td><td> lah</td><td> ;Releases GS line if no connect in Isec</td>
<td> gndstart_timer2 data</td><td> lbh</td><td> ;Same as above</td>
<td> ;highpoint data</td><td> lch</td><td> ;Stores dph for tone tables</td>
<td> ;lowpoint data</td><td> Idh</td><td> ;Stores dpi for tone tables</td>
<td> highpoint data</td><td> 35h</td><td> ;Stores dph for tone tables</td>
<td> lowpoint data</td><td> 36h</td><td> ;Stores dpi for tone tables</td>
<td> test_min data ;free</td><td> leh data lfh</td><td></td>
♦♦♦♦**♦♦♦*♦♦♦♦*♦♦♦♦♦♦♦♦*«י♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦*♦ »
; The Ram area 20h thru 29h is reserved for use by the main ; module either as data BYTEs or individual BITs .♦♦♦♦♦♦♦♦♦**♦♦♦♦♦♦♦♦**♦♦**♦♦»♦♦*♦♦♦**********♦***♦***♦****♦♦*****
<td> flags</td><td> DATA</td><td> 20h</td><td> ;This byte contains the following flags ; as individually addressable bits</td>
<td> fhook</td><td></td><td> bit</td><td> OOh ;Off hook flag set by coming off hook,</td>
<td></td><td></td><td></td><td> ; cleared when processed</td>
<td> fsend</td><td></td><td> bit</td><td> Olh ;Send flag</td>
<td> fflash</td><td></td><td> bit</td><td> 02h ;Flash flag</td>
<td> fhang</td><td></td><td> bit</td><td> 03h ;Hang up flag</td>
<td> ftime</td><td></td><td> bit</td><td> 04h ;40 second timer flag</td>
<td> fdigit</td><td></td><td> bit</td><td> 05h ;Flag for pulse dig input</td>
<td> fonhook</td><td> bit</td><td> 06h</td><td> ;On hook flag set 700msec</td>
<td></td><td></td><td></td><td> ;After hup, cleared by coming off-hook</td>
<td> fdtmfin</td><td> bit</td><td> 07h_.</td><td> t ;Dtmf input flag</td>
<td> inds</td><td> DATA</td><td> 21h</td><td> ;Indicators ־ this byte contains the</td>
<td></td><td></td><td></td><td> ; following bits:</td>
<td> roam</td><td></td><td> bit</td><td> 08h ;Roam indicator</td>
<td> noserv</td><td></td><td> bit</td><td> 09h ;No service indicator</td>
<td> lock</td><td></td><td> bit</td><td> Oah ;Lock indicator</td>
<td> rdis</td><td></td><td> bit</td><td> Obh ;Reset digit display</td>
<td> horn</td><td></td><td> bit</td><td> Och ;Horn indicator</td>
<td> f_init</td><td></td><td> bit</td><td> Odh ;Set by TRU only! (1 = inits done)</td>
<td> f_start</td><td></td><td> bit</td><td> Oeh ; 1 = onhook ints disabled for 500ms</td>
<td> test_enable</td><td> bit</td><td> Ofh</td><td> ; auto test</td>
<td></td><td></td><td></td><td> ; after first offhook to deglitch the</td>
<td></td><td></td><td></td><td> ; contact bounces</td>
<td> indasc</td><td> DATA</td><td> 22h</td><td> ;Indicators & audio switch control this</td>
<td></td><td></td><td></td><td> ; byte contains the following bits:</td>
<td> inuse</td><td></td><td> bit</td><td> lOh ;In use indicator</td>
<td> apl</td><td></td><td> bit</td><td> llh ;Audio path</td>
<td> ap2</td><td></td><td> bit</td><td> 12h ;Audio path</td>
<td> test end</td><td> bit</td><td> 13h</td><td></td>
<td> ;not_error bit</td><td> 14h</td><td> ; no error flag for self test</td>
<td> return_ring bit</td><td> 15h</td><td></td>
<td> error_flag bit ring_second bit</td><td> 16h 17h</td><td> ; self test error</td>
<td> io_status DATA</td><td> 23h</td><td> ; Bits 18h . Ifh</td>
<td> strobe</td><td> bit Ich</td><td></td>
<td> flags2</td><td> DATA 24h</td><td> ;Bits20h-27h</td>
<td> fdig ready bit</td><td> 20h</td><td> ;Digit ready flag</td>
<td> fanswer</td><td> bit 21h</td><td> ;Ring answer flag</td>
<td> fsendtimer bit</td><td> 22h</td><td> ;Flag to send after 4 seconds</td>
<td> f_inuseofftiming bit</td><td> 23h</td><td> ;Flag shows timer is running to check ; 2 sec with in use lamp off</td>
<td> funlocktimer bit</td><td> 24h</td><td> flag to unlock after 4 seconds</td>
<td> fdtone</td><td> bit 25h</td><td> ;Flag shows DT is on</td>
<td> fdecoder_busy</td><td> bit 26h</td><td> ;Flag shows dtmf decoder has not ; cleared yet</td>
<td> fbellsound bit</td><td> 27h</td><td> ;Rags ringer is sounding</td>
<td> pxl_temp DATA</td><td> 25h</td><td> ;Input/output buffer for port pxl . ; contains these bits:</td>
<td> mitelql</td><td> bit 28h</td><td> ;From dtmf decoder</td>
<td> mitelq2</td><td> bit 29h</td><td> ;From dtmf decoder</td>
<td> mitelq3</td><td> bit 2ah</td><td> ;From dtmf decoder</td>
<td> mitelq4</td><td> bit 2bh</td><td> ;From dtmf decoder</td>
<td> power_hold bit</td><td> 2ch</td><td> ;Maintain power after power failure to ;turn offTRU</td>
<td> spare 1</td><td> bit 2dh</td><td> ;Spare I/O pin</td>
<td> spare2</td><td> bit 2eh</td><td> ;Spare I/O pin</td>
<td> no_ring</td><td> bit 2fh</td><td> ;Spare I/O pin</td>
<td> px2_temp DATA</td><td> 26h'</td><td> ;I/O buffer for port px2 (30h - 37h)</td>
<td> 100pswitch_ bit</td><td> 30h</td><td> ;Low closes loop</td>
<td> ring_</td><td> bit 31h</td><td> ;Low turns on ring ps</td>
<td> mute</td><td> bit 32h</td><td> ;Mute rx audio</td>
<td> roh_boost bit</td><td> 33h</td><td> ;Increase gain for roh tone</td>
<td> sw_sendtimer</td><td> bit 34h</td><td> ;Jumper in gives 4 sec send option</td>
<td> sw_dialtone bit</td><td> 35h</td><td> Jumper in = diff dial tone for roam ; out means maintenance module</td>
<td> sw_gndstart bit</td><td> 36h</td><td> ;IN = loop start, OUT = groundstart</td>
<td> sw_data</td><td> bit 37h</td><td> Jumper in prevents, out allows digit ; data to TRU after send (to allow ; features from ceil, switch)</td>
<td> lamps_temp DATA</td><td> 27h</td><td> ;Contains these bits:</td>
<td> ;free</td><td> bit 38h</td><td> ;Not really lamps -- these store the</td>
<td> ;free</td><td> bit 39h</td><td> ; current status of indicators</td>
<td> ;free</td><td> bit 3ah</td><td></td>
<td> ;free roamlamp bit noservlamp bit locklamp bit</td><td> bit 3bh 3ch 3dh 3eh</td><td></td>
<td> inuselamp</td><td> bit</td><td colspan="3"> 3fh</td>
<td> flags3</td><td> DATA</td><td> 28h</td><td></td><td> ;More flags- this byte contains the ; following individually addressable ;bits</td>
<td> frohtimeout</td><td> bit</td><td> 40h</td><td></td><td> ;Set when rohtone has been on 1 minute</td>
<td> fcall</td><td></td><td> bit</td><td> 41h</td><td> ;Set when call incoming, clear if not</td>
<td> f_one_sec</td><td> bit</td><td> 42h</td><td></td><td> ;Set when off hook for one sec so ; change in inuse lamp won’t cause ; remote hangup if phone taken off ; hook quickly after local hangup</td>
<td> rohon</td><td></td><td> bit</td><td> 43h</td><td> ;Turns rohtone on & off</td>
<td> fspecl</td><td></td><td> bit</td><td> 44h</td><td> ׳ ;Flag for special use with specific TRU ; processed in update_displays every ; 71.1 ms, calls sped</td>
<td> fspec2</td><td></td><td> bit</td><td> 45h</td><td> ;Flag for special use with specific TRU ; processed in on- or off-hook timers ; every 277.8 usee, calls spec2</td>
<td colspan="2"> fremote_hup bit</td><td> 46h</td><td colspan="2"> :Indicates remote hup for 700 msec ; delay</td>
<td> flocktimer</td><td> bit</td><td> 47h</td><td></td><td> flag to lock after 2 seconds</td>
; Implemented TRU tasks ,♦»»»*»♦♦»»»»♦»♦♦♦♦»*♦♦»♦»»♦♦♦It»♦»»♦♦♦»»»«*♦*♦♦«♦♦#»»♦♦**»*»**»♦♦ >
f_cmds DATA 29h ; Optional TRU specific task numbers ; TRU tasks are for calls from the main into the TRU module.
; Task 1:
; a.) Power loss check for NEC 3700 (see naeOl) ; b.) Send change in hook switch status to OKI and also send initial CLR ; for the Motorola (see oee02 and mae04) ; c.) Call rdbus routine to read indicator status in the Audiovox TRUs ; (see taeOl and tbeOl) ; d.) Monitor for silent alert mode in Audiovox CTX-3100A and set ; silent alert mode if necessary (see tbeOl) .Task 2:
; a.) Dual NAM switching for NEC 3700 (see naeOl) ; Task 3:
; a.) Power loss check for NEC 3700 (see naeOl) ; b.) Send any change in hook switch status to OKI and Motorola ; (see mae04 and oee02) ; c.) Call rdbus routine to read indicator status in the Audiovox ; TRUs (see taeOl and tbeOl) ; d.) Monitor for silent alert mode in Audiovox CTX-3100A and set ; silent alert mode if necessary (see tbeOl) ; Task 4:
; a.) Call rdbus routine to read indicator status in the Audiovox ; TRUs (see taeOl and tbeOl) ; b.) Monitor for silent alert mode in Audiovox CTX-3100A and set ; silent alert mode if necessary (see tbeOl)
The Ram area 2Ah thru 2dh is reserved for use by the TRU modules either as DATA bytes or individual BIT variables.
<td> ;TRU</td><td> bitsl</td><td> data</td><td> 2ah</td><td></td><td> ;Bit 50h through 57h</td>
<td> ;TRU</td><td> _bits2</td><td> data</td><td> 2bh</td><td></td><td> ;Bit 58h through 5fh</td>
<td> ־,TRU</td><td> _bits3</td><td> data</td><td> 2ch</td><td></td><td> ;Bit 60h through 67h</td>
<td> ;TRU_</td><td> _bits4</td><td> data</td><td> 2dh</td><td></td><td> ;Bit 68h through 6fh</td>
<td> t ♦</td><td></td><td colspan="3"> Used for the maintanence board</td><td> ! check the tru routine !</td>
<td> i°_m_</td><td> _b</td><td></td><td> data</td><td> 2eh</td><td> ;Bit 70h through 77h</td>
<td> tdO</td><td></td><td></td><td> bit</td><td> 70h</td><td></td>
<td> tdl</td><td></td><td></td><td> bit</td><td> 71h</td><td></td>
;Bit 78h through 7fh
<td> td2</td><td> bit</td><td> 72h</td>
<td> td3</td><td> bit</td><td> 73h</td>
<td> dtmf_out bit</td><td> 74h</td><td></td>
<td> enable_test bit</td><td> 75h</td><td></td>
<td> enable_tone bit</td><td> 76h</td><td></td>
<td> enable_tone_in</td><td> bit</td><td> 77h</td>
<td> io_m_c</td><td> data</td><td> 2fh</td>
<td> ext_Jed</td><td> bit</td><td> 78h</td>
<td> enable_special</td><td> bit</td><td> 79h</td>
<td> enable_busy bit</td><td> 7ah</td><td></td>
<td> enable_16h bit</td><td> 7bh</td><td></td>
<td> conn_loop bit</td><td> 7ch</td><td></td>
*««*«*««**««««**««**«*« ««*««*««««««««*«*«««***«.*«*Φ************ ; More internal (BYTE addressable) ram variables ,*Φ«***«******«******«*****«**«*********************************Φ
<td> 100ptest_timer</td><td> data</td><td> 30h</td><td> ; Delays looptest for 2ms after loopsw</td>
<td> 100ptest__timer2 data</td><td> 31h</td><td></td><td> ; closes to allow SLIC to respond</td>
<td> display_delay</td><td> data</td><td> 32h</td><td> ; Delays display update to every 71.1ms</td>
<td> dsp_ptr</td><td> data</td><td> 33h</td><td> ; Handset LCD display buffer pointer</td>
<td> msg_ptr</td><td> data</td><td> 34h</td><td> ; TRU message buffer pointer</td>
.*«««*««*«***)*41«***« «*««*«*«***«*****«Φ«««««««**««****:*!**«***«**« ; The following bytes are reserved for the TRU modules for use ; only as DATA bytes (not BIT addressable)
<td> ;TRU_byteO data</td><td> 38h</td>
<td> ;TRU_bytel data</td><td> 39h</td>
<td> ;TRU_byte2 data</td><td> 3ah</td>
<td> ;TRU_byte3 data</td><td> 3bh</td>
<td> ;TRU_byte4 data</td><td> 3ch</td>
<td> ;TRU_byte5 data</td><td> 3dh</td>
<td> ;TRU_byte6 data</td><td> 3eh</td>
<td> ;TRU_byte7 data</td><td> 3fh</td>
; Stack occupies bytes 40h'5fh ; Digits dialed are stored in bytes from 60h to 7fh permitting ; a total of 32, including the SND code used as a terminator.
*
ז prefix data 60h ;Only [0] or [1] are valid,else FFh first_digit data 61h ; First three locations in the digit second_digit data 62h third_digit data 63h ; buffer (emergency numbers, area code ; start of 7digit number, etc.) .♦*******♦**♦*♦♦♦♦♦♦♦♦♦♦♦It«**♦♦»♦«♦♦»♦»»♦♦♦♦♦♦♦♦♦♦*♦♦♦♦♦♦**♦♦*♦♦* » ; 8051 portl & port3 bit definitions, (common to all units) >
<td> io_select bit</td><td colspan="3"> pl.2</td>
<td> dt_pwm</td><td> bit</td><td> pl.4</td><td> ; Dial tone pwm</td>
<td> twenty_hz_pwm</td><td> bit</td><td> pl.5</td><td> ; 20hz pwm for ringer</td>
<td> ;power_fail_bit</td><td> pl.6</td><td></td><td> ; Input, 0 = power supply is failing</td>
<td> lc_</td><td> bit</td><td> p3.2</td><td> ; Loop cunent sense, (ExtlntO)</td>
<td> ring^ground_</td><td> bit</td><td> p3.4</td><td> ; Input: shows ground on ring lead</td>
<td> ;strobe</td><td> bit</td><td> p3J</td><td> ; Input-.digit ready from DTMF</td>
<td></td><td></td><td></td><td> decoder</td>
<td> aO</td><td> bit</td><td> pl.6</td><td></td>
<td> al</td><td> bit</td><td> p35</td><td></td>
,**«**********************«♦*«**********«*««««**«**************** >
» ; Power up entry point, and interrupt routine vectors:
♦*♦♦♦**♦♦«»««««*«♦*«*«««*«*«*«««««««»*♦«**««*«*«נ««**««««»*«****«.
<td> org jmp</td><td> OOOOh init</td><td> ; Reset vector</td>
<td> org</td><td> 0003h</td><td> ; ExtlntO service vector</td>
<td> jmp</td><td> offhook_edge</td><td> ; Off hook, flash, & pulse dial</td>
<td> db</td><td> 0ffh,0ffh,0ffh,0ffh,0ffh;</td><td> Fill for Eprom and emulator</td>
<td> org</td><td> OOObh</td><td> ; TimerO (tlO) svc vector</td>
<td> jmp</td><td> onhook_timer</td><td> ; To keep track of how long on hook</td>
<td> db</td><td> 0ffh,0ffh,0ffh,0ffh,0ffh</td><td></td>
<td> org</td><td> 0013h</td><td> ; Extint 1 service vector</td>
<td> jmp</td><td> intl_service</td><td> ; Usually to read data from TRU</td>
<td> db</td><td> 0ffh,0ffh,0ffh,0ffh,0ffh</td><td></td>
<td> org</td><td> OOlbh</td><td> ; Timer 1 (thO) svc vector</td>
<td> jmp</td><td> offhook_timer</td><td> ; For periodic timer ints</td>
<td> db</td><td> 0ffh,0ffh,0ffh,0ffh,0ffh</td><td></td>
<td> org</td><td> 0023h</td><td> ; Serial port svc vector</td>
<td> jmp</td><td> ser_port_service</td><td> ; Usually to read data from TRU</td>
<td> db</td><td> 0ffh,0ffh,0ffh,0ffh,0ffh</td><td></td>
<td> org</td><td> 002bh</td><td> ; Timer2/ext2 svc vector</td>
<td> jmp</td><td> timer2_service</td><td></td>
<td> db</td><td> 0ffh,0ffh,0ffh,0ffh,0ffh</td><td></td>
<td> org</td><td> 0033h</td><td> ; PCA service vector</td>
jmp pca_service ; For pulse width modulators db db $include(main.msg) $include(tru.msg) ’ (c) Copyright Codecorn ’
׳ .1992׳
<td colspan="3"> init:</td>
<td colspan="2"> %set(intmask,O)</td><td> ; Normally two interrupt levels unless</td>
<td></td><td></td><td> ; intmask set to other than zero in ; TRUsection(TAE01.ASM:Audiovox)</td>
<td> mov</td><td> sp,#3fh</td><td> ; Stack starts at 40h</td>
<td> clr</td><td> rsO</td><td> ; Select register bank 0</td>
<td> clr</td><td> rsl</td><td> ; Ditto</td>
<td> mov</td><td> a,#0</td><td> ; To fill ram with zero</td>
<td> mov</td><td> r0,#0</td><td> ; Point to first ram</td>
<td> fill_ram:</td><td></td><td></td>
<td> mov</td><td> @rO,a</td><td> ; One location at a time</td>
<td> inc</td><td> rO</td><td> ; Point to next location</td>
<td> cjne</td><td> rO,#O,filI_ram</td><td> ; Fill up end of ram (FFh)</td>
<td> clr</td><td> pl.2</td><td></td>
<td> mov</td><td> rl.#main_flag</td><td></td>
<td> mov</td><td> @rl,#0</td><td> ; read second flag</td>
<td> inc</td><td> rl</td><td></td>
<td> mov</td><td> @rl,#0</td><td></td>
<td> inc</td><td> rl</td><td></td>
<td> mov</td><td> @rl,#0</td><td></td>
<td> inc</td><td> rl</td><td></td>
<td> mov</td><td> @d,#0</td><td></td>
<td> call</td><td> reset_io_m</td><td> ; reset the maintanence board</td>
<td> mov</td><td> io_m_b,#0</td><td> ; disable module</td>
<td> call</td><td> write_io_m_b</td><td></td>
<td> mov</td><td> io_m_c,#0</td><td> ; disable module</td>
<td> call</td><td> write_io_m_c</td><td></td>
<td> call</td><td> reset_io</td><td> ; reset i/0 expanded to #13</td>
<td> mov</td><td> p2,#0f8h</td><td> ; Set p2 to drive port expander</td>
<td> mov</td><td> pxl_temp,#llllllllb</td><td> ; Initialize including power_hold on</td>
<td> call</td><td> write_pxl</td><td></td>
<td> mov</td><td> px2_temp,#11110011b</td><td> ; Initialize: loopsw open, not ringing</td>
<td> call</td><td> write_px2</td><td></td>
<td> call</td><td> read_px2</td><td> ; Read option switches</td>
<td> mov</td><td> tmod,#0000001 lb</td><td> ; TimerO is two timers, and timed can ; be baud rate gen</td>
<td> mov</td><td> ip,#01001010b</td><td> ; Set int priorities</td>
<td> mov</td><td> ie,#11001011b</td><td> ; Enable PCA, Timed, TimerO, ExtO ; Tmr/Ext2,SerP0rt,Extl byTRU inits</td>
<td> setb</td><td> itfl</td><td> ; ExtlntO is edge trig’d</td>
<td> setb</td><td> itl</td><td> ; Extlntl is edge trig’d</td>
<td> mov</td><td> cmod,#80h</td><td> ; Counter off during idle, clock/12</td>
<td> mov</td><td> ch,#0</td><td> ; Load high counter</td>
<td> mov</td><td> cl,#0</td><td> ;Load low counter</td>
<td> mov</td><td> ccap01,#0ffh</td><td> ; Low byte for timer comparator</td>
<td> mov mov mov ccapml,#0 mov clr clr</td><td> ccap0h,#0 ccapm0,#049h ;PCA1; ccapm2,#0 tri trfl</td><td> ; High byte for timer comparator ; PCAO; software timer (Dial Tone) off for now ; PCA2 (20 hz pwm) is off now ; Off-hook int timer not running yet ; On-hook timer not running</td>
<td> ; Initialize byte variables</td><td colspan="2"></td>
<td> mov</td><td> time_onl,#0</td><td> ; Initialize onhook interrupt timers</td>
<td> mov</td><td> time_on2,#0</td><td></td>
<td> mov</td><td> time_offl,#0</td><td> ; Initialize offhook interrupt timers</td>
<td> mov</td><td> time_off2,#0</td><td></td>
<td> mov</td><td> time_off3,#0</td><td></td>
<td> mov</td><td> flags,#0</td><td> ; □ear all the flags</td>
<td> mov</td><td> flags2,#0</td><td> ; Clear all the flags</td>
<td> mov</td><td> flags3,#0</td><td> ; Clear all the flags</td>
<td> mov</td><td> inds,#Offh</td><td> ; Initial vals</td>
<td> mov</td><td> indasc,#Offh</td><td> ; Initial vals</td>
<td> mov</td><td> pulse_digit,#O</td><td> ; 0 = no pulse digit(s) available now</td>
<td> mov</td><td> f_cmds,#0</td><td> ; 0 = no TRU task commanded</td>
<td> ; Initialize bit variables</td><td colspan="2"></td>
<td> clr</td><td> test_enable</td><td></td>
<td> clr</td><td> test_end</td><td></td>
<td> clr</td><td> error_flag</td><td></td>
<td> dr</td><td> retum_ring</td><td></td>
<td> setb</td><td> fonhook</td><td> ; l=Assume phone on hook on</td>
<td> clr</td><td> f init</td><td> power up ; 0 = TRU init not completed yet</td>
<td colspan="2"> clr fremote hup</td><td></td>
<td> dr</td><td> fcali</td><td> ; 0 = No incoming call (ALERT) yet</td>
<td> call</td><td> clr_dsp</td><td> ; Gear handset LCD display buffer</td>
<td> call</td><td> clr_msg</td><td> ; Clear TRU messages buffer</td>
<td> call</td><td> specific_inits</td><td> ; Do TRU specific initializations</td>
<td> mov</td><td> ccap41,#0ffh</td><td> ; Low byte for watchdog match word</td>
<td> mov</td><td> ccap4h,#0ffh</td><td> : High byte for watchdog match word</td>
<td> mov</td><td> ccapm4,#48h</td><td> ; PCA4:Enable comparator&interrupt</td>
<td> orl</td><td> cmod,#40h</td><td> ; Enable watchdog timer</td>
<td> setb</td><td> cr</td><td> ; Start PCA counter</td>
<td> setb</td><td> trO</td><td> ; Start on hook timer</td>
; Wait 2.55 second for TRU to wake up. Clear the dialed digits location, ; then point RO to digits buffer start (60h), and clear R2 (dialed digits ; count).
time_wakeup: call mov cjne mov mov clr watchdog a,time_on2 ; Get elapsed time a,#255,time_wakeup ; Wait here 2.55sec for tru wakeup c,sw gndstart ; Check GS-LS jumper, 0=LS 1=GS loopswitch_,c ; Save start mode no_ring call write_px2 jmp start $include(tru.asm) ; TRU module here, so INTMASK can be ; evaluated at assembly time m*«******«M****«««*««m***«*«*MM*«M***«««***m*««******
Start, and Re-Entry point following hang up *************************************************************** start:
mov mov clr_digbuf:
mov inc cjne mov mov setb clr setb r0,#60h a,#Offh @rO,a rO r0,#80h,clr_digbuf r0,#60h r2,#0 f_start ieO exO ; Point to digit buffer start ; Fill with non-digits ; One location at a time ; Point to next location ; Through 7fh ; Point to buffer start ; Initialize digit count ; 1 = enable hook_switch deglitching ; Clear offhook int just in case ; Enable offhook int in case disabled ; Endless loop until we either detect an incoming call or we lift ; the handset to dial out.
hookchk:
<td></td><td> call</td><td> watchdog</td><td></td>
<td></td><td> jb</td><td> test_enable,do__test</td><td> ; if auto test activated</td>
<td></td><td> mov</td><td> f_cmds,#l</td><td> ; Load command ID</td>
<td> ♦</td><td> call</td><td> trucmd</td><td> ; Do taskl for TRU, if needed</td>
<td></td><td> jb</td><td> fhook,firstl</td><td> ;Brif off hook</td>
<td></td><td> jnb</td><td> fanswer,hookchk</td><td> ; Back if no incoming ring detected</td>
<td></td><td> jmp</td><td> ring_answer</td><td> ; Answer ring, we went off hook during</td>
<td></td><td></td><td></td><td> ; an ALERT (incoming call) state!</td>
<td> firstl:</td><td></td><td></td><td></td>
<td></td><td> jmp</td><td> first</td><td></td>
<td> do_test:</td><td></td><td></td><td></td>
<td> mov</td><td colspan="2"> rl,#main_flag_error</td>
<td> mov</td><td> @rl,#0</td><td> ; set the tone error busy or lOOOhz</td>
<td> mov</td><td> rl,#mainl_flag_error</td><td></td>
<td> mov</td><td> @rl,#0</td><td> ; set the tone error busy or lOOOhz</td>
<td> clr</td><td> test_end</td><td></td>
<td> clr</td><td> error_flag</td><td></td>
<td> clr</td><td> error_flag</td><td></td>
<td> mov</td><td> rl,#main_flag</td><td></td>
<td> mov</td><td> a,@rl</td><td> ; read first flag</td>
<td> anl</td><td> a,#00000001b</td><td> ; check if hook was done</td>
<td> call</td><td> start_hook_test</td><td> ; hook test</td>
test_hook:
<td> jb</td><td> error_flag,rou_error</td><td></td>
<td> call</td><td> dial_test</td><td> ; dial test</td>
<td> test_dial:</td><td></td><td></td>
<td> jb</td><td> error_flag,rou_error</td><td></td>
<td> call</td><td> start—dtmf</td><td> ; dtmf test</td>
<td> test_dtmf:</td><td></td><td></td>
<td> jb</td><td> error_flag,rou_error</td><td></td>
<td> call</td><td> start_ring_test</td><td> ; ring test</td>
<td> test__ring:</td><td></td><td></td>
<td> jb</td><td> error_flag,rou_error</td><td></td>
<td> call</td><td> start_ring_ans_test</td><td> : ring answer test</td>
<td> test_ring_a:</td><td></td><td></td>
<td> jb</td><td> error_flag,rou_error</td><td></td>
<td> call</td><td> make_call</td><td> ; call test</td>
<td> jb</td><td> error_flag,rou_error</td><td></td>
<td> jmp</td><td> until—fin_tim</td><td> ; exit without errors</td>
<td> rou_error:</td><td></td><td></td>
<td> call</td><td> error_acc</td><td> ; load error variable</td>
<td> ; jmp</td><td> wait—end</td><td></td>
<td> until_fin_tim:</td><td></td><td></td>
<td> setb</td><td> test end</td><td></td>
<td> clr</td><td> trO</td><td></td>
<td> mov</td><td> time—on2,#0</td><td> ;Every 10 msec while on hook</td>
<td> mov</td><td> time__onl,#0</td><td> ;Reset for next 36</td>
<td> mov</td><td> test—min,#0</td><td> ; 10 msec x 255 = .255 sec</td>
<td> setb</td><td> trO</td><td></td>
<td> wait_end:</td><td></td><td></td>
<td> call</td><td> watchdog</td><td> ; be here until 1 min expire</td>
<td> mov</td><td> a,test_min</td><td></td>
<td> cjne</td><td> a,#23,wait—end</td><td> ;.255x236 = 60.18</td>
<td> call</td><td> fin_self</td><td> ; return to normal</td>
<td> jmp</td><td> hookchk</td><td> ; return to normal</td>
;start—hook_test- start hook test
<td> start—hook_test:</td><td></td><td></td>
<td> mov</td><td> rl,#main_flag</td><td> ; read main flag</td>
<td> mov</td><td> a,@rl</td><td></td>
<td> orl</td><td> a,#00000001b</td><td></td>
<td> mov</td><td> @rl,a</td><td> ; set the off-hook flag</td>
<td> setb</td><td> enable_test</td><td> ;disconnect the telephone</td>
<td> clr</td><td> conn—loop</td><td></td>
<td> call</td><td> write—io_m_b</td><td> ; and connect module</td>
<td> call</td><td> reset—10—m</td><td> ; reset the maintanence board</td>
<td> call</td><td> write-i0—m_b</td><td></td>
<td> call</td><td> write_io_m_c</td><td></td>
<td> clr</td><td> loopswitch—</td><td> ;Other side has disconnected</td>
<td> call</td><td> write_px2</td><td></td>
<td> test—hup:</td><td></td><td></td>
<td> setb</td><td> fremote_hup</td><td></td>
<td> call</td><td> hup</td><td></td>
<td> •</td><td> mov call</td><td> lamps_temp,#O write_io_c</td><td> ; update the LEDS</td>
<td></td><td> mov</td><td> r6,#10</td><td></td>
<td></td><td> nose:</td><td></td><td></td>
<td></td><td> push</td><td> 6</td><td></td>
<td></td><td> mov</td><td> r6,#0ffh</td><td> ; delay module</td>
<td></td><td> 100p_m:</td><td></td><td></td>
<td></td><td> mov</td><td> r7,#0ffh</td><td></td>
<td></td><td> djnz</td><td> r7,$</td><td></td>
<td></td><td> call</td><td> watchdog</td><td></td>
<td></td><td> djnz</td><td> r6,100p_m</td><td></td>
<td> 100p_ma:</td><td> mov</td><td> r6,#0ffh</td><td> ; delay module</td>
<td></td><td> mov</td><td> r7,#Offh</td><td></td>
<td></td><td> djnz</td><td> r7,$</td><td></td>
<td></td><td> call</td><td> watchdog</td><td></td>
<td></td><td> djnz</td><td> r6,I00p_ma</td><td></td>
<td></td><td> mov</td><td> r6,#0ffh</td><td rowspan="2"> ; delay module</td>
<td rowspan="2"> 100p_mb:</td><td rowspan="2"> mov</td><td rowspan="2"> r7,#0ffh</td>
<td></td>
<td></td><td> djnz</td><td> r7,$</td><td></td>
<td></td><td> call</td><td> watchdog</td><td></td>
<td></td><td> djnz</td><td> r6,100p_mb</td><td></td>
<td></td><td> mov</td><td> r6,#0ffh</td><td rowspan="2"> ; delay module</td>
<td rowspan="2"> 100p_mc:</td><td rowspan="2"> mov</td><td rowspan="2"> r7,#Offh</td>
<td></td>
<td></td><td> djnz</td><td> r7,$</td><td></td>
<td></td><td> call</td><td> watchdog</td><td></td>
<td></td><td> djnz</td><td> r6,loop_me</td><td> t</td>
<td></td><td> pop</td><td> 6</td><td></td>
<td></td><td> djnz</td><td> r6,nose</td><td></td>
<td> test_hup2:</td><td> clr</td><td> fanswer</td><td></td>
<td></td><td> clr</td><td> fhook</td><td> ; Clear the flag</td>
<td> jnb</td><td> fhook,not_</td><td> _hook_det</td><td> ; no off-hook det. ok</td>
<td></td><td rowspan="2"> jmp</td><td></td><td> ; off-hook detected error</td>
<td></td><td> hook_error</td><td></td>
<td> not_hook_</td><td> det:</td><td></td><td> ; test off-hook</td>
<td></td><td> setb</td><td> fonhook</td><td></td>
<td></td><td> setb</td><td> conn_loop</td><td> ; present off hook to the</td>
<td></td><td> call</td><td> write_io_m_c</td><td> ; interface</td>
<td></td><td> mov</td><td> r6,#0ffh</td><td rowspan="2"> ; delay off hook</td>
<td colspan="2"> loop_m_off:</td><td></td>
<td></td><td> mov</td><td> r7,#Offh</td><td></td>
<td></td><td> djnz</td><td> r7,$</td><td></td>
<td></td><td> call</td><td> watchdog</td><td></td>
<td></td><td> djnz</td><td> r6,loop_m_off</td><td></td>
<td></td><td> mov</td><td> r6,#0ffh</td><td> ; delay off hook</td>
<td> 1οορ_π1__οίϊ2:</td><td colspan="2" rowspan="5"> r7,#0ffh r7,$ watchdog r6,loop_m_off2</td>
<td> mov</td>
<td> djnz</td>
<td> call</td>
<td> djnz</td>
<td> mov</td><td> r6,#0ffh</td><td> ; delay off hook</td>
<td> 100p_m_0ff3:</td><td colspan="2"></td>
<td> mov</td><td> r7,#0ffh</td><td></td>
<td> djnz</td><td> r7,$</td><td></td>
<td> call</td><td> watchdog</td><td></td>
<td> djnz</td><td> r6,loop_m_off3</td><td></td>
<td> mov</td><td> r6,#0ffh</td><td> ; delay off hook</td>
<td> 100p_m_0ff4:</td><td colspan="2"></td>
<td> mov</td><td> r7,#0ffh</td><td></td>
<td> djnz</td><td> r7,$</td><td></td>
<td> call</td><td> watchdog</td><td></td>
<td> djnz</td><td> r6,loop_m_off4</td><td></td>
<td> mov</td><td> r6,#0ffh</td><td> ; delay off hook</td>
<td> 100p_m_0ff5:</td><td colspan="2"></td>
<td> mov</td><td> r7,#0ffh</td><td></td>
<td> djnz</td><td> r7,$</td><td></td>
<td> call</td><td> watchdog</td><td></td>
<td> djnz</td><td> r6,loop_m_off5</td><td></td>
<td> test_fhook:</td><td colspan="2"></td>
<td> jb</td><td> fhook,detected_hook</td><td> ; if hook detected ok</td>
<td> jmp</td><td> hook error</td><td> ; not off-hook det error</td>
<td> detected_hook:</td><td colspan="2"></td>
<td> clr</td><td> exO</td><td> ; Disable offhook int til dial tone to</td>
<td> clr</td><td> hookswout</td><td> ; prevent dialing due to bounce ; Show off-hook to TRU</td>
<td> setb</td><td> hookswout_</td><td> ; Ditto</td>
<td> clr</td><td> fhook</td><td> ; Clear the flag</td>
<td> dt_delayl:</td><td colspan="2"></td>
<td> call</td><td> watchdog</td><td></td>
<td> jnb</td><td> lc_,still_off_hook</td><td></td>
<td> jmp</td><td> hook error</td><td> ; fail offhook</td>
<td> still_off_hook:</td><td colspan="2"></td>
<td> jb</td><td> f_start,dt_delayl</td><td> ; Will be set after 500ms deglitching</td>
<td> clr</td><td> ieO</td><td> : Gear offhook int flag just in case</td>
<td> setb</td><td> exO</td><td></td>
<td> setb</td><td> fdtone</td><td> ; 1 = the Dial Tone is on</td>
<td> call</td><td> dtone</td><td> ; Enable the Dial Tone</td>
<td> ret</td><td></td><td> : exit from hook test</td>
<td> hook_error:</td><td colspan="2"></td>
<td> mov</td><td> rl.#main_flag_error</td><td></td>
<td> mov</td><td> @rl,#l</td><td> ; hook slic error</td>
<td> setb</td><td> error_flag</td><td></td>
<td> ret</td><td colspan="2"></td>
<td colspan="3"> ;dial_test check the dial tone .*♦***♦♦♦♦♦***♦***»****««**»*»*»************«</td><td colspan="3"> It«**«</td>
<td> dial_test:</td><td> mov mov orl mov</td><td> rl,#main_flag a,@rl a,#00000010b @rl,a</td><td></td><td></td><td> ; read main flag ; set the dial tone flag</td>
<td> delay_dial:</td><td> mov mov djnz call djnz</td><td> r6,#0ffh r7,#Offh r7,$ watchdog r6,delay_dial</td><td></td><td></td><td> ; delay off hook</td>
<td> delay_dial2:</td><td> mov mov djnz call djnz</td><td> r6,#0ffh r7,#0ffh r7,$ watchdog r6,delay_dia!2</td><td></td><td></td><td> ; delay off hook</td>
<td> verify_dial: dial_ok:</td><td> clr mov mov setb call anl cjne call mov cjne mov mov setb ret ret</td><td> tri time_offl,#0 time_off2,#0 tri read_io_m_a a,#00000001b a,#00000001b,dial_ok watchdog a,time_off2 a,#10,verify_dial rl,#main_flag_error ׳ @rl?#3 error_flag</td><td colspan="3"> ; wait 711 msec to detect dial ; check dial tone ; if 0 dial ok ; dial is not detected ; wait 711 msecs if busy not detected ; dial tone fail ; dial error ; no error</td>
<td colspan="2"> ;start_dtmf - start the .*φ*φ**«**φ*#φφ«*«* ♦ start_dtmf: clr mov anl orl call call call call call test_cero: cjne</td><td colspan="2"> dtmf ***««>************************* fdtone ccapml,#0 io_m_b,#0f0h io_m_b,#cero send_dtmf delay_dtmf disabie_dtmf delay_dtmf get_test a, #Oh,d tmf_error_fl ag</td><td> ; verify 0</td><td> ; send 0</td>
<td> anl</td><td> 1o_m_b,#0f0h</td>
<td> orl</td><td> io_m_b,#uno ; send 1</td>
<td> call</td><td> send_dtmf</td>
<td> call</td><td> delay_dtmf</td>
<td> call</td><td> disable_dtmf</td>
<td> call</td><td> delay_dtmf</td>
<td> call</td><td> get_test</td>
<td> test_l:</td><td></td>
<td> qne</td><td> a,#lh,dtmf_error_flag : verify 1</td>
<td> anl</td><td> io_m_b,#0i0h</td>
<td> orl</td><td> io_m_b,#dos ; send 2</td>
call send_dtmf call delay_dtmf call disable_dtmf call delay_dtmf call get_test test_2:
<td></td><td> cjne</td><td> a,#2h,dtmf_error_flag</td><td> : verify 2</td>
<td></td><td> anl</td><td> io_m_b,#0f0h</td><td></td>
<td></td><td> orl</td><td> io_m_b,#tres</td><td> ; send 3</td>
<td></td><td> call</td><td> send_dtmf</td><td></td>
<td></td><td> call</td><td> delay_dtmf</td><td></td>
<td></td><td> call</td><td> disable_dtmf</td><td></td>
<td></td><td> call</td><td> delay_dtmf</td><td></td>
<td></td><td> call</td><td> get_test</td><td></td>
<td> test_3:</td><td></td><td></td><td></td>
<td></td><td> cjne</td><td> a,#3h,dtmf_error_flag</td><td> ; verify 3</td>
<td></td><td> anl</td><td> io_m_b,#0f0h</td><td></td>
<td></td><td> orl</td><td> io_m_b,#cuatro</td><td> ;send 4</td>
<td></td><td> call</td><td> send_dtmf</td><td></td>
<td></td><td> call</td><td> delay_dtmf</td><td></td>
<td></td><td> call</td><td> disable_dtmf</td><td></td>
<td></td><td> call</td><td> delay_dtmf</td><td></td>
<td></td><td> call</td><td> get_test</td><td></td>
<td> test_4:</td><td></td><td></td><td></td>
<td></td><td> cjne</td><td> a,#4h,dtmf_error_flag</td><td> ; verify 4</td>
jmp go_to_5 dtmf_error_flag:
jmp error_dtmf go_to_5:
anl io_m_b,#OfOh
<td> orl</td><td> io_m_b,#cinco</td><td> ; send 5</td>
<td> call</td><td> send_dtmf</td><td></td>
<td> call</td><td> delay_dtmf</td><td></td>
<td> call</td><td> disable_dtmf</td><td></td>
<td> call</td><td> delay_dtmf</td><td></td>
<td> call</td><td> get_test</td><td></td>
<td> test_5:</td><td></td><td></td>
<td> cjne</td><td> a,#5h,dtmf_error_flag</td><td> ; verify 5</td>
<td> anl</td><td> io_m_b,#0f0h</td><td></td>
<td> orl</td><td> io_m_b,#seis</td><td> ; send 6</td>
<td> call</td><td> send_dtmf</td><td></td>
<td> call</td><td> delay_dtmf</td><td></td>
<td> call</td><td> disable_dtmf</td><td></td>
<td> call</td><td> delay_dtmf</td><td></td>
<td> call</td><td> get_rest</td><td></td>
test_6:
cjne anl orl call call call call call test_7:
cjne anl orl call call call call call test_8:
cjne anl orl call call call call call test_9:
cjne anl orl call call call call call test_a:
cjne anl orl call call call call call test_b:
cjne jmp dtmf_error_flagl:
jmp go_to_c:
anl orl call call call a,#6h,dtmf_error_flag io_m_b,#0f0h io_m_b,#siete send_dtmf delay_dtmf disable_dtmf delay_dtmf get_test a,#7h,dtmf_error_flag io_m_b,#0f0h io_m_b,#ocho send_dtmf delay_dtmf disable_dtmf delay_dtmf get_test a,#8h,dtmf_error_flagl io_m_b,#0f0h io_m_b,#nueve send_dtmf delay_dtmf disable_dtmf delay_dtmf get_test a,#9h,dtmf_error_flagl io_m_b,#0f0h io_m_b,#05h send_dtmf delay_dtmf disable_dtmf delay _dtmf get_test a,#0ah,dtmf_error_flagl io_m_b,#0f0h io_m_b,#0dh send_dtmf de!ay_dtmf disable_dtmf delay_dtmf get—test a,#Obh,dtmf_error_flagl go_to_c error_dtmf io_m_b,#0f0h io_m_b,#03h send_dtmf delay_dtmf disable_dtmf ; verify 6 ; verify 7 ; verify 8 ; verify 9 ; receive a ; send 7 ; send 8 ; send 9 ; send a : es b
<td> call</td><td colspan="2" rowspan="2"> delay_dtmf get_test</td>
<td> call</td>
<td> test_c:</td><td colspan="2"></td>
<td> cjne</td><td> a,#Och,dtmf_error_flagl</td><td></td>
<td> anl</td><td> io_m_b,#0f0h</td><td></td>
<td> orl</td><td> io_m_b,#0bh</td><td> ;esd</td>
<td> call</td><td> send_dtmf</td><td></td>
<td> call</td><td> delay_dtmf</td><td></td>
<td> call</td><td> disable_dtmf</td><td></td>
<td> call</td><td> delay_dtmf</td><td></td>
<td> call</td><td> get_test</td><td></td>
<td> test_d:</td><td colspan="2"></td>
<td> cjne</td><td> a,#Odh,dtmf_enor_flagl</td><td></td>
<td> anl</td><td> io_m_b,#0f0h</td><td></td>
<td> orl</td><td> io_m_b,#07h</td><td> ;es7</td>
<td> call</td><td> send_dtmf</td><td></td>
<td> call</td><td> delay_dtmf</td><td></td>
<td> call</td><td> disable_dtmf</td><td></td>
<td> call</td><td> delay_dtmf</td><td></td>
<td> call</td><td> get_test</td><td></td>
<td> test_e:</td><td colspan="2"></td>
<td> cjne</td><td> a,#Oeh,dtmf_error_flagl</td><td></td>
<td> anl</td><td> io_m_b,#0f0h</td><td></td>
<td> orl</td><td> io_m_b,#0fh</td><td> ; es f</td>
<td> call</td><td> send_dtmf</td><td></td>
<td> call</td><td> delay_dtmf</td><td></td>
<td> call</td><td> disable_dtmf</td><td></td>
<td> call</td><td> delay_dtmf</td><td></td>
<td> call</td><td> get_test</td><td></td>
<td> test_f:</td><td colspan="2"></td>
<td> cjne</td><td> a,#Ofh,dtmf_error_flagl</td><td></td>
<td> ret</td><td></td><td> ; exit without errors</td>
<td> error_dtmf:</td><td colspan="2"></td>
<td> mov</td><td> rl,#jnain_flag_error</td><td rowspan="2"> ; dtmf error</td>
<td> mov</td><td> @rl,#4</td>
<td> setb</td><td> error_flag</td><td></td>
<td> ret</td><td colspan="2"></td>
<td colspan="2"></td><td></td>
<td colspan="2"> ;start_ring_test ־ start the ring test</td><td></td>
<td></td><td></td><td></td>
<td> start_ring_test:</td><td colspan="2"></td>
<td> mov</td><td> rl,#main_flag</td><td> ; init the ringing ; read main flag</td>
<td> mov</td><td> a,@rl</td><td></td>
<td> orl</td><td> a,#00001000b</td><td></td>
<td> mov</td><td> @rl,a</td><td> ; set the ring test flag</td>
<td> clr</td><td> ring_second</td><td rowspan="2"> ; present an on hook</td>
<td> clr</td><td> conn_loop</td>
<td> call</td><td> write_io_m c</td><td></td>
<td> setb</td><td> fremote_hup</td><td></td>
<td> call</td><td> hup</td><td></td>
<td> mov</td><td> r6,#6</td><td></td>
100p_ring_wait:
<td> push mov loop_mbb: mov djnz call djnz</td><td> 6 r6,#0ffh r7,#Offh r7,$ watchdog r6,100p_mbb</td><td> ; delay module</td>
<td> mov 100p_mcc: mov djnz call djnz</td><td> r6,#0ffh r7,#0ffh r7,$ watchdog r6,100p_mcc</td><td> ; delay module</td>
<td> pop djnz clr jb jmp loop_ring_off: clr mov mov setb wait_2_sec; call jnb jmp not_answer: call anl cjne mov cjne jmp</td><td colspan="2"> 6 r6,100p ring wait ; incoming call apl ; init an incoming cal lc_,loop_ring_off ringjlag ; loop here until ring start or trO ; 2 sec expire time_on2,#0 time onl,#0 trO watchdog fanswer,not_answer ring_flag ; answer occurred error read_io_m_a a,#00000100b a,#00000100b,ring_starts; if 0 ring started a,time_on2 ; check if 2 second expire a,#200,wait_2_sec : wait 2 sec to stop the dtmf ring_flag ; 2 sec expire, error</td>
<td> ring_starts: mov 100p_mbbc: mov djnz call djnz</td><td> r6,#0ffh r7,#0ffh r7,$ watchdog r6,loop_mbbc</td><td> : delay module</td>
<td> mov 100p_mccd: mov djnz call djnz</td><td> r6,#0ffh r7,#Offh r7,S watchdog r6,loop_mccd</td><td> ; delay module</td>
<td> ring_start: clr</td><td> trO</td><td> ; check for ring 1.3s continuity</td>
<td> mov</td><td colspan="2"> time_on2,#0</td>
<td> mov</td><td> time_onl,#0</td><td></td>
<td> setb</td><td> trO</td><td></td>
<td> wait_130msec:</td><td></td><td> ; check ring during 13 sec</td>
<td> call</td><td> watchdog</td><td></td>
<td> jnb</td><td> fanswer,not_answer 1</td><td></td>
<td> jmp</td><td> ring_flag</td><td> ; answer occured error</td>
<td> not_answerl:</td><td colspan="2"></td>
<td> call</td><td> read io m_a</td><td></td>
<td> test_130:</td><td colspan="2"></td>
<td> anl</td><td> a,#00000100b</td><td> ; should be low during 13 sec</td>
<td> cjne</td><td colspan="2"> a,#00000100b,ring_expire</td>
<td> jmp</td><td> ring_flag</td><td> ; ring fail within 13 sec</td>
<td> ring expire:</td><td colspan="2"></td>
<td> mov</td><td> a,time_on2</td><td></td>
<td> cjne</td><td> a,#90,wait_130msec</td><td> ; wait 130msec</td>
<td> wait_250msec:</td><td></td><td> ; the ring should stop after 1.5s</td>
<td> call</td><td> watchdog</td><td> ; but we will wait 2.5s to check if</td>
<td> call</td><td> read_io_m_a</td><td> ; it stop</td>
<td> test_250:</td><td colspan="2"></td>
<td> anl</td><td> a,#00000100b</td><td> ; should be low during .2 sec more</td>
<td> cjne</td><td> a,#00000100b,ring__not_</td><td> expire</td>
<td> test_stop:</td><td colspan="2"></td>
<td> jmp</td><td> ring_stop_</td><td> ;ring stop before 2.5s</td>
<td> ring_not_expire:</td><td colspan="2"></td>
<td> mov</td><td> a,time_on2</td><td> ; after 1.5 sec it should be high</td>
<td> cjne</td><td> a,#250,wait_250msec</td><td> ; wait 250msec</td>
<td> test_flag:</td><td colspan="2"></td>
<td> jmp</td><td> ring_flag</td><td> ; ring did not stop within 2.5s error</td>
<td> ring_stop_:</td><td></td><td> ; wait 2.55s</td>
<td> clr</td><td> trO</td><td></td>
<td> mov</td><td> time_on2,#0</td><td></td>
<td> mov</td><td> time_onl,#0</td><td></td>
<td> setb</td><td> trO -</td><td></td>
<td> wait_2_seca:</td><td colspan="2"></td>
<td> call</td><td> watchdog</td><td></td>
<td> jnb</td><td> fanswer,not_answer2</td><td></td>
<td> jmp</td><td> ring_flag</td><td> ; answer occurred error</td>
<td> not_answer2:</td><td colspan="2"></td>
<td> mov</td><td> a,time_on2</td><td></td>
<td> cjne</td><td> a,#255,wait_2_seca</td><td> ; wait 2.55s to stop the dtmf</td>
<td> jb</td><td> ring_second,ring_stop 1</td><td> ; second loop</td>
<td> setb</td><td> ring_second</td><td> ; check ring 2 times</td>
<td> jmp</td><td> loop ring off</td><td> ; start again</td>
<td> ring_flag:</td><td colspan="2"></td>
<td> setb</td><td> apl</td><td> ; clear incoming call</td>
<td> mov</td><td> rl,#main_flag_error</td><td></td>
<td> mov</td><td> @rl,#5</td><td> ; ring error</td>
<td> setb</td><td> error_flag</td><td></td>
<td> ring_stopl: test_timbre:</td><td colspan="2"></td>
<td> ret</td><td></td><td> ; exit without error</td>
.♦«*»«****»»*«»«♦♦***♦***♦***♦***♦***♦»»♦****»***♦ ;start_ring_ans_test - answer the ring
******««י««*«*»**»««♦«***♦«♦♦♦♦***«.♦♦*******♦*♦♦.
<td> start_ring_ans_test:</td><td colspan="2"> ; init the ringing</td>
<td> mov mov orl</td><td> rl,#main_flag a,@rl a,#00010000b</td><td> ; read main flag</td>
<td> mov loop ring 0ff2: clr mov mov setb wait_2_sec2: call</td><td> @rl,a trO time_on2,#0 time onl,#0 trO watchdog</td><td> ; set the ring test flag ; wait here until ring start again</td>
<td> \ jnb jmp not_answera: call anl</td><td> fanswer,not_answera ans_flag read_io_m_a a,#00000100b</td><td> ; if ring answer exit</td>
<td> cjne mov</td><td colspan="2"> a,#00000100b,ring_present; if cero ring present a,time_on2</td>
<td> cjne</td><td> a,#200,wait_2_sec2</td><td> ; wait 2 sec to stop</td>
<td> jmp ring_present:</td><td> ans_flag</td><td> ; 2 sec expire</td>
<td> setb call</td><td> connjoop write_io_m_c</td><td> ; answer the ring</td>
<td> mov wait_ans: mov djnz call djnz mov wait_ansa: mov djnz call djnz test_ans:</td><td> r7,#0ffh r6,#Offh r6,$ watchdog r7,wait_ans r7,#0ffh r6,#0ffh r6,$ watchdog r7,wait_ansa</td><td> ; delay to allow time to set fanswer</td>
<td> jb</td><td> fanswer,ok_ring</td><td> ; if answer, ring ans ok</td>
<td> jmp ans_flag: mov</td><td> ans_flag rl,#main_Jlag_error</td><td> ; didn’t answer error</td>
<td> mov setb setb clr ret</td><td> @rl,#6 error_flag apl fanswer</td><td> ; ring error</td>
ok_ring:
; exit without error timbre:
clr fanswer setb apl ; clear incoming call ret ;make_call . make a call to test the radio .****,***************«*******.*****«a**
<td colspan="3"> make call:</td>
<td> mov</td><td> rl,#mainl_flag</td><td> ; read mainl flag</td>
<td> mov</td><td> a,@rl</td><td></td>
<td> orl</td><td> a,#00000001b</td><td></td>
<td> mov</td><td> @rl,a</td><td> ; set the call test flag</td>
<td> test_mute:</td><td></td><td></td>
<td> jnb</td><td colspan="2"> power_,power_is_ok ; if radio ok line should be low(O)</td>
<td> mov</td><td> rl,#mainl_flag_error</td><td></td>
<td> mov</td><td> @rl,#l</td><td> ; set the power line error</td>
setb error_flag jmp pre_onhook power_is_ok:
<td> mov</td><td> a,#func</td><td> ; function to read the phone number</td>
<td> call</td><td> wrbus</td><td></td>
<td> mov</td><td> a,#7</td><td></td>
<td> call</td><td> wrbus</td><td></td>
<td> call</td><td> clr_dsp</td><td></td>
<td> mov</td><td> a,#star</td><td></td>
<td> call</td><td> wrbus</td><td></td>
<td> mov</td><td> r7,#0ffh</td><td> ; delay to allow time to send number</td>
<td> wait_min:</td><td></td><td> ; to interface</td>
<td> mov</td><td> r6,#0ffh</td><td></td>
<td> djnz</td><td> r6,$</td><td></td>
<td> call</td><td> watchdog</td><td></td>
<td> djnz</td><td> r7,wait__min</td><td></td>
<td> mov</td><td> r7,#Offh</td><td></td>
<td> wait_mina:</td><td></td><td></td>
<td> mov</td><td> r6,#0ffh</td><td></td>
<td> djnz</td><td> r6,$</td><td></td>
<td> call</td><td> watchdog</td><td></td>
<td> djnz</td><td> r7,wait_mina</td><td></td>
<td> mov</td><td> a,#9h</td><td></td>
<td> call</td><td> wrbus</td><td></td>
<td> mov</td><td> a,#0ah</td><td></td>
<td> call</td><td> wrbus</td><td></td>
<td></td><td></td><td> ; generate a call to its phone number</td>
<td> mov</td><td> a,#dspbuf_start</td><td> ; Get current pointer</td>
<td> add</td><td> a,#3</td><td></td>
<td> mov</td><td> rl,a</td><td></td>
<td> mov</td><td> a,@rl</td><td> ; Read msg in buffer</td>
<td> anl</td><td> a,#Ofh</td><td></td>
<td> call</td><td> wrbus</td><td></td>
<td> inc</td><td> rl</td><td></td>
<td> mov</td><td> a,@rl</td><td> ; Read msg in buffer</td>
<td> anl</td><td> a,#Ofh</td><td></td>
<td> call</td><td> wrbus</td><td></td>
<td> inc</td><td> rl</td><td></td>
<td> mov</td><td> a,@rl</td><td> ; Read msg in buffer</td>
<td> anl</td><td> a,#Ofh</td><td></td>
<td> call</td><td> wrbus</td><td></td>
<td> inc</td><td> rl</td><td></td>
<td> mov</td><td> a,@rl</td><td> ; Read msg in buffer</td>
<td> anl</td><td> a,#Ofh</td><td></td>
<td> call</td><td> wrbus</td><td></td>
<td> inc</td><td> rl</td><td></td>
<td> mov</td><td> a,@rl</td><td> ; Read msg in buffer</td>
<td> anl</td><td> a,#Ofh</td><td></td>
<td> call</td><td> wrbus</td><td></td>
<td> inc</td><td> rl</td><td></td>
<td> mov</td><td> a,@rl</td><td> ; Read msg in buffer</td>
<td> anl</td><td> a,#Ofh</td><td></td>
<td> call</td><td> wrbus</td><td></td>
<td> inc</td><td> rl</td><td></td>
<td> mov</td><td> a,@rl</td><td> ; Read msg in buffer</td>
<td> anl</td><td> a,#Ofh</td><td></td>
<td> call</td><td> wrbus</td><td></td>
<td> setb</td><td> fsend</td><td> ;Set send flag</td>
<td> mov</td><td> a,#send</td><td> ; make a call</td>
<td> call</td><td> wrbus</td><td></td>
<td> setb</td><td> enable_special</td><td> ; enable Q4</td>
<td> call</td><td> write io m c</td><td></td>
<td></td><td> AW</td><td></td>
<td> test_mutel:</td><td></td><td></td>
<td> clr</td><td> mute</td><td> ; do not mute</td>
<td> call</td><td> write_px2</td><td></td>
<td> clr</td><td> tri</td><td> ; delay to check inuse</td>
<td> mov</td><td> dme_offl,#0</td><td></td>
<td> mov</td><td> time off2,#0</td><td></td>
<td> setb</td><td> tri</td><td></td>
<td> delay_call:</td><td></td><td></td>
<td> mov</td><td> a,time_off2</td><td></td>
<td> call</td><td> watchdog</td><td></td>
<td> cjne</td><td> a,#8O,delay_call</td><td> ; wait 1 ?seconds</td>
<td> test_mute2:</td><td></td><td> ; test busy tone</td>
<td> clr</td><td> tri</td><td></td>
<td> mov</td><td> time_offl,#0</td><td></td>
<td> mov</td><td> time_off2,#0</td><td></td>
<td> mov</td><td> time otf3,#0</td><td></td>
<td> setb</td><td> tri</td><td></td>
<td> cont_waiting:</td><td></td><td></td>
<td> jnb</td><td> inuse,still_inuse</td><td></td>
<td colspan="2" rowspan="2"> mov mov jmp still_inuse: call</td><td colspan="2"> rl,#mainl_flag_error</td>
<td rowspan="2"> @rl,#4 call_error read_io_m_a a,#00000001b a,#00000001b,busy_ok</td><td rowspan="2"> ; set the inuse error ; if iube disapear set error ; check dial tone ; if 0 busy ok</td>
<td></td><td> anl cjne</td>
<td></td><td> call anl cjne</td><td> read_io_m_a a,#00001000b a,#00001000b,tlOOOhz</td><td> ; check dial tone ; if lOOOkhz busy ok</td>
<td colspan="2"> mov call qne mov mov call_error: mov call setb jmp tlOOOhz: busy_ok: mov call pre_onhook: clr call call ret</td><td> a,time_off3 watchdog a,#lh,cont_waiting rl,#mainl flag error @rl,#3 a,#endl wrbus error_flag pre_onhook a,#endl wrbus conn_loop write_io_m_b hup</td><td> ; busy is not detected ; wait 18.2 secs if busy not detected ; set the tone error busy or lOOOhz ; make a call : present and on hook ; 950 hz . llOOhz tone detected ;400hz- 620hz tone detected ; make a call : present and on-hook ; and connect module</td>
<td colspan="4"> .«**φφφφφφφφίφφφφφφφφφφφφφφφφφφφφφφφφφφφφφφφφφφφφφ</td>
<td colspan="4"> ;error_acc ־ set the error code ></td>
<td> error_acc: check_hook check_dial_ check_dtmf</td><td> mov mov cjne mov mov jmp _ring: cjne mov mov jmp flag: cjne mov mov jmp Jlag: cjne mov mov</td><td> rl,#main_flag_error a,@rl a,# l,check_hook_ring rl,#error_code @rl,#l exit_error a,#2,check_dial_flag rl,#error_code @rl,#2 exit_error a,#3,check_dtmf_flag rl,#error_code @rl,#3 exit_error a,#4,check_ring_flag rl,#error_code @rl,#4</td><td> ; hook slic error ; hook ring error ; dial error ; dtmf error</td>
<td> jmp</td><td> exit_error</td>
<td> check_ring_flag:</td><td></td>
<td> cjne</td><td> a,#5,check_ring_ans_flag</td>
<td> mov</td><td> rl,#error_code ; ring detection error</td>
<td> mov</td><td> @rl,#5</td>
<td> jmp</td><td> exit_error</td>
<td> check_ring_ans_flag:</td><td></td>
<td> cjne</td><td> a,#6,check_power_flag</td>
<td> mov</td><td> rl,#error_code ; ring answer error</td>
<td> mov</td><td> @rl,#6</td>
<td> jmp</td><td> exit_error</td>
<td> check_power_flag:</td><td> ; check calls flag</td>
<td> mov</td><td> rl,#mainl_flag_error</td>
<td> mov</td><td> a,@rl</td>
<td> cjne</td><td> a,# l,check_call_test</td>
<td> mov</td><td> rl,#error_code ; power radio error</td>
<td> mov</td><td> @rl,#7</td>
<td> jmp</td><td> exit_error</td>
<td> check_call_test:</td><td></td>
<td> cjne</td><td> a,#2,check_busy_test</td>
<td> mov</td><td> rl,#error_code ; xxx error</td>
<td> mov</td><td> @rl,#8</td>
<td> jmp</td><td> exit_error</td>
<td> check_busy_test:</td><td></td>
<td> cjne</td><td> a,#3,check_inuse_test</td>
<td> mov</td><td> rl,#error_code ; busy tone error</td>
<td> mov</td><td> @rl,#9</td>
<td> jmp</td><td> exjt_error</td>
<td> check_inuse_test:</td><td></td>
<td> cjne</td><td> a,#4,check_1000_test</td>
<td> mov</td><td> rl,#error_code ; inuse error</td>
<td> mov</td><td> @rl,#10</td>
<td> jmp</td><td> exit_error</td>
<td> check_1000_test:</td><td></td>
<td> cjne</td><td> a,#5,exit_error</td>
<td> mov</td><td> rl,#error_code ; lOOOhz tone error</td>
<td> mov</td><td> @rl,#U</td>
<td> jmp</td><td> exit_error</td>
<td> exit_error: ret</td><td></td>
<td colspan="2"> .***««««««*«***«««***«***************************</td>
<td colspan="2"> ;fin self - return to normal</td>
<td> ג********************.</td><td> t«**«**««*****«««*****««****</td>
<td> fin_self:</td><td></td>
<td> clr</td><td> conn_loop ; present on hook to the</td>
<td> call</td><td> write_io_m_c ; interface</td>
<td> call</td><td> hup</td>
<td> clr</td><td> enable_test ; connect the the telephone</td>
<td> call</td><td> write_io_m_b ; and disconnect module</td>
<td> clr</td><td> test_enable ; init maint test</td>
<td> clr</td><td> test_end ; finish test</td>
<td> clr</td><td> error_flag ; error flag</td>
<td> jnb</td><td> error_flag,turn_on_led</td>
<td> clr</td><td> ext_Ied ; turn off external led while testing</td>
<td> turn_</td><td colspan="2"> call call on_led: setb call ־ call</td><td> write_io_m_c loop__bad ext_led write io_m c loop_bad</td><td> ־, turn on/off the external led ; turn off external led while testing ; turn on/off the external led</td>
<td></td><td></td><td> clr call call</td><td> ext_led write_io_m_c 100p_bad</td><td> ; turn off external led while testing ; turn on/off the external led</td>
<td></td><td></td><td> setb call call</td><td> ext_led write_io_m_c loop_bad</td><td> ; turn off external led while testing ; turn on/off the external led</td>
<td></td><td></td><td> clr call call</td><td> ext_led write_io_m_c 100p__bad</td><td> ; turn off external led while testing ; turn on/off the external led</td>
<td></td><td></td><td> setb call call</td><td> ext_led write_io_m_c 100p_bad</td><td> ; turn off external led while testing ; turn on/off the external led</td>
<td> test_</td><td> 40n:</td><td> dr call call</td><td> ext_led write_io_m_c 100p_bad</td><td> ; turn off external led while testing ; turn on/off the external led</td>
<td></td><td></td><td> ret</td><td></td><td></td>
<td> loop. wait־</td><td> _bad: _emb:</td><td> mov mov djnz call djnz</td><td> r7,#Offh r6,#0ffh r6,$ watchdog r7,wait_emb</td><td> ; delay to allow time to set fanswer</td>
<td> wait.</td><td> _emba:</td><td> mov mov djnz call djnz</td><td> r7,#0ffh r6,#0ffh r6,$ watchdog r7,wait_emba</td><td></td>
ret ; Get here when we lifted the handset to dial.
first:
<td> call</td><td> clr_msg</td><td> ; Clear previous TRU messages</td>
<td> clr</td><td> exO</td><td> : Disable offhook int til dial tone to</td>
<td></td><td></td><td> ; prevent dialing due to bounce</td>
<td> clr</td><td> hookswout</td><td> ; Show off-hook to TRU</td>
<td> setb</td><td> hookswout</td><td> ; Ditto</td>
<td> dt_delay: test_lc:</td><td> clr call mov call jb clr</td><td> fhook watchdog f_cmds,#4 trucmd f_start,dt_delay ieO</td><td> ; Clear the flag ;NOTE:INTO & TIMERO have been suspended ; at this point - do not use any tru ; specific function which relies on ; these interrupts. ; Perform any TRU specific commands ; Will be set after 500ms deglitching ; Clear offhook int flag just in case</td>
<td></td><td> jnb</td><td> lc_,alert_check</td><td> ; Brif still off hook after 500ms</td>
<td> test_lcl:</td><td> call jmp</td><td> hup start</td><td> ; Phone put back on hook < 500 msec</td>
<td colspan="2"> alert_check: setb jb inuse, make_dt jmp</td><td colspan="2"> exO ; Reenable offhook int (DT is on now) ; Brif not INUSE, we are ready to dial wait ; If already INUSE probably answered ; an incoming call by coming offhook</td>
; We are off hook for 500ms lets generate a dial tone.
<td> make_dt:</td><td rowspan="8"> fdtone dtone get inuse,check_prefix fdtone ccapml,#0 wait_ <sub>E</sub></td><td rowspan="8"> ; 1 = the Dial Tone is on ; Enable the Dial Tone ; Get a character or exit if hang up</td>
<td> setb</td>
<td> call</td>
<td> call</td>
<td> jb</td>
<td> clr</td>
<td> mov</td>
<td> jmp</td>
<td> check_prefix:</td><td colspan="2"></td>
<td> jb</td><td> lock,prefix_0</td><td> ; Brif TRU isn’t locked</td>
<td> cjne</td><td> a,#pound,nosend</td><td> ; Brif locked, only # (unlock) is valid</td>
<td> prefix_0:</td><td colspan="2"></td>
<td> cjne</td><td> a,#zero,prefix_l</td><td> ; Brif not a [0]</td>
<td> jmp</td><td> store_it</td><td> ; Go to store [0] as prefix</td>
<td> prefix_l:</td><td colspan="2"></td>
<td> cjne</td><td> a,#l,no_prefix</td><td> ; Brif not a [1] either</td>
<td> jmp</td><td> store_it</td><td> ; Go to store [1] as prefix</td>
<td> no_prefix:</td><td colspan="2"></td>
<td> inc</td><td> rO</td><td> ; Leave prefix slot unchanged (FFh)</td>
<td> inc</td><td> r2</td><td> ; But up the digit count</td>
<td colspan="3"> ; Store current digit and get another one until time to send them out.</td>
<td> store_it:</td><td colspan="2"></td>
<td> cjne</td><td> r0,#7fh,do_store_it</td><td> ; Brif digit buffer is not full yet</td>
<td> jmp</td><td> check number</td><td> ; Brif buffer is full, w/0 storing</td>
<td> do_store_it:</td><td colspan="2"></td>
<td> mov</td><td> @r0,a</td><td> ; Store the digit</td>
inc rO ; Advance digit buffer pointer ; Check the entered digits and analyze them for valid sequences.
<td> check_</td><td> number:</td><td></td><td></td>
<td></td><td> clr</td><td> fsendtimer</td><td> : Assure it is off</td>
<td></td><td> mov</td><td> a,first_digit</td><td> ; Point to 1st digit slot</td>
<td></td><td> cjne</td><td> a,#Offh,check_one</td><td> ; Brif first digit entered</td>
<td></td><td> jmp</td><td> check_send</td><td> ; Else check if time to send</td>
<td> check_</td><td> _one:</td><td></td><td></td>
<td></td><td> cjne</td><td> a,#pound,check_send</td><td> ; Brif not [#] (lock, unlock, etc.)</td>
<td></td><td> mov</td><td> a,second_digit</td><td> ; Point to 2nd digit if first is [#]</td>
<td></td><td> cjne</td><td> a,#Offh,check_two</td><td> ; Brif second digit entered</td>
<td></td><td> jmp</td><td> check_send</td><td> ; Else check if time to send</td>
<td> check_</td><td> _two:</td><td></td><td></td>
<td></td><td> cjne</td><td> a,#pound,check_nam</td><td> ; Brif not [#][#] (lock or unlock)</td>
<td></td><td> mov</td><td> a,third_digit</td><td> ; Two #’s might be lock or unlock</td>
<td></td><td> cjne</td><td> a,#pound,check_unlock</td><td> ; Three #’s mean locking</td>
<td></td><td> jnb</td><td> lock,nosend</td><td> ; Do not lock if already locked</td>
<td></td><td> jmp</td><td> 10ck_it</td><td> ; [#][#](#] means locking</td>
<td> check_</td><td> _nam:</td><td></td><td></td>
<td></td><td> cjne</td><td> a,#star,check_send</td><td> ; Abort if not [#][*] sequence</td>
<td></td><td> mov</td><td> a,third_digit</td><td> ; Else get the third digit also</td>
<td></td><td> cjne</td><td> a,#Offh,check_nam 1</td><td> ; Brif third digit entered</td>
<td></td><td> jmp</td><td> check—send</td><td> ; Else check if time to send</td>
<td> check</td><td> _naml:</td><td></td><td></td>
<td></td><td> mov</td><td> f_cmds,#2</td><td> ; Load function number, then go to</td>
<td></td><td> call</td><td> trucmd</td><td> ; Switch to alternate NAM</td>
; Abort on invalid number (dial) sequences.
nosend: dr funlocktimer setb fonhook setb ieO jmp start check_unlock: cjne a,#Offh,unlocking_it jmp check_send unlocking_it: setb fiinlocktimer jmp get_next ; Turn off unlock timer # sign set it ; As if on hook ; Go to ExtlntO service ; just like off hook again ; Brif any digit was dialed after ## ; Else go to check if time to send ; Will send after 2sec w/0 SND code ־, to avoid unlock code being sent like ; a valid number ; Get here if the digit sequence entered did not qualify as any ; of the special function (lock, unlock, dual NAM, etc) options.
<td> check_send: jb setb jmp</td><td> sw_sendtimer,check_intl ; Brif sw7=l, interntnl calls enabled fsendtimer ; Enable sending after 4 sec if sw7=0 get_next ; And back for next digit</td>
<td> check_intl;</td><td rowspan="7"> a,prefix a,#zero,check_op ajirst_digit a,#l,check_op fsendtimer get_next</td><td rowspan="7"> ; Test for prefix in acc ; Brif not [0] ; Else get the first real digit ; Brif not [1], may be operator call ; International call! Starts with 01-. ; Back for more, only timer sends now!</td>
<td> mov</td>
<td> cjne</td>
<td> mov</td>
<td> cjne</td>
<td> setb</td>
<td> jmp</td>
<td> check_op:</td><td colspan="2"></td>
<td> mov</td><td> a,prefix</td><td> ; Get prefix digit again</td>
<td> cjne</td><td> a,# 10,check_service</td><td> ; Brif prefix is not 0</td>
<td> cjne</td><td> r2,#0,check_service</td><td> ; Brif digit(s) also were dialed</td>
<td> setb</td><td> fsendtimer</td><td> ; Else it may be a call to operator</td>
<td> check_service:</td><td colspan="2"></td>
<td> cjne</td><td> r2,#3,check_distance</td><td> ; Brif not 3 digits</td>
<td> mov</td><td> a,second_digit</td><td> ; Else if emergency, inform, etc.</td>
<td> cjne</td><td> a,#l,check_distance</td><td> ; Brif second digit is 1</td>
<td> mov</td><td> a,third_digit</td><td> ; Get third digit</td>
<td> cjne</td><td> a,# l,check_distance</td><td> ; Brif third digit is not 1</td>
<td> jmp</td><td> send_it</td><td> ; It must be an emerg., send it</td>
<td> check_distance:</td><td colspan="2"></td>
<td> cjne</td><td> r2,# 10,check_local</td><td> ; Ten digit was dialed?</td>
<td> jmp</td><td> send_it</td><td> ; Send on 10th unless international</td>
<td> checklocal:</td><td colspan="2"></td>
<td> cjne</td><td> r2,#7,get_next</td><td> : Brif less then seven digit was dialed</td>
<td> setb</td><td> fsendtimer</td><td> ; Prepare to send in 4 sec</td>
<td> mov</td><td> a,second_digit</td><td> ; Get 2nd digit</td>
<td> subb</td><td> a,#l</td><td> ; Isit a #1 ?</td>
<td> jz</td><td> get_next</td><td> ; Brif so, could be area code, or local</td>
<td> mov</td><td> a,second_digit</td><td> ; Get 2nd digit again</td>
<td> subb</td><td> a,#10</td><td> ; Is it a 0 ?</td>
<td> jz</td><td> get^next</td><td> ; Brif so, maybe area code, maybe local</td>
<td> clr</td><td> fsendtimer</td><td> ; Don’t want another, send 5sec later</td>
<td> jmp</td><td> send_it</td><td></td>
<td> get_next:</td><td colspan="2"></td>
<td> inc</td><td> r2</td><td></td>
<td> call</td><td> get</td><td> ;Get a new digit</td>
<td> jmp</td><td> store_it</td><td> ;Do all the checks with the new digit</td>
» ; Dialing done, send the number out ♦♦♦♦4♦♦♦♦**♦♦♦♦♦ *♦♦♦*♦ ♦*♦*♦*. 1 ; Check if the TRU is locked, and abort if no unlock code was entered.
send_it:
jb lock.sendl ; Brif TRU is not locked locked:
mov a,third_digit ; Get third digit
<td></td><td> cjne jmp</td><td> a,#Offh,sendl nosend</td><td> ; Brif any digit entered : Don’t send if no unlock code entered</td>
<td colspan="2"> ; Send dialed digit, sendl:</td><td></td><td></td>
<td></td><td> setb</td><td> mute</td><td> ;Mute rx audio</td>
<td></td><td> call</td><td> write_px2</td><td></td>
<td></td><td> mov</td><td> @rO,#send</td><td> ;Put send at end of digits</td>
<td></td><td> mov</td><td> a,#clear</td><td> ;Clear code</td>
<td></td><td> call</td><td> wrbus</td><td> ;Put clear code first to clear any ; digits from TRU memory in case ; handset has entered some first</td>
<td></td><td> mov</td><td> r0,#60h</td><td> ;Reset pointer to show storage</td>
<td></td><td> mov</td><td> a,@rO</td><td> ;Put prefix in acc</td>
<td></td><td> cjne</td><td> a,#0ffh,out</td><td></td>
<td></td><td> inc</td><td> rO</td><td> ;Skip prefix if it is ff</td>
<td> out:</td><td> mov</td><td> a,@rO</td><td></td>
<td></td><td> call</td><td> wrbus</td><td> ;Write to the bus</td>
<td> test_lc2:</td><td> jnb</td><td> fhang,send_ok</td><td></td>
<td></td><td> call</td><td> hup</td><td> Abort dump if hangup</td>
<td> send_ok:</td><td> jmp</td><td> start</td><td></td>
<td></td><td> inc</td><td> rO</td><td></td>
<td></td><td> cjne</td><td> a,#send,out</td><td> ;Keep on til SND code</td>
<td></td><td> setb</td><td> fsend</td><td> ;Set send flag</td>
<td></td><td> clr</td><td> mute</td><td> ;Unmute rx audio</td>
<td></td><td> call</td><td> write_px2</td><td></td>
; Dialing done, conditionally echo digit to TRU, then wait for ; further possible digits (extension, etc.), or let the interrupts
<td> ; take over the show.</td><td> .--</td><td></td>
<td> wait: call</td><td> get</td><td> ;Check for any digits from MJ phone</td>
<td> jnb</td><td> sw_data,wait</td><td> ;Discard if data after snd is disabled</td>
<td> call</td><td> wrbus</td><td> ;Else send data to TRU</td>
<td> jmp</td><td> wait</td><td> ;Loop til we or other party hangs up</td>
,******«««*«»»*««»«***»««««««*****««»*««**».*»*««*
Dial Tone Generator .ΦΦΦΦ4>ΦΦ4***Φ*********«ΦΦΦ**ΦΦ*******4>«********ΦΦΦ ; This routine selects and generates the proper dial tone, ; corresponding to our current (roam, holler, etc) status.
<td> dtone:</td><td> push</td><td> psw</td><td></td>
<td></td><td> jb</td><td> 10ck,serv_check</td><td></td>
<td></td><td> mov</td><td> dptr,#table_350</td><td> ; 350 hz for lock</td>
<td></td><td> jmp</td><td> tone_out</td><td></td>
serv check:
<td> jb mov jmp</td><td> noserv,roam_check dptr,#table_620 tone_out</td><td> ;620 hz tone for no־serv</td>
<td> roamcheck:</td><td></td><td></td>
<td> jb</td><td> sw_dialtone,normal</td><td> .Jf option sw is closed (=0) make a ; diff dial tone for roam</td>
<td> jb</td><td> roam,normal</td><td></td>
<td> mov</td><td> dptr,#table_roam</td><td> ;440-620 hz for roam</td>
<td> jmp</td><td> tone_out</td><td></td>
<td> normal: mov dptr,#table tone_out:</td><td> _dt</td><td> (440 hz (normal DT־350;</td>
<td> mov</td><td> lowpoint,dpl</td><td> ;Remember where the table starts</td>
<td> mov</td><td> highpoint,dph</td><td></td>
<td> mov</td><td> ccapml,#01000010b</td><td> ;Enable the tone</td>
<td colspan="3"> pop psw ret .*****************************************«*******</td>
; Get a digit from the handset keypad
*****»*»***»»»»****»*»**»***»»**»**«נ»******»»****.
» ; This routine processes the digit input and/or process flags.
; On return - returns data in acc
<td> get:</td><td></td><td></td><td></td>
<td></td><td> push</td><td> psw</td><td></td>
<td> getl:</td><td></td><td></td><td></td>
<td></td><td> mov</td><td> f_cmds,#3</td><td> ;Flag indicates which functions apply</td>
<td></td><td> call</td><td> trucmd</td><td> ;Perform any TRU specific commands</td>
<td></td><td> call</td><td> watchdog</td><td></td>
; Wait for a pulse. If the pulse was not flagged as a pulse dial input ; by ΕΧΊΊΝΤ0 (Off_Hook_Service), we check for a DTMF digit input. If it ; was a pulse dial input then we continue counting pulses, until 250 ms ; has passed after receiving the last pulse. At that point we consider ; assembling the pulse dial digit completed, so we copy it into the acc, ; and set the fdig_ready flag.
<td colspan="3"> get_pulse:</td>
<td> jnb</td><td> fdigit,get_dtmf</td><td></td>
<td> clr</td><td> fdtone</td><td> ;Clear dial tone flag</td>
<td> mov</td><td> ccapml,#0</td><td> ;Turn off dial tone</td>
<td> mov</td><td> a,#2</td><td> ;If there was an input</td>
<td> clr</td><td> c</td><td> ;Clear carry for subtraction</td>
<td> subb</td><td> a,time_0ff2</td><td> ;See if 2133 msec (3x71.1 ms) passed</td>
<td> jnc</td><td> get_dtmf</td><td> ;If not yet, then digit not complete</td>
<td> mov</td><td> a,# 131</td><td></td>
<td> clr</td><td> c</td><td> ;Clear carry for subtraction</td>
<td> subb</td><td> a,time_offl</td><td> ;See if additional 36.7 msec</td>
<td></td><td></td><td> ; (132x277.8 usee) has passed (total</td>
<td></td><td></td><td> ; time of 250 msec)</td>
<td> jnc</td><td> get_dtmf</td><td> ;If not yet, then digit not complete</td>
<td> mov</td><td> a,pulse_digit</td><td> ;Put digit in a</td>
<td> mov</td><td> pulse_digit,#0</td><td> ;Clear for next dig</td>
<td> setb</td><td> fdig_ready</td><td> ;To show a digit ready</td>
clr fdigit ;Clear the flag ; If a DTMF dial digit is ready, copy it into the acc. Check for special ; conditions, flash, hang up etc. Branch on special conditions, or continue ; checking for more pulse(s), and/or completed digits.
get_dtmf: jnb clr mov dr mov anl setb fdtmfin,hang fdtone ccapml,#0 fdtmfin a,pxl_temp a,#0fh fdig_ready ;Clear dial tone flag ;Turn off dial tone ;Clear dtmf input flag ;Put digit in acc ;Keep only tow 4 bits ;To show a digit ready ; Check for hangup (pulse > 700ms).
<td> hang: test_lc3:</td><td> jnb pop</td><td> fhang,gflash psw</td><td> ;If no hang up</td>
<td></td><td> call</td><td> hup</td><td></td>
<td></td><td> dec</td><td> sp</td><td> ;Correct stack pointer</td>
<td></td><td> dec</td><td> sp</td><td> ;Leaving subrout without ret</td>
<td></td><td> jnb</td><td> fremote_hup,no_remote</td><td> ; Brif no remote hup occured</td>
clr fremote_hup no_remote:
<td> jmp start</td><td></td><td> ; Exit, somebody hung up</td>
<td> ; Check for flash (200 <</td><td> pulse < 700ms).</td><td></td>
<td> gflash: jnb fflash,time</td><td> ;If no flash</td><td></td>
<td> clr</td><td> (flash</td><td> ;Clear flash flag</td>
<td> mov</td><td> ccapml,#0</td><td> ;Turn off dial tone</td>
<td> jb</td><td> fdtone,just_flash</td><td> ;If dial tone on just a send for last</td>
<td></td><td></td><td> ; number redial</td>
<td> jb</td><td> fsend,just_flash</td><td> ;If send flag is set don’t put digits,</td>
<td></td><td></td><td> ; just a send</td>
<td> clr</td><td> fdtone</td><td> ;Clear dial tone flag</td>
<td> pop</td><td> psw</td><td></td>
<td> dec</td><td> sp</td><td> ;Correct stack pointer</td>
<td> dec</td><td> sp</td><td> ;Leaving subrout without ret</td>
<td> jmp</td><td> scnd_it</td><td> ;Output all digits + send</td>
; Transmit only a SEND code, but not the digits, if ; either the Dial Tone or the Send flag is high.
just_flash: clr mov call mov call setb POP dec fdtone f_cmds,#5 trucmd a,#send wrbus fsend psw sp ;Clear dial tone flag ;Send code ;Send flag ; Restore flags ;Correct stack pointer
<td> dec jmp</td><td> sp wait</td><td> ; Back for digit(s), hangup etc.</td>
<td colspan="3"> ; If we did not dial a complete phone number yet, and 40 second passed</td>
<td colspan="2"> ; since the last key punch, then we start a 1 minute holler tone.</td><td></td>
<td> time: jnb</td><td> ftime,send_time</td><td> ;If no timeout</td>
<td> pop</td><td> psw</td><td></td>
<td> dec</td><td> sp</td><td> ;Correct the stack pointr</td>
<td> dec</td><td> sp</td><td> ;Leaving subrout without ret</td>
<td> jmp</td><td> rohtone</td><td> ;Then no rohtone</td>
<td colspan="2"> ; Check if it time to send (4 sec expired since last key.)</td><td></td>
<td> send_time:</td><td></td><td></td>
<td> jnb</td><td> fsendtimer,unlock time</td><td></td>
<td> mov</td><td colspan="2"> r6,time 0ff2 ;71.1 ms timer in r6</td>
<td> cjne</td><td> r6,#56,unlock_time ;Check for</td><td> 4 sec (56x71.1ms = 3.98sec)</td>
<td> clr</td><td> fsendtimer</td><td></td>
<td> pop</td><td> psw</td><td></td>
<td> dec</td><td> sp</td><td> ;Correct stack pointer</td>
<td> dec</td><td> sp</td><td> ;Leaving subrout without ret</td>
<td> jmp</td><td> send_it</td><td> ;Output digits and send</td>
<td colspan="2"> ; Check if unlock was requested.</td><td></td>
<td> unlock_time:</td><td></td><td></td>
<td> jnb</td><td> funlocktimer,10ck_time</td><td></td>
<td> mov</td><td colspan="2"> r6,time 0ff2 ;71.4 ms timer in r6</td>
<td> cjne</td><td> r6,#28,look ;Check for</td><td> (28 x 71.4 ms =) 2sec</td>
<td> clr</td><td> funlocktimer</td><td></td>
<td> pop</td><td> psw</td><td></td>
<td> dec</td><td> sp</td><td> ;Correct stack pointer</td>
<td> dec</td><td> sp</td><td> ;Leaving subrout without ret</td>
<td> jb</td><td> lock,no_unlock</td><td> ; Do not unlock, if already unlocked</td>
<td> jmp</td><td> unlock_it</td><td></td>
<td> no_unlock:</td><td></td><td></td>
<td> setb</td><td> fonhook</td><td> ;As if on hook</td>
<td> setb</td><td> ieO</td><td> ;Go to ExtlntO service</td>
<td> jmp</td><td> start</td><td> Just like off hook again</td>
;Flocktimer added to allow lock to timeout on less than 4 digits. Go_lock ;label must be added to TRU and also setting of flocktimer (if necessary).
lock time:
<td> jnb</td><td> flocktimer,look</td><td> ; Brif not</td>
<td> mov</td><td> r6,time_off2</td><td> ; 71.4 ms timer in r6</td>
<td> cjne</td><td> r6,#28,100k</td><td> ; Check for (28*71.4ms = 2 sec)</td>
<td> clr</td><td> flocktimer</td><td></td>
<td> Pop</td><td> psw</td><td></td>
<td> dec</td><td> sp</td><td> ; Correct SP</td>
<td> dec</td><td> sp</td><td></td>
<td> jmp</td><td> go_lock</td><td></td>
; Check if we got a (complete) digit.
look: jb jmp getl fdig_ready,got_a__digit ;Look again if no digit in ; We got a digit (pulse or DTMF), return it in the acc.
got_a_digit:
clr got_inuse:
mov mov mov pop ret fdig_ready time_offl,#0 time_off2,#0 time_off3,#0 psw ;Clear the digit ready flag ; Restart timers on every digit input <sub>(</sub>*m****«**m***mM««**H**«*****M*****«**m ; Get a digit from the handset keypad »
; This routine processes the digit input and/or process flags.
; On return ־ returns data in acc get_test:
push psw ; If a DTMF dial digit is ready, copy it into the acc. Check for special ; conditions, flash, hang up etc. Branch on special conditions, or continue ; checking for more pulse(s), and/or completed digits.
get_dtmf_test: jnb clr mov clr mov anl setb no_dtmf_test: clr mov mov mov pop ret fdtmfin,no_dtmf_test fdtone ccapml,#0 fdtmfin a,pxl_temp a,#Ofh fdig_ready fdig_ready time_offl,#0 time_off2,#0 time_off3,#0 psw ;Clear dial tone flag ;Turn off dial tone ;Gear dtmf input flag ;Put digit in acc ;Keep only low 4 bits ;To show a digit ready ;Clear the digit ready flag ; Restart timers on every digit input >
;send_dtmf - send a dial tone send_dtmf:
<td> call</td><td> watchdog</td><td></td>
<td> clr</td><td> dtmf_out</td><td> ; enable the dtmf tone</td>
<td> call</td><td> write_io_m_b</td><td></td>
<td> setb</td><td> dtmf_out</td><td> ; enable the dtmf tone</td>
<td> call</td><td> write_io_m_b</td><td></td>
ret *****♦♦*******♦**♦*»**♦♦♦♦**♦♦♦*♦♦»♦♦*«****»*♦*♦*****»»**************♦ clr_dtmf - send a dial tone
*י**********»**«***««♦«*♦♦*♦*«»«♦««♦«♦**«♦♦♦♦*♦*♦♦»*♦♦*♦♦*♦♦♦*♦*♦**♦♦**
<td> disable dtmf:</td><td></td><td></td>
<td> clr</td><td> dtmf_out</td><td> ; enable the dtmf tone</td>
<td> call</td><td> write_io_m_b</td><td></td>
<td> ret</td><td></td><td></td>
<td> delay_dtmf:</td><td></td><td> ; delay the DTMF tone</td>
<td> dr</td><td> tri</td><td></td>
<td> mov</td><td> time_off2,#0</td><td></td>
<td> mov</td><td> time_offl,#0</td><td></td>
<td> setb</td><td> tri</td><td></td>
<td> wait_until_dtmf:</td><td></td><td></td>
<td> mov</td><td> a,time_off2</td><td></td>
<td> call</td><td> watchdog</td><td></td>
<td> cjne</td><td> a,#4,wait_until_dtmf</td><td> ; wait 40 msec to stop the dtmf</td>
ret .*+♦*******♦*♦***»****♦♦*»»*♦♦»♦**»♦*»»**.**.*****
<td colspan="2"> ; ROH tone generator » ,**m*mm*m«*«***m>mmm*H«***« »</td><td> *******</td>
<td colspan="3"> ; 40 sec has passed after we lifted the handset w/0 dialing any digits, ; or since we have dialed the last digit. We shall generate an ROH tone ; (interrupted at 80 msec intervals) for 1 minute or until we hang_up,</td>
<td> ; whichever happens first.</td><td></td><td></td>
<td> rohtone:</td><td></td><td></td>
<td> clr</td><td> ftime</td><td> ; Clear the flag</td>
<td> clr</td><td> fdtone</td><td> ; Clear dial tone flag so changes in ; indicators won’t change roh tone</td>
<td> mov</td><td> dptr,#table_400</td><td></td>
<td> mov</td><td> highpoint.dph</td><td> ; Remember table location</td>
<td> mov</td><td> lowpoint,dpi</td><td></td>
<td> setb</td><td> roh_boost</td><td> ; Boost the audio</td>
<td> call</td><td> write_px2</td><td></td>
<td> rohtone_on:</td><td></td><td></td>
<td> mov</td><td> ccapml,#01000010b</td><td> ; Turn on the tone</td>
; Loop here for 1 minute, or until hang_up.
<td> check_hangup: call jnb</td><td> watchdog fhang,check_timeout</td><td> ; Refresh watchdog while waiting here ; Brif still off hook</td>
<td> test_lc4: call</td><td> hup</td><td> ; Do orderly hang up if back on hook</td>
<td> jmp</td><td> start</td><td> ; Brand new start</td>
<td> check timeout: jb</td><td> frohtimeout,roh_timeout</td><td> ; Brif ROH timed out (after 1 minute)</td>
<td> jb</td><td> roh_on,rohtone_on</td><td></td>
<td> mov</td><td> ccapml,#0</td><td> : Turn off the tone</td>
<td> jmp</td><td> check_hangup</td><td> ; This loop toggles roh on and off</td>
<td> roh_timeout:</td><td></td><td></td>
<td> mov</td><td> ccapml,#0</td><td> ; Turn off the tone</td>
<td> clr</td><td> roh_boost</td><td> ; Unboost the audio</td>
<td> setb</td><td> loopswitch_</td><td> ; Open the loop</td>
<td> call</td><td> write_px2</td><td> ; Out to the port</td>
<td> test_lc5:</td><td></td><td></td>
<td> call</td><td> hup</td><td> ; Do hang up routine</td>
<td> jnb</td><td> sw_gndstart,looptest</td><td> ; Do loop test if loop start</td>
<td> jmp</td><td> 100ptest_end</td><td> ; No loop test if ground start, just</td>
<td></td><td></td><td> ; leave loop open til ring ground</td>
; Get here if we are in Loopstart mode.
<td> looptest:</td><td> mov</td><td> b,#40</td><td> ; Set up 2 sec delay (40 x 50 ms)</td>
<td> looptl:</td><td> mov</td><td> a,time_on2</td><td> ; Get current onhook time</td>
<td></td><td> add</td><td> a,#5</td><td> ; Add 50ms to present time</td>
<td> looptZ:</td><td> call</td><td> watchdog</td><td> ; Refresh watchdog</td>
<td></td><td> cjne</td><td> a,time_on2,loopt2</td><td> ; Minor delay is 50 ms</td>
<td></td><td> djnz</td><td> b,looptl</td><td> ; Wait 2 sec total</td>
<td></td><td> clr</td><td> loopswitch—</td><td> ; Close loop in every 2sec to check</td>
<td></td><td> call</td><td> write_px2</td><td> ; if phone was put back on hook</td>
<td></td><td> mov</td><td> 100ptest_timer2,#215</td><td> ; Load 2.22mscc delay (8x277.8 usee)</td>
<td> 100pt3:</td><td> mov</td><td> looptest_timer,#Offh</td><td> ; To allow enough time for the SLIC</td>
<td></td><td> djnz</td><td> 100ptest_timer,$</td><td> ; chip to indicate the hook status</td>
<td></td><td> call</td><td> watchdog</td><td> ; Refresh watchdog</td>
<td></td><td> djnz</td><td> Iooptest_timer2,loopt3</td><td></td>
<td></td><td> jb</td><td> lc_,100ptest_end</td><td> ; Brif no loop cunent (back on hook)</td>
<td></td><td> setb</td><td> 100pswitch_</td><td> ; Open loop switch again</td>
<td></td><td> call</td><td> write_px2</td><td></td>
<td></td><td> jmp</td><td> looptest</td><td> ; Wait here until hung up</td>
looptestend:
<td> clr</td><td> frohtimeout</td><td> ; 0 = has been hung up, or in GS mode</td>
<td> mov</td><td> time_onl,#0</td><td> ; Reset on hook timers</td>
<td> mov</td><td> time_on2,#0</td><td></td>
<td> jmp</td><td> start</td><td> ; Start new</td>
***********************************♦***♦♦♦*♦*****
Subroutine for hang up
***»*****»*»*****»«נ**»»»****»***»»******»»***»»»*
*
<td> hup:</td><td> call</td><td> watchdog</td><td></td>
<td></td><td> clr</td><td> exO</td><td> ;Disable ExtlntO (offhook, LC_)</td>
<td></td><td> clr</td><td> fdigit</td><td> ;In case hangup while pulse dialing</td>
<td></td><td> mov</td><td> pulse_digit,#O</td><td> ;In case hup during pulse digit input</td>
<td></td><td> clr</td><td> fdig_ready</td><td> ;In case hup during pulse/dtmf input</td>
<td></td><td> clr</td><td> fdtmfin</td><td> ;In case hup during dtmf digit input</td>
<td></td><td> clr</td><td> flocktimer</td><td> ;In case hup during locking</td>
<td></td><td> clr</td><td> funlocktimer</td><td> ;In case hup during unlocking</td>
<td></td><td> jnb</td><td> swjgndstartjiupl</td><td> ; Brif loopstart</td>
<td></td><td> setb</td><td> 100pswitch_</td><td> ;Open loopsw for 750ms if groundstart</td>
<td></td><td> call</td><td> write_px2</td><td> ; to simulate hup</td>
<td></td><td> mov</td><td> a,time__on2</td><td> ;Ines every 10 ms</td>
<td></td><td> add</td><td> a,#75</td><td> ;For 750 ms delay</td>
<td></td><td> push</td><td> acc</td><td> ;Store for later</td>
<td></td><td> jmp</td><td> hup2</td><td></td>
<td> hupl:</td><td> jb</td><td> frohtimeout,hup2</td><td></td>
<td></td><td> clr</td><td> 100pswitch_</td><td> ;If loopstart</td>
<td></td><td> call</td><td> write_px2</td><td></td>
<td> hup2:</td><td> clr</td><td> ftime</td><td> ;Clear timer flag</td>
<td></td><td> clr</td><td> fsendtimer</td><td> ;Clear send timer flag</td>
<td></td><td> mov</td><td> ccapml,#0</td><td> ;Make sure dtone is off</td>
<td></td><td> clr</td><td> fdtone</td><td> ;Clear the dial tone flag</td>
<td></td><td> clr</td><td> roh_boost</td><td> ;Normal audio</td>
<td></td><td> call</td><td> write_px2</td><td></td>
<td></td><td> jb</td><td> fremote_hup,no_end_</td><td> _sent ;No end code if remote hup, since it</td>
<td></td><td></td><td></td><td> ; isn’t needed and clears the buffer ; on the Motorola unnecessarily.</td>
<td></td><td> mov</td><td> a,#endcall</td><td> ;Put end code</td>
<td></td><td> call</td><td> wrbus</td><td rowspan="2"> ; Send it to TRU first, then reset flag</td>
<td> no_end_</td><td> _sent:</td><td></td>
<td></td><td> clr</td><td> fsend</td><td> ;in case digits sent or alert answered</td>
<td></td><td> setb</td><td> hookswout</td><td> ;Show on hook to TRU</td>
<td></td><td> clr</td><td> hookswout__</td><td> ;Ditto</td>
<td></td><td> jnb</td><td> sw_gndstart,hup4</td><td> ;Don’t do timing if loop start</td>
<td></td><td> pop</td><td> acc</td><td> ;Get delay time back</td>
<td></td><td> clr</td><td> c</td><td> ־,Clear carry flag for next</td>
<td> hup3:</td><td> call</td><td> watchdog</td><td></td>
<td></td><td> cjne</td><td> a,time_on2,$+3</td><td> ;Wait 750 ms to allow loop to open ; and pbx to see it as disconnect. ; jmp to next instruction in any case</td>
<td></td><td> jnc</td><td> hup3</td><td> ;No carry til time_on2 greaterthan acc</td>
<td></td><td></td><td></td><td> ; (in case bus write took more than ; 750 ms)</td>
<td> hup4:</td><td> setb</td><td> fonhook</td><td> ;Set on-hook flag</td>
<td></td><td> clr</td><td> fhang</td><td> ;Clear hang-up flag</td>
<td></td><td> clr</td><td> f_one_sec</td><td> ;So timer can start again when off hook</td>
clr setb ret f_inuseofftiming ;Reset flag exO ;Enable extintO (offhook)
*****»*»**»****»*»**»**»*****»»*»*********»*»»»»«ג.
» ; TRU status update ; Routine updates TRU status every 71.4 ms, and turns ringer ; on and off. Also checks for 3.9 second interval after a ring.
<td colspan="3"> update_displays:</td>
<td> push</td><td> acc</td><td></td>
<td> push</td><td> psw</td><td></td>
<td> upspecl:</td><td colspan="2"></td>
<td> jnb</td><td> fspecl,continue_update</td><td> ;Check special flag</td>
<td> call</td><td> sped</td><td> ;Special routine in TRU section</td>
<td> continue_update:</td><td colspan="2"></td>
<td> jb</td><td> test_enable,go_to_self</td><td> ; check if test started</td>
<td> mov</td><td> a,lamps_temp</td><td> ;Hold values for comparison later</td>
<td> mov</td><td> c,roam</td><td></td>
<td> cpl</td><td> c</td><td> ; No real lamps for the Maxjack!</td>
<td> mov</td><td> roamlamp,c</td><td> ;Roam indicator Gust for storage)</td>
<td> mov</td><td> c,noserv</td><td></td>
<td> cpl</td><td> c</td><td></td>
<td> mov</td><td> noservlamp.c</td><td> ;Noserv indicator Gust for storage)</td>
<td> mov</td><td> c,10ck</td><td></td>
<td> cpl</td><td> c</td><td></td>
<td> mov</td><td> locklamp.c</td><td> ;Lock indicator Gust for storage)</td>
<td> mov</td><td> c,inuse</td><td></td>
<td> cpl</td><td> c</td><td></td>
<td> mov</td><td> inuselamp,c</td><td> ;Inuse indicator Gust for storage)</td>
<td> call</td><td> write_io_c</td><td> ., update the LEDS</td>
<td> jb</td><td> sw_dialtone,not_maint</td><td> ;If option sw is out (=1)</td>
<td> test_push:</td><td> f</td><td> ; not maintenance module</td>
<td> call</td><td> read_io_m_a</td><td> ; read push button</td>
<td> anl</td><td> a,#00010000b</td><td></td>
<td> cjne</td><td> a,#Oh,not_push</td><td></td>
<td> setb</td><td> test enable</td><td> ; init maint test</td>
<td> setb fremote_hup</td><td colspan="2"> ; set remote hup for 700ms</td>
<td> setb</td><td> 100pswitch_</td><td> ;Other side has disconnected</td>
<td> call</td><td> write_px2</td><td></td>
<td> not_push:</td><td colspan="2"></td>
<td> jnb</td><td> test enablejiot maint</td><td> ; check if test started</td>
<td> go_to_self:</td><td colspan="2"></td>
<td> jnb</td><td colspan="2"> test_end,not_error_yet; if error was found</td>
<td> jnb</td><td> error_flag,pass_ok</td><td></td>
<td> test_led:</td><td colspan="2"></td>
<td> mov</td><td> rO,#error_code</td><td></td>
<td> mov</td><td> a,@r0</td><td></td>
<td> rl</td><td> a</td><td></td>
<td> rl</td><td> a</td><td></td>
<td> rl</td><td> a</td><td></td>
<td> rl</td><td> a</td><td></td>
<td> mov</td><td> lamps_temp,a</td><td></td>
<td> call</td><td> write_io_c</td><td> ; update the LEDS</td>
<td> setb jmp pass_ok: clr jmp not_error_yet: jb setb jmp clr led: clr write_to_c: call notmaint: mov</td><td> ext_led write_to_c ext_led write_to_c ext_led,clr_led ext_led write_to_c ext_led write_io_m_c a,lamps_temp</td><td> ; turn on external led 1 minute ; turn on external led 1 minute ; turn on external led while testing ; turn off external led while testing • ; turn on/off the external led ;Hold values for comparison later</td>
<td colspan="2"> jb frohtimeout,compare mov c,ap2 anl c/apl jnc compare jnb fonhook,compare clr loopswitch_ call write_px2 jb fcalljeset_ring_timer setb fcall mov bell_timer,#O mov bell_timer2,#0 setb fbellsound mov dptr,#table_20 mov lowpoint,dpi mov highpoint.dph setb twenty_hz_pwm mov ccapm2,#01000010b testl: 0 clr ring_ setb no_ring call write_px2 reset ring timer: mov ring_timer,#O compare: xrl a,lamps_temp jnb f_one_sec,dtbits mov c,acc.7 anl c^inuselamp jnc timing_in_use_off mov in_use_off_timer,#28 setb f_inuseofftiming timing_in_use_off: jnb inuselamp, cont_in_use_ clr f_inuseofftiming cont_in_use_timing: jnb f_inuscofftiming,dtbits</td><td> ; Check we are in ALERT state, ; (i.e.: incoming call waiting) ; Brif not ALERT (no incoming call) ; Brif off hook, don’t ring bell! ; Close loop switch if ALERT state, ; (incoming call is waiting) ; Brif ringing is already in progress ; 1 = start ringing (ALERT detected) ; Reset timers ;Flag bell sounding ;Point to 20 hz table for ring ; Save ringer table starts ;So pin can be pwm ;Enable pwm ;Turn on ring ps ;Out to port ;Reset between-rings timer as long as ; we are in ALERT state ;Bits that differ will be = 1 ;Wait 1 sec after off hook before ; looking at inuse lamp, prevents ; disconnect if offhook soon after hup ; Get INUSE status ; 1 = not INUSE ;Start timer if INUSE lamp just turned ;off ;Reset timer for 1.99 sec(28 x 71.1 ms) ;Show in use off timer is working now Jiming ;If inuse lamp still off ;Otherwise clear flag and stop timing ;Continue timing if flag is set</td>
djnz in_use_off_timer,dtbits ;When timer hits 1.99 sec, disconnect clr finuseofftiming ;Clear flag jb fonhook,dtbits ;If local hangup don’t do remote hangup ; We get here if the other party hang-up and we did not put the phone ; back on hook within 2 seconds.
<td colspan="3"> disconnect:</td>
<td> setb fremote_hup</td><td colspan="2"> ; set remote hup for 700ms</td>
<td> setb</td><td> 100pswitch_</td><td> ;Other side has disconnected</td>
<td> call</td><td> write_px2</td><td></td>
<td> dtbits:</td><td colspan="2"></td>
<td> anl</td><td> a,#01110000b</td><td> Just check bits that affect dial tone</td>
<td> jz</td><td> ringtimeout</td><td> ;If nothing chgd</td>
<td> jnb</td><td> fdtonejing timeout</td><td> ;Or if DT not on already</td>
<td> mov</td><td> ccapml,#0</td><td> ;Turn off current DT</td>
<td> call</td><td> dtone</td><td> ;Change to new dial tone</td>
<td> ring_timeout:</td><td colspan="2"></td>
<td> jnb</td><td> fcall,update_done</td><td> ;Don’t time ring if no incoming call</td>
<td> inc</td><td> ring timer</td><td> ;Every 71.1 msec</td>
<td> mov</td><td> a,#53</td><td> ;54 x 71.1 ms= 3.84 sec</td>
<td> clr</td><td> c</td><td> ;Clear carry for subtraction</td>
<td> subb</td><td> a,ring_timer</td><td></td>
<td> jnc</td><td> update_done</td><td> ;If not at least 3.84 sec with no ring</td>
<td> jb</td><td> fbellsound,update_done</td><td> ;Also wait til not sounding ring</td>
<td> check_stop_ring__ps:</td><td colspan="2"></td>
<td> mov</td><td> a,#3</td><td> ;4 x 25 ms = 100 ms</td>
<td> clr</td><td> c</td><td> ;Ready to do subtract</td>
<td> subb</td><td> a,bell_timer2</td><td></td>
<td> jnc</td><td> update_done</td><td> ;When carry, 100 ms</td>
<td> jb</td><td> ring_,check_stop_null</td><td> ;Brif ring PS is already turned off</td>
<td> setb</td><td> ring_</td><td> ;Else turn off ring PS now</td>
<td> call</td><td> write_j)x2</td><td> ;Out to port</td>
<td> clr</td><td> no_ring</td><td></td>
<td> call</td><td> write_px2</td><td> ;Out to port</td>
<td> check_stop_null:</td><td colspan="2"></td>
<td> mov</td><td> a,#7</td><td> ;8 x 25 ms = 200 ms</td>
<td> clr</td><td> c</td><td> ;Ready to do subtract</td>
<td> subb</td><td> a,bell_timer2</td><td></td>
<td> jnc</td><td> update_done</td><td> ;When carry, 200 ms</td>
<td> mov</td><td> ccapm2,#0</td><td> ;Stop pwm</td>
<td> clr</td><td> twenty _hz_pwm</td><td> ;Leave output pinlow.pwm has run 100 ; ms longer than ring ps to smooth out ; waveform</td>
<td> clr</td><td> fcall</td><td> ;0 = not ALERT, assure no ringing</td>
<td> jnb</td><td colspan="2"> sw_gndstart,update_done ;Brif loop start</td>
<td> setb</td><td> 100pswitch_</td><td> ;GS didnt answer ring</td>
<td> call</td><td> write_px2</td><td></td>
<td> update done:</td><td colspan="2"></td>
<td> jb</td><td> fcall,no_reset_io</td><td></td>
<td> jnb</td><td> lc_,no__reset_io</td><td></td>
<td> jb</td><td> frohtimeout,no_reset_io</td><td></td>
<td> no_reset_io:</td><td colspan="2"></td>
<td> pop</td><td> psw</td><td></td>
<td> pop</td><td> acc</td><td></td>
ret ; Reload Watch Dog Compare Word watchdog: push clr mov mov pop ret ea ccap4l,#0 ccap4h,ch ie ; Disable ints ; Point to start of current page ; Current page .****»*«ί«*******«*«***»««*«**«**««***«*«*««*?««** » ; TimerO (TLO) on-hook interrupt service routine ,************************************************* ♦
<td colspan="3"> onhook timer:</td>
<td> push</td><td> psw</td><td></td>
<td> push</td><td> acc</td><td></td>
<td> clr</td><td> tri</td><td> ;Stop offhook timer</td>
<td> clr</td><td> tfl</td><td> ;Clear pending ints by offhook timer</td>
<td> mute_check: jb</td><td> mute,on_spec2</td><td> ;If already muted skip this</td>
<td> setb</td><td> mute</td><td> ;Mute rx audio to prevent false</td>
<td> call</td><td> write_px2</td><td> ; decoding of audio ring as dtmf, ; also prevent audio feedback ;Out to port</td>
<td> 0n_spec2: jnb</td><td> fspec2,on_spec2_done</td><td> ;Check flag</td>
<td> call</td><td> spec2</td><td> ;Call special routine in TRU section</td>
<td> on_spec2_done: djnz</td><td> display_delay,gs_init</td><td> ;In 71.1 ms</td>
<td> call</td><td> update_displays</td><td> ;Every 71.1 ms</td>
<td> gs_init: jb</td><td> fcall,cont_service</td><td> ;Skip outgoing GS init on incoming call</td>
<td> jnb</td><td> sw_gndstart,cont_service</td><td> ; Brif not in GS mode</td>
<td> jnb</td><td> fonhook,cont_service</td><td> ;Don’t look for ring ground to start</td>
<td> jb</td><td colspan="2"> ; GS until really hung up ring__ground_,cont_groundstart</td>
<td> clr</td><td> 100pswitch_</td><td> ;Groundstart service was requested</td>
<td> call</td><td> write_px2</td><td></td>
<td> mov</td><td> gndstart_timerl,#O</td><td></td>
<td> mov</td><td> gndstart—timer2,#0</td><td> ;Init timer</td>
<td> cont_groundstart:</td><td> ►</td><td></td>
<td> inc</td><td> gndstart—timer 1</td><td> ;Subscriber has released ring ground</td>
<td> mov</td><td> a,gndstart_timerl</td><td></td>
<td> cjne</td><td> a,#90,cont_service</td><td> ;25 ms (90 x 277.8 us)</td>
<td> inc</td><td> gndstart—timer2</td><td> ;Every 25 msec</td>
<td> mov</td><td> gndstart—timer l,#0</td><td> ;Reset for next count of 90</td>
<td> mov</td><td> a,gndstart_timer2</td><td></td>
<td> cjne</td><td> a,#40,cont_service</td><td> ;1 sec (40 x 25 ms)</td>
<td> setb</td><td> loopswitch—</td><td> ;Open loop in 1 sec if sub didn’t</td>
<td> call</td><td> write_px2</td><td> ; complete loop</td>
<td> cont service: jb</td><td> fcall,ring—control</td><td> ; Brif ALERT state to generate ringing</td>
<td> jmp</td><td> onhook—timers</td><td> ; Else just do timers update</td>
<td colspan="3"> ; We shall ring the bell if the TRU is in ALERT state, (an incoming</td>
<td colspan="2"> ; call is waiting to be picked up).</td><td></td>
<td> ring control: jb</td><td> fbellsound,timing—ring</td><td> ;When bell not sounding during ring</td>
<td></td><td></td><td> ־, cycle, check for ring ground to ; indicate answer due to ringing</td>
<td colspan="3"> ; pulses</td>
<td> jb</td><td> ring ground ״,timing</td><td> .ring ;If no ring ground,time the ring.Now ; ignore the pulse on ring ground as ; ringer stops</td>
<td> mov</td><td> a,bell_timer2</td><td> ;Ines every 25 ms</td>
<td> cjne</td><td> a,#0,start_bellsound</td><td> ;Observe any ring ground after 25 ms</td>
<td> mov</td><td> a,#28</td><td> ;29 x 277.8 us = 8.1 ms</td>
<td> clr</td><td> c</td><td> ;Ready to subtract</td>
<td> subb</td><td> a,bell_timer</td><td></td>
<td> jnc</td><td> timing_ring</td><td> ;No carry til 8.1 ms after ring stops. ;Only ignore ring ground 8.1 ms</td>
<td> jmp timing_ring:</td><td> start_bellsound</td><td> ;If ring ground indicates came off hook ; during silent time, start 20 hz ; again to force ring trip</td>
<td> inc</td><td> bell_timer</td><td> ;Every 277.8 usee</td>
<td> mov</td><td> a,bcll_timer</td><td></td>
<td> cjne</td><td> a,#90,ringer_on</td><td> ;25 msec (90 x 277.8 us)</td>
<td> mov</td><td> bell—timer,#0</td><td> ;Reset for next 90</td>
<td> inc ringeron:</td><td> bell_timer2</td><td> ;Every 25 msec</td>
<td> jnb</td><td> fbellsound,ringer_off</td><td> ;Brif bell is not sounding now</td>
; The on time ringer modified from 1.95 secs to 1.975 secs, because the ring ; stops at the positive peak which causes a continous ringing. This problem ; was producing with 5 ringer box applying with maxjack, (ssh) check_stop_bellsound:
<td> mov</td><td> a,bell_timer2</td><td> ;Get elapsed bell on” time</td>
<td> cjne</td><td> a,#59,onhook_timers</td><td> ;Brif less then 79x25ms= 1.975 secs</td>
<td> mov</td><td> a,bell_timer</td><td> ;45 x 277.8 us = 125ms (total 1.987s</td>
<td> cjne</td><td> a,#45,onhook_timers</td><td> ;Ring stops after 1.987secs on negative ; peak, chops off last quarter cycle</td>
<td></td><td> ε</td><td> ; for proper ring trip</td>
<td> stop—bellsound:</td><td></td><td></td>
<td> mov</td><td> ccapm2,#0</td><td> ;Enable pwm</td>
<td> clr</td><td> fbellsound</td><td> ;0 = the bell not sounding</td>
<td> mov</td><td> dptr,#table_null</td><td> ;Point to table of null tone (nulltone ; causes ringer to have zero AC out, ; only battery)</td>
<td> mov</td><td> lowpoint,dpi</td><td> ;Save the null table start</td>
<td> mov</td><td> highpoint,dph</td><td></td>
<td> mov</td><td> ccapm2,#01000010b</td><td> ;Enable pwm</td>
<td> clr</td><td> ea</td><td></td>
<td> clr</td><td> n0—ring</td><td></td>
<td colspan="2"> call write_px2</td><td></td>
<td> setb</td><td> ea</td><td></td>
<td> call</td><td> watchdog</td><td></td>
<td> jmp ringer_off:</td><td> reset_bell_timers</td><td> ;Reset timers</td>
<td> mov</td><td> a,bell_timer2</td><td></td>
<td> cjne start_bellsound:</td><td> a,#120,onhook_timers</td><td> ;4 sec with no ring (160 x 25)</td>
<td> call</td><td> reset io</td><td></td>
<td> call</td><td colspan="2"> write_pxl</td>
<td> call</td><td> write_px2</td><td></td>
<td> clr</td><td> ea</td><td></td>
<td> setb</td><td> no_ring</td><td></td>
<td colspan="2"> call write_px2</td><td></td>
<td> setb</td><td> ea</td><td></td>
<td> mov</td><td> ccapm2,#0</td><td> ;Enable pwtn</td>
<td> mov</td><td> dptr,#table_20</td><td> ;Point to table for 20 hz</td>
<td> mov</td><td> lowpoint,dpi</td><td> ;Remember where table starts</td>
<td> mov</td><td> highpoint,dph</td><td></td>
<td> mov</td><td> ccapm2,#01000010b</td><td> ;Enable pwm</td>
<td> test_relayl:</td><td colspan="2"></td>
<td> setb</td><td> fbellsound</td><td> ;1 = bell is sounding now</td>
<td> reset_bell_timers:</td><td colspan="2"></td>
<td> mov</td><td> bell_timer,#0</td><td></td>
<td> mov</td><td> bell_timer2,#0</td><td></td>
<td> onhook_timers:</td><td colspan="2"></td>
<td> inc</td><td> time_onl</td><td> ;Eveiy 277.8 usee while on hook</td>
<td> mov</td><td> a,time_onl</td><td></td>
<td> cjne</td><td> a,#36,onhook_done</td><td> ;36 x 277.8 ms = 10 ms</td>
<td> inc</td><td> time_on2</td><td> ;Every 10 msec while on hook</td>
<td> mov</td><td> time__onl,#0</td><td> ;Reset for next 36</td>
<td> mov</td><td> a,time_on2</td><td></td>
<td> cjne</td><td> a,#0,not_inc255</td><td rowspan="2"> ; 10 msec x 255 = .255 sec</td>
<td> inc</td><td> test_min</td>
<td> not inc255:</td><td colspan="2"></td>
<td> jb</td><td colspan="2"> frohtimeout,onhook_done ;Skip hang up stuff until loop test ; checks out ok</td>
<td> test—fhangl:</td><td colspan="2"></td>
<td> jb</td><td> fonhook,onhook_done</td><td> ;Don’t do another hang up, one has been ; done already</td>
<td> test_fhang2:</td><td colspan="2"></td>
<td> mov</td><td> a,time_on2</td><td></td>
<td></td><td></td><td> ;ON HOOK STATUS</td>
<td> ; cjne</td><td> a,#70,onhook_done</td><td> ;700 msec indicates hang up</td>
<td> cjne</td><td> a,#30,onhook—done</td><td> ;700 msec indicates hang up</td>
<td> test_fhang3:</td><td colspan="2"></td>
<td> setb</td><td> fhang</td><td> ;Set the hang up flag</td>
<td> clr</td><td> f_inuseofftiming</td><td> ; Stop timer to prevent possible remote ; hup</td>
<td> onhook_done:</td><td colspan="2"></td>
<td> pop</td><td> acc</td><td></td>
<td> pop</td><td> psw</td><td></td>
<td> reti</td><td colspan="2"></td>
.»*«««**«********:*4**********4**********4*««****** » ; Timerl (THO) off-hook interrupt service routine <sub>Φ</sub>φφφ**«*«φ*««««4**«**«*««««*«««**«**«*««*«««****4ι« offhook timer:
push push psw acc ; Save entry status
<td> jnb</td><td> fspec2,check_strobe</td><td> ; Brif spec2 is not enabled</td>
<td> call</td><td> spec2</td><td> ; Else do TRU specific task</td>
<td colspan="3"> ; Check for a DTMF digit, and read it from the MT8870 if there</td>
<td> ; is one available.</td><td></td><td></td>
<td> check_strobe:</td><td></td><td></td>
<td> call</td><td> read_pxl_strobe</td><td></td>
<td> jb</td><td> strobe,decode_dtmf</td><td> ; Brif a DTMF digit is waiting</td>
<td> dr</td><td> fdecoder_busy</td><td> ; Reset if strobe is gone</td>
<td> jmp</td><td> ttime</td><td> ; and just do offhook timing task</td>
<td> decode_dtmf:</td><td></td><td></td>
<td> jb</td><td> fdecoder_busy,ttime</td><td> ; Brif DTMF digit already was read</td>
<td> call</td><td> read_pxl</td><td> ; Else read it now</td>
<td> setb</td><td> fdtmfin</td><td> ; 1 = DTMF digit received!</td>
<td> setb</td><td> fdecoder_busy</td><td> ; 1 = DTMF digit being processed</td>
<td colspan="3"> ; Check elapsed offhook time, update displays in every 71ms, and</td>
<td colspan="2"> ; start-end ROH tone as required.</td><td></td>
<td> ttime:</td><td></td><td></td>
<td> inc</td><td> time_offl</td><td> ; Bump minor offhook timer (@ 277.8us)</td>
<td> mov</td><td> a,time_offl</td><td> ; Get minor offhook time</td>
<td> JMP TEST_HOOK</td><td></td><td></td>
<td> cjne</td><td> a,#0,t_one_sec</td><td> ; Brif < 256*277us=71.1ms</td>
<td> inc</td><td> time_off2</td><td> ; Bump major timer (every 71.1ms)</td>
<td> call</td><td> update_displays</td><td> ; Do update every 71.1ms</td>
<td> mov</td><td> a,time_off2</td><td> ; Get major offhook time</td>
<td> cjne</td><td> a,#0,t_one_sec</td><td> ;Brif <256*71.1ms=18.2sec</td>
<td> inc</td><td> time_off3</td><td> ; Bump total offhook timer (@ 18.2sec)</td>
<td> t_one_sec:</td><td></td><td></td>
<td> mov</td><td> a,time_off2</td><td> ; Get major offhook time</td>
<td> cjne</td><td> a,#14,trohtimer</td><td> ; Brif < 14*71.1ms=995ms passed</td>
<td> setb</td><td> f_one_sec</td><td> ; so change in INUSE lamp won’t cause</td>
<td></td><td></td><td> ; hangup if phone taken off hook too</td>
<td></td><td></td><td> ; soon after hangup</td>
<td> trohtimer:</td><td></td><td></td>
<td> jb</td><td> fsend.tdone</td><td> ; Brif we originated the call (no ROH)</td>
<td> jnb</td><td> inuse,tdone</td><td> ; Brif we are INUSE (no ROH either)</td>
<td> inc</td><td> r5</td><td> ; Bump minor ROH start/end timer</td>
<td> cjne</td><td> r5,#36,trohstart</td><td> ; Brif < 35*277.8us=10ms passed</td>
<td> inc</td><td> r7</td><td> ; Bump minor ROH on/off timer</td>
<td> mov</td><td> r5,#0</td><td> ; Reset for another pass (10ms)</td>
<td> cjne</td><td> r7,#10,trohstart</td><td> ; Brif < 10* 10ms=100ms passed</td>
<td> epi</td><td> roh_on</td><td> ; Toggle ROH on/off every 100ms</td>
<td> mov</td><td> r7,#0</td><td> ; Reset for another on/off phase</td>
<td> trohstart:</td><td></td><td></td>
<td> mov</td><td> a,time_off3</td><td> ; Get total elapsed offhook time</td>
<td> cjne</td><td> a,#2,trohquit</td><td> ; Brif < 2xl8.2=36.3sec passed</td>
<td> mov</td><td> a,time_off2</td><td> ; Get additional major time too</td>
<td> cjne</td><td> a,#5 !,trohquit</td><td> ; Brif < 40sec total offhook</td>
<td> setb</td><td> ftime</td><td> ; 1 = ROH period started</td>
trohquit:
S3 mov a,time_off3 cjne a,#5,tdone mov a,time_of£2 cjne a,#127,tdone setb frohtimeout tdone:
jnb f_start,tdoneO mov a,time_off2 cjne a,#4,tdone 1 : cjne a,#7,tdone 1 clr f_start ; Get total offhook time again ־, Brif < 5*18.2=91sec passed ; Get additional major time too ; Brif < 91+(127*71.1 ms)=100sec ; 1 = ROH period expired ; Brif not timing 500ms after first ; Get elapsed offhook time ; Brif < 285ms elapsed ; Brif < 500ms elapsed ; Reenable onhook ints after 500ms ; Get here only after 500ms passed following the first offhook after ; every hang up.
<td> tdoneO:</td><td> jnb</td><td> lc_,tdonel</td><td> ; Brif offhook now</td>
<td> test_trO:</td><td> clr</td><td> tri</td><td> ; Else stop the off hook timer</td>
<td></td><td> setb</td><td> trO</td><td> ; and start on hook timer</td>
<td> tdone 1:</td><td> pop</td><td> acc</td><td> ; Restore</td>
<td></td><td> pop</td><td> psw</td><td></td>
<td></td><td> reti</td><td></td><td></td>
*»******»****»**«*»»*»**:**»»«»»»»****נ*»***»**»*»*, ; External Interrupt 0 service routine .*«********ΦΦΦ************************************
<td colspan="3"> offhook_edge:</td>
<td> jb</td><td> frohtimeout,offhook_re turn 1</td><td></td>
<td> jnb</td><td> fcall,not_inc__call</td><td></td>
<td> jnb</td><td> no_ring,ok_wait</td><td></td>
<td> setb</td><td> ring_</td><td> ;Turn off bell</td>
<td> call</td><td> write_px2</td><td></td>
<td> clr</td><td> no_ring</td><td></td>
<td> call</td><td> write_px2</td><td></td>
<td> setb</td><td> retum_ring</td><td></td>
<td> clr</td><td> ieO</td><td> ;Discard pending EXO (LC_) interrupt</td>
<td> dr</td><td> trO</td><td> ; Turn off onhook_timer and flag</td>
<td> dr</td><td> tfi)</td><td> ; in case onhook_timer int pending</td>
<td> ok_wait:</td><td colspan="2"></td>
<td> mov</td><td> r7,#0ffh</td><td></td>
<td> loop_ring:</td><td colspan="2"></td>
<td> mov</td><td> r6,#0ffh</td><td></td>
<td> djnz</td><td> r6,$</td><td></td>
<td> call</td><td> watchdog</td><td></td>
<td> djnz</td><td> r7,100p_ring</td><td></td>
<td> jnb</td><td> lc_,no_set</td><td></td>
<td> esta_set:</td><td colspan="2"></td>
<td> jnb</td><td> return_ring,do_not—return</td><td></td>
<td> call</td><td> reset_io</td><td></td>
<td> call</td><td> write_pxl</td><td></td>
<td> call</td><td> write_px2</td><td></td>
<td> setb</td><td> no_ring</td><td></td>
<td> clr</td><td> ring_</td><td> ;Turn off bell</td>
<td> call</td><td> write_px2</td><td></td>
<td> clr</td><td> retum_ring</td><td></td>
<td> mov</td><td> r7,#07fh</td><td></td>
<td> 100p_ringl;</td><td colspan="2"></td>
<td> mov</td><td> r6,#0ffh</td><td></td>
<td> djnz</td><td> r6,$</td><td></td>
<td> call</td><td> watchdog</td><td></td>
<td> djnz</td><td> r7,100p_ringl</td><td></td>
<td> do_not_retum:</td><td colspan="2"></td>
<td> call</td><td> reset_io</td><td></td>
<td> call</td><td> write_pxl</td><td></td>
<td> call</td><td> write_px2</td><td></td>
<td> setb</td><td> trO</td><td> ; Turn off onhook_timer and flag</td>
<td> mov</td><td> t!0,#0</td><td></td>
<td> reti offhook_returnl:</td><td colspan="2"></td>
<td> jmp</td><td> offhook return</td><td></td>
<td> no_set: not_inc_call:</td><td colspan="2"></td>
<td> clr</td><td> trO</td><td> ; Turn off onhook—timer and flag</td>
<td> clr</td><td> tfO</td><td> ; in case onhook_timer int pending</td>
<td> push</td><td> psw</td><td></td>
<td> push</td><td> acc</td><td></td>
<td> dr</td><td> ieO</td><td> ;Discard pending EXO (LC_) interrupt</td>
<td> setb</td><td> tri</td><td> ;Start off-hook timer</td>
<td> clr</td><td> fhang</td><td> ;Clear hangup flag for safety</td>
<td> mov</td><td> thO,#O</td><td> ;Reset offhook timer</td>
<td> mov</td><td> time_offl,#0</td><td> ;Timers incremented by thO interrupts</td>
<td> mov</td><td> time_off2,#0</td><td></td>
<td> mov</td><td> time_offi3,#0</td><td></td>
<td> clr</td><td> mute</td><td> ;Unmute rx audio</td>
<td> call</td><td> write_px2</td><td></td>
<td> jnb</td><td> fonhook,check_flash</td><td> ;Brif wasn’t hung up</td>
<td></td><td></td><td> ; coming back off hook</td>
<td> clr</td><td> fonhook</td><td> ;Clear the flag, it was hung up, now</td>
<td> ok_offhook:</td><td></td><td></td>
<td> jnb</td><td> fcall,set_hook_flag</td><td> ;Brif not in ALERT state</td>
<td> setb</td><td> fanswer</td><td> ;1 = off hook during incoming call</td>
<td> clr</td><td> fcall</td><td> ;Clear the ALERT flag (answering call)</td>
<td> setb</td><td> ring_</td><td> ;Turn off bell</td>
<td> call</td><td> write_px2</td><td></td>
<td> clr</td><td> no_ring</td><td></td>
<td> call</td><td> write_px2</td><td></td>
<td> mov</td><td> ccapm2,#0</td><td> ;Stop ringer PWM</td>
<td> clr</td><td> twenty_hz_pwm</td><td> ;Leave output pin low</td>
<td> jmp</td><td> offhook_done</td><td></td>
<td> set_hook__flag:</td><td></td><td></td>
<td> setb</td><td> fhook</td><td> ; Show off hook if not in ALERT state</td>
<td> jmp</td><td> offhook_done</td><td></td>
<td> check_flash:</td><td></td><td></td>
<td> mov</td><td> a,#19</td><td> ;20 x 10 = 200 msec</td>
<td> clr</td><td> c</td><td> ;Clear carry for subtraction</td>
<td> subb</td><td> a,time_on2</td><td> ;200 700 msec is flash</td>
<td> jnc</td><td> check__digit</td><td></td>
<td> jnb</td><td> lock,offhook_donc</td><td> ; No flash if TRU is locked</td>
<td> ;; setb</td><td> fflash</td><td> ;Set flash flag</td>
<td> jmp</td><td> offltook_done</td><td></td>
<td> check_digit:</td><td></td><td></td>
<td> mov</td><td> a,#l</td><td> 2׳ x 10 = 20 msec</td>
<td> clr</td><td> c</td><td> ;Clear carry for subtraction</td>
<td> subb</td><td> a,time_on2</td><td> ;20200־ msec is pulse</td>
<td> jnc</td><td> offhook_done</td><td> Just a glitch</td>
<td> inc</td><td> pulse_digit</td><td> ;Contains the number</td>
<td> setb</td><td> fdigit</td><td> ;Possible digit flag</td>
<td> offhook_done:</td><td></td><td></td>
<td> mov</td><td> time_onl,#0</td><td> ;Reset on-hook timers so they can be</td>
<td> mov</td><td> time_on2,#0</td><td> ; restarted on hang up</td>
<td> mov</td><td> t!0,#0</td><td></td>
<td> POP</td><td> acc</td><td></td>
<td> pop</td><td> psw</td><td></td>
<td> offhook_return:</td><td></td><td></td>
<td> reti</td><td></td><td></td>
; PCA Interrupt Routine »
; PCA interrupts are generated by using module 0’s (software timer) ; compare/match option on every low count = FF match. This way we can ; generate an interrupt at the end of each page, OOFF-OIOO, 01FF-0200 ; etc. which gives us an interrupt at every (256*1.085us) 278us.
; This Maxjack implementation is using conditional assembly to produce ; a modified PCA service routine for TRUs with extremely high data transfer ; rates (Audiovox requires the alternate PCA routine).
<td> $ge</td><td></td><td></td>
<td> pca_service:</td><td></td><td></td>
<td colspan="2"> %if(%intmask ne 0) then (</td><td></td>
<td> push</td><td> ie</td><td> ;Going to simulate third interrupt</td>
<td></td><td></td><td> ; priority level</td>
<td> mov</td><td> ie,#%intmask</td><td> :Defined in TRU section</td>
<td> call</td><td> masklabel</td><td> ;To execute the reti</td>
<td> push</td><td> acc</td><td></td>
<td> push</td><td> psw</td><td></td>
<td> mov</td><td> a,ccapml</td><td> ;Look at tone pwm</td>
<td> orl</td><td> a,ccapm2</td><td> ;Look at ring pwm</td>
<td> anl</td><td> a,#00000010b</td><td> Just look at pwm bit</td>
<td> jz</td><td> pca_done</td><td> ;Skip next part if no tone or ring</td>
<td></td><td></td><td> ; output</td>
<td> do_pca:</td><td></td><td></td>
<td> mov</td><td> a,#0</td><td> ;Initialize pointer</td>
<td> read_table:</td><td></td><td></td>
<td> move</td><td> a,@a+dptr</td><td> ;Get data from table</td>
<td> cjne</td><td> a,#255,write__tone</td><td></td>
<td> mov</td><td> dph,highpoint</td><td> ;Reset index this is end of table</td>
<td> mov</td><td> dpi,lowpoint</td><td></td>
<td> mov</td><td> a,#0</td><td> ;So index will be right</td>
<td> jmp</td><td> read__table</td><td> ;Read first entry</td>
<td> write_tone:</td><td></td><td></td>
<td> mov</td><td> ccaplh,a</td><td> .JPut data in tone pwm</td>
<td> mov</td><td> ccap2h,a</td><td> ;Put data into ring pwm .only tone</td>
<td></td><td></td><td> ; or ring pwm is running at any given</td>
<td></td><td></td><td> ; time</td>
<td> inc</td><td> dptr</td><td> ;Point to next table entry for next</td>
<td></td><td></td><td> ;time</td>
<td> pca_done:</td><td></td><td></td>
<td> clr</td><td> ccfO</td><td> ;Reset the module 0 flag</td>
<td> clr</td><td> ea</td><td> ;Disable ints</td>
<td> mov</td><td> ccapOI,#Offh</td><td> ;Reload low match and suspend</td>
<td></td><td></td><td> ; comparator</td>
<td> mov</td><td> a,ccapOh</td><td> ;Get last page</td>
<td> inc</td><td> a</td><td> ;Point to next page</td>
<td> mov</td><td> ccapOh,a</td><td> ;Load high match and restart comparator</td>
<td> setb</td><td> ea</td><td> ;Enable ints again</td>
<td> pop</td><td> psw</td><td></td>
<td> POP</td><td> acc</td><td></td>
<td> POP</td><td> ie</td><td> ;Restore original ints</td>
ret masklabel:
reti ) else ( push push mov orl anl jz acc psw a,ccapml a,ccapm2 a,#00000010b pca_done ;Look at tone pwm ;Look at ring pwm
Just look at pwm bit ;Skip next part if no tone or ring ; output ; If we are generating Dial Tone now, then get the current ; value from the selected tone table, and send it to the PCA1 ; so that proper DTMF frequency is generated on CEX1 (pl.4).
<td> do_pca:</td><td> mov</td><td> a,#0</td><td> ;Initialize pointer</td>
<td> read_table:</td><td> move</td><td> a,@a+dptr</td><td> ;Get data from table</td>
<td> write_tone:</td><td> cjne mov mov mov jmp mov</td><td> a,#255,write_tone dph, highpoint dpi, lowpoint a,#0 read_table ccaplh,a</td><td> ;Reset index, this is end of table ;So index will be right ;Read first entiy ;Put data in tone pwm</td>
<td> pca_done:</td><td> mov inc clr</td><td> ccap2h,a dptr ccfO</td><td> ;Put data into ring pwm only tone or ; ring pwm is running at any given ; time ;Point to next table entry for next ; time ;Reset the module 0 flag</td>
<td></td><td> clr mov mov inc mov setb pop pop reti )6</td><td> ea ccap0l,#0ffh a,ccapOh a ccapOh,a ea psw acc</td><td> ;Disable ints ;Reload low match and suspend ; comparator ;Get last page ;Point to next page ;Load high match and restart comparator ;Enable ints again</td>
Snoge
**************י««««»»«»«»*♦*«**♦»«««*******♦«**««.
.♦ ; I/O Support Routines
***ייי״י*<sup>,</sup>.♦******«♦**.«*«*«**«*«*♦*♦»♦♦*♦«*»««, write_pxl:
push ie clr ea clr io select ; Data from pxl_temp to pxl ; Save interrupt status ; No interruptions
<td> push</td><td> acc</td><td></td>
<td> push</td><td> 0</td><td> ; Push rO</td>
<td> setb</td><td> aO</td><td> ;B</td>
<td> clr</td><td> al</td><td></td>
<td> mov</td><td> a,pxl_temp</td><td></td>
<td> anl</td><td> a,#11110000b</td><td></td>
<td> mov</td><td> b,a</td><td></td>
<td> mov</td><td> a,px2_temp</td><td></td>
<td> anl</td><td> a,#00001111b</td><td> ; Keep the input bits high</td>
<td> orl</td><td> a,b</td><td></td>
<td> mov</td><td> rO,#OOh</td><td> ; Low address for I/O chip pxl latch</td>
<td> movx</td><td> @rO,a</td><td></td>
<td> setb</td><td> aO</td><td></td>
<td> setb</td><td> al</td><td></td>
<td> pop</td><td> 0</td><td> ; Restore rO</td>
<td> pop</td><td> acc</td><td></td>
<td> pop</td><td> ie</td><td> ; Restore interrupt status</td>
<td> ret</td><td></td><td></td>
<td> read_pxl:</td><td></td><td></td>
<td> push</td><td> ie</td><td> : Save interrupt status</td>
<td> clr</td><td> ea</td><td> ; No interrupts</td>
<td> clr</td><td> io_select</td><td></td>
<td> push</td><td> acc</td><td></td>
<td> push</td><td> 0</td><td> ; Push rO</td>
<td> clr</td><td> aO</td><td> ;A</td>
<td> clr</td><td> al</td><td></td>
<td> mov</td><td> rO,#Oh</td><td> ; Low address byte for I/O chip pxl pins</td>
<td> movx</td><td> a,@rO</td><td></td>
<td> anl</td><td> a,#00001111b</td><td> ; Mask the output bits</td>
<td> anl</td><td> pxl_temp,#11110000b</td><td> ; Mask the input bits in pxl_temp</td>
<td> orl</td><td> pxl_temp,a</td><td> ; Combine inputs anl outputs into one</td>
<td></td><td></td><td> ;byte</td>
<td> setb</td><td> aO</td><td></td>
<td> setb</td><td> al</td><td></td>
<td> pop</td><td> 0</td><td> ; Pop rO</td>
<td> pop</td><td> acc</td><td></td>
<td> pop</td><td> ie</td><td> ; Restore interrupt status</td>
<td> ret</td><td></td><td></td>
<td> read_pxl_strobe:</td><td></td><td></td>
<td> push</td><td> ie</td><td> ; Save interrupt status</td>
<td> clr</td><td> ea</td><td> ; No interrupts</td>
<td> clr</td><td> io_select</td><td></td>
<td> push</td><td> acc</td><td></td>
<td> push</td><td> 0</td><td> ; Push rO</td>
<td> clr</td><td> aO</td><td> ;A</td>
<td> clr</td><td> al</td><td></td>
<td> mov</td><td> rO,#Oh</td><td> ; Low address byte for I/O chip pxl pins</td>
<td> movx</td><td> a,@rO</td><td></td>
<td> mov</td><td> io_status,a</td><td></td>
<td> setb</td><td> aO</td><td></td>
<td> setb</td><td> al</td><td></td>
<td> pop</td><td> 0</td><td> ; Pop rO</td>
<td> pop</td><td> acc</td><td></td>
<td> POP</td><td> ie</td><td> ; Restore interrupt status</td>
<td> ret</td><td></td><td></td>
<td> write_px2:</td><td></td><td></td><td> ; Data from px2_temp to px2</td>
<td></td><td> push</td><td> ie</td><td> ; Save interrupt status</td>
<td></td><td> clr</td><td> ea</td><td> ; No interruptions</td>
<td></td><td> clr</td><td> io_select</td><td></td>
<td></td><td> push</td><td> acc</td><td></td>
<td></td><td> push</td><td> 0</td><td> ; Push rO</td>
<td></td><td> setb</td><td> aO</td><td> ;B</td>
<td></td><td> clr</td><td> al</td><td></td>
<td></td><td> mov</td><td> a,pxl_temp</td><td></td>
<td></td><td> anl</td><td> a,#11110000b</td><td></td>
<td></td><td> mov</td><td> b,a</td><td></td>
<td></td><td> mov</td><td> a,px2_temp</td><td></td>
<td></td><td> anl</td><td> a,#00001111b</td><td> ; Keep the input bits high</td>
<td></td><td> orl</td><td> a,b</td><td></td>
<td></td><td> mov</td><td> r0,#00h</td><td> ; Low address for I/O chip pxl latch</td>
<td></td><td> movx</td><td> @rO,a</td><td></td>
<td></td><td> setb</td><td> aO</td><td></td>
<td></td><td> setb</td><td> al</td><td></td>
<td></td><td> pop</td><td> 0</td><td> ; Restore rO</td>
<td></td><td> Pop</td><td> acc</td><td></td>
<td></td><td> pop</td><td> ie</td><td> ; Restore interrupt status</td>
<td></td><td> ret</td><td></td><td></td>
<td> write_io_c</td><td></td><td></td><td> ; Data from px2_temp to px2</td>
<td></td><td> push</td><td> ie</td><td> ; Save interrupt status</td>
<td></td><td> clr</td><td> ea</td><td> ; No interruptions</td>
<td></td><td> clr</td><td> io_select</td><td></td>
<td></td><td> push</td><td> acc</td><td></td>
<td></td><td> push</td><td> 0</td><td> ; Push rO</td>
<td></td><td> clr</td><td> aO</td><td> ;B</td>
<td></td><td> setb</td><td> al</td><td></td>
<td></td><td> mov</td><td> aJampS—temp</td><td></td>
<td></td><td> anl</td><td> a,# 11110000b</td><td> r.</td>
<td></td><td> rl</td><td> a</td><td></td>
<td></td><td> rl</td><td> a</td><td></td>
<td></td><td> rl</td><td> a</td><td></td>
<td></td><td> rl</td><td> a</td><td></td>
<td></td><td> mov</td><td> rO,#OOh</td><td> ; Low address for I/O chip pxl latch</td>
<td></td><td> movx</td><td> @r0,a</td><td></td>
<td></td><td> setb</td><td> aO</td><td></td>
<td></td><td> setb</td><td> al</td><td></td>
<td></td><td> pop</td><td> 0</td><td> ; Restore rO</td>
<td></td><td> pop</td><td> acc</td><td></td>
<td></td><td> pop</td><td> ie</td><td> ; Restore interrupt status</td>
<td></td><td> ret</td><td></td><td></td>
<td> read__px2:</td><td></td><td></td><td></td>
<td></td><td> push</td><td> ie</td><td> ; Save interrupt status</td>
<td></td><td> clr</td><td> ea</td><td> ; No interrupts</td>
<td></td><td> clr</td><td> 10—select</td><td></td>
<td></td><td> push</td><td> acc</td><td></td>
<td></td><td> push</td><td> 0</td><td> ; Push rO</td>
<td></td><td> clr</td><td> aO</td><td> :c</td>
<td></td><td> setb</td><td> al</td><td></td>
<td> mov</td><td> rO,#Oh</td><td> ; Low address for I/O chip px2 pins</td>
<td> movx</td><td> a»@rO</td><td></td>
<td> anl</td><td> a,#11110000b</td><td> ; Mask the output bits</td>
<td> anl</td><td> px2_temp,#0000111 lb</td><td> ; Mask the input bits in px2_temp</td>
<td> orl</td><td> px2_temp,a</td><td> ; Combine inputs/outputs into one byte</td>
<td> setb</td><td> aO</td><td></td>
<td> setb</td><td> al</td><td></td>
<td> pop</td><td> 0</td><td> ; Pop rO</td>
<td> pop</td><td> acc</td><td></td>
<td> pop</td><td> ie</td><td> ; Restore interrupt status</td>
<td> ret</td><td></td><td></td>
<td> read_io_m_a:</td><td></td><td> ׳ ; Data from px2_temp to px2</td>
<td> push</td><td> ie</td><td> ; Save interrupt status</td>
<td> clr</td><td> ea</td><td> ; No interruptions</td>
<td> setb</td><td> io_select</td><td></td>
<td> ; push</td><td> acc</td><td></td>
<td> push</td><td> 0</td><td> ; Push rO</td>
<td> clr</td><td> aO</td><td> ;b</td>
<td> dr</td><td> al</td><td></td>
<td> mov</td><td> rO,#OOh</td><td> ; Low address for I/O chip pxl latch</td>
<td> movx</td><td> a,@r0</td><td></td>
<td> setb</td><td> aO</td><td></td>
<td> setb</td><td> al</td><td></td>
<td> clr</td><td> io_select</td><td></td>
<td> pop</td><td> 0</td><td> ; Restore rO</td>
<td> ; pop</td><td> acc</td><td></td>
<td> pop</td><td> ie</td><td> ; Restore interrupt status</td>
<td> ret</td><td></td><td></td>
<td> write_io_m_b:</td><td></td><td> ; Data from pxl_temp to pxl</td>
<td> push</td><td> ie</td><td> ; Save interrupt status</td>
<td> setb</td><td> io_select</td><td></td>
<td> dr</td><td> ea</td><td> ; No interruptions</td>
<td> push</td><td> acc</td><td></td>
<td> push</td><td> 0</td><td> ; Push rO</td>
<td> setb</td><td> aO</td><td> ;B</td>
<td> dr</td><td> al</td><td></td>
<td> mov</td><td> a,io_m_b</td><td></td>
<td> mov</td><td> rO,#OOh</td><td> ; Low address for I/O chip pxl latch</td>
<td> movx</td><td> @r0,a</td><td></td>
<td> setb</td><td> aO</td><td></td>
<td> setb</td><td> al</td><td></td>
<td> clr</td><td> io_select</td><td></td>
<td> pop</td><td> 0</td><td> ; Restore rO</td>
<td> pop</td><td> acc</td><td></td>
<td> pop</td><td> ie</td><td> ; Restore interrupt status</td>
<td> ret</td><td></td><td></td>
<td> write__io_m_c:</td><td></td><td> ; Data from px2_temp to px2</td>
<td> push</td><td> ie</td><td> ; Save interrupt status</td>
<td> setb</td><td> io_select</td><td></td>
<td> clr</td><td> ea</td><td> ; No interruptions</td>
<td> push</td><td> acc</td><td></td>
<td> push</td><td> 0</td><td> ; Push rO</td>
<td> dr</td><td> aO</td><td> ;B</td>
<td> setb</td><td> al</td><td></td>
<td> mov</td><td> a,io_m_c</td><td></td>
<td> mov</td><td> rO,#OOh</td><td> ; Low address for I/O chip pxl latch</td>
<td> movx</td><td> @rO,a</td><td></td>
<td> setb</td><td> aO</td><td></td>
<td> setb</td><td> al</td><td></td>
<td> clr</td><td> io_select</td><td></td>
<td> pop</td><td> 0</td><td> ; Restore rO</td>
<td> pop</td><td> acc</td><td></td>
<td> pop</td><td> ie</td><td> ; Restore interrupt status</td>
<td> ret</td><td></td><td></td>
<td> reset_io_m:</td><td></td><td></td>
<td> push</td><td> ie</td><td> : Save interrupt status</td>
<td> clr</td><td> ea</td><td> ; No interrupts</td>
<td> setb</td><td> io_select</td><td></td>
<td> push</td><td> acc</td><td></td>
<td> push</td><td> 0</td><td> ; Push rO</td>
<td> setb</td><td> aO</td><td> ; Control</td>
<td> setb</td><td> al</td><td></td>
<td> mov</td><td> rO,#Oh</td><td> ; Low address for I/O chip px2 pins</td>
<td> mov</td><td> a,#10010000b</td><td></td>
<td> movx</td><td> @rO,a</td><td></td>
<td> setb</td><td> aO</td><td></td>
<td> setb</td><td> al</td><td></td>
<td> clr</td><td> io_select</td><td></td>
<td> pop</td><td> 0</td><td> ; Pop rO</td>
<td> pop</td><td> acc</td><td></td>
<td> pop</td><td> ie</td><td> ; Restore interrupt status</td>
<td> ret</td><td></td><td></td>
<td> reset_io:</td><td></td><td></td>
<td> push</td><td> ie</td><td> ; Save interrupt status</td>
<td> clr</td><td> ea</td><td> ; No interrupts</td>
<td> clr</td><td> io select</td><td></td>
<td> push</td><td> acc</td><td></td>
<td> push</td><td> 0</td><td> ; Push rO</td>
<td> setb</td><td> aO</td><td> ; Control</td>
<td> setb</td><td> al</td><td></td>
<td> mov</td><td> r0,#0h</td><td> ; Low address for I/O chip px2 pins</td>
<td> mov</td><td> a,#10011000b</td><td></td>
<td> movx</td><td> @rO,a</td><td></td>
<td> setb</td><td> aO</td><td></td>
<td> setb</td><td> al</td><td></td>
<td> clr</td><td> io_select</td><td></td>
<td> pop</td><td> 0</td><td> ; Pop rO</td>
<td> pop</td><td> acc</td><td></td>
<td> POP</td><td> ie</td><td> ; Restore interrupt status</td>
<td> ret</td><td></td><td></td>
*****************************************4*******
Support Routines ************************************************* ; Generic messages between the TRU and Celjack can be save to aid ; in debugging. This message buffer is from 90h to FFh.
<td> clr_msg:</td><td> push</td><td> 1</td><td> ; Save Rl</td>
<td></td><td> mov</td><td> rl,#msgbuf_start</td><td> ; Point to message buffer start</td>
<td></td><td> mov</td><td> msg_ptra־l</td><td> ; Save buffer start</td>
<td> dr_msgl:</td><td> mov</td><td> @rl,#55h</td><td> ; Fill with 55h mask</td>
<td></td><td> inc</td><td> rl</td><td> ; Point to next location</td>
<td></td><td> cjne</td><td colspan="2"> rl,#msgbuf_end,clr_msgl ; Til end of the buffer</td>
<td></td><td> pop</td><td> 1</td><td> ; Restore Rl</td>
<td></td><td> ret</td><td></td><td></td>
<td> savemg:</td><td> push</td><td> 1</td><td> ; Save Rl</td>
<td></td><td> mov</td><td> rl,msg ptr</td><td> ; Get current pointer</td>
<td></td><td> cjne</td><td> rl,#msgbuf_end,saveml</td><td> ; Brif message buffer is not full yet</td>
<td></td><td> mov</td><td> rl,#msgbuf_start</td><td> ; Repoint to start when full</td>
saveml: mov @rl,a inc rl mov msg_ptr,rl pop 1 exit: ret ; Save msg in buffer ; Advance pointer ; Save advanced for next time ; Restore Rl ; Clear copy of handset’s LCD display from ram display buffer.
<td> clr_dsp:</td><td> push</td><td> 1</td><td> ; Save Rl</td>
<td></td><td> mov</td><td> rl,#dspbuf_start</td><td> ; Point to message buffer start</td>
<td></td><td> mov</td><td> dsp_ptr,rl</td><td> ; Save buffer start</td>
<td> clr_dspl:</td><td> mov</td><td> @rl,#Offh</td><td> ; Fill with FFh mask</td>
<td></td><td> inc</td><td> rl</td><td> ; Point to next location</td>
<td></td><td> cjne</td><td> rl,#dspbuf_end,clr</td><td> _dspl ; Til end of display buffer</td>
<td></td><td> pop</td><td> 1</td><td> ; Restore Rl</td>
<td></td><td> ret</td><td></td><td></td>
; Some TRUs must save the handset LCD display info, in a local display ; buffer.
save_dsp:
push 1 ;SaveRl mov rl,dsp_ptr ; Get current pointer cjne rl,#dspbuf_end,save_dspl ; Brif message buffer is not full yet mov rl,#dspbuf_start ; Repoint to start when full save_dspl:
<td></td><td> mov @rl,a ; Save msg in buffer inc rl ; Advance pointer mov dsp_ptr,rl ; Update pointer for next time pop 1 ; Restore Rl</td>
save_dsp2;
;include(SPAIN.asm) ret $nolist $include(SPAIN4.asm)
Contents5
19 sheets
Sheet 1 Sheet 2 Sheet 3 Sheet 4 Sheet 5 Sheet 6 Sheet 7 Sheet 8 Sheet 9 Sheet 10 Sheet 11 Sheet 12 Sheet 13 Sheet 14 Sheet 15 Sheet 16 Sheet 17 Sheet 18 Sheet 19
53 members in 34 offices
Priority claims3
| Document | Office | Kind | Date |
|---|---|---|---|
| 3762793 | United States of America | A | |
| 3762793 | United States of America | A | |
| US19930037627 | – | – | – |
Members53
| Document | Office | Kind | |
|---|---|---|---|
| IL108809A0 | Israel | A0 | |
| IL108809D0 | Israel | D0 | |
| UY23744A1 | Uruguay | A1 | |
| CA2154789A1 | Canada | A1 | |
| WO9422255A1 | World Intellectual Property Organization (WIPO) | A1 | |
| AU6443194A | Australia | A | |
| ZA941880B | South Africa | B | |
| ECSP941059A | Ecuador | A | |
| LTIP1901A | Lithuania | A | |
| PE12695A1 | Peru | A1 | |
| LT3323B | Lithuania | B | |
| FI954509A | Finland | A | |
| FI954509A0 | Finland | A0 | |
| NO953791D0 | Norway | D0 | |
| NO953791L | Norway | L | |
| MD940289A | Republic of Moldova | A | |
| HU9502752D0 | Hungary | D0 | |
| BR9405970A | Brazil | A | |
| PL310775A1 | Poland | A1 | |
| EP0691058A1 | European Patent Office (EPO) | A1 | |
| ES2080708T1 | Spain | T1 | |
| CN1119898A | China | A | |
| EE9400437A | Estonia | A | |
| HUT73125A | Hungary | A | |
| SI9420026A | Slovenia | A | |
| EP0691058A4 | European Patent Office (EPO) | A4 | |
| NZ263661A | New Zealand | A | |
| LV11510A | Latvia | A | |
| TR28486A | Türkiye | A | |
| BG100027A | Bulgaria | A | |
| JPH08510872A | Japan | A | |
| AU674406B2 | Australia | B2 | |
| IL108809AThis record | Israel | A | |
| CZ240895A3 | Czechia | A3 | |
| OA10229A | African Intellectual Property Organization (OAPI) | A | |
| EP0691058B1 | European Patent Office (EPO) | B1 | |
| AT162036T | Austria | T | |
| ATE162036T1 | Austria | T1 | |
| DE69407773D1 | Germany | D1 | |
| PL173533B1 | Poland | B1 | |
| ES2080708T3 | Spain | T3 | |
| SK118995A3 | Slovakia | A3 | |
| DE69407773T2 | Germany | T2 | |
| MY110488A | Malaysia | A | |
| PL174142B1 | Poland | B1 | |
| GR3026552T3 | Greece | T3 | |
| HK1002642A | Hong Kong, China | A | |
| HK1002642A1 | Hong Kong, China | A1 | |
| DK0691058T3 | Denmark | T3 | |
| CA2154789C | Canada | C | |
| HU216556B | Hungary | B | |
| CZ287151B6 | Czechia | B6 | |
| CN1064808C | China | C |
4 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Patent voidRH | RH | |
| Patent renewedKB | KB | |
| Patent renewedKB | KB | |
| Patent grantedGrantedFF | FF |
Numbers
- Publication, DOCDB
- 108809
- Publication, EPODOC
- IL108809
- Application
- 108809
- Application, DOCDB
- 10880994
- Application, EPODOC
- IL19940108809
Titles
- English
- Self-diagnostic apparatus and method for cellular-transceiver systems
Classification
- CPC, 2
- H04W24/00
- H04W84/14
- IPC, 9
- H04M3 22
- H04B7 26
- H04B17 00
- H04M1 00
- H04M1 24
- H04M3 08
- H04M11 00
- H04W24 00
- H04W84 14