IPABXwPP
by Jacob Blichfeldt

IPABXwPP (Intelligent Private Automatic Bi-eXchange with Privacy Phone) is a small devices for use with TeleDanmark's service called 'distinctive ringing' (in danish: Nummer-bestemt ringning).

It gives the possibility of getting one or two phonenumbers attached to your primary number.
Calling the 2nd (or 3rd) number will generate a different ringing-pattern, making it possible for the user to know (by listening) which number is called.

It's perfect for subscribers having kids (which can get their own number) or wants another number for their fax-machine/modem. When the phone rings, it's possible to determine which person should answer the phone, simply by listening to the pattern.

The price for this service is (at 13.03.98) 40DKr every third month.

The problem with using the service, is that even though the phone-call is for the kids (or the fax), it's still ringing all over the house. This is where the idea for IPABXwPP came up.

Features:

TeleDanmark is probably not the only Telephone-company offering this service, so it should be possible to use IPABXwPP in other countries than Denmark. (The software might have to be changed a little).


The ringing patterns:

Normal ringing:
Ring    -------                                     -------   750ms+/-20%
Pause          -------------------------------------       --7500ms+/-20%

Notation ringing:
Ring   ---   ---   ---   ---   ---   ---   ---   ---   ---    330ms+100ms/-10%
Pause     ---   ---   ---   ---   ---   ---   ---   ---   --- 330ms+100ms/-10%

Distinct ringing 1 (typically used for telefax ringing):
Ring   ---            ---            ---            ---	      300ms+100ms/-10%
Pause     ------------   ------------   ------------   ------1200ms+100ms/-10%

Distinct ringing 2 (Voice-phonenumber #2):
Ring   -----       -----       -----       -----       -----  500ms+100ms/-10%
Pause       -------     -------     -------     -------     - 700ms+100ms/-10%

Deviations:  ex. 500ms+100ms/-10% = 450->600ms


Detailed description of operation:
The hardware is built around a PIC16F84 (PIC16C84, or any other 16Cxx) or a PIC12C508 (any PIC16C5x), and contains only a few external components. The oscillator-frequency on 4MHz (when using a 16F84) was chosen because it's widely available.

The Privacy Phone is implemented in software (turns off 2 lines, and checks if still offhook, if not, tries another combination of 2 lines until it determines which line is in use). It takes about 50ms, and is not noticeable by the user.

Ring-detection/offhook detection is implemented with a couple of resistors and some zener-diodes, and decoding is done in software.

The LED lights whenever theres an incoming call, and it flashes (short) in the normal state. If the phone is in use, it flashes slow. Fast flashes show whish line was called last (1 for diff. line 1, 2 for diff. line 2, and 3 flahses for the normal line).

I have drawn a PCB for the PIC12C508 version (components layer). As the circuit is fairly small it's also easy to build on a piece of veroboard.

If the wiring in the house doesn't allow IPABXwPP to be installed 'in front' of all tele-equipment, use the following solution:
Place a 12C508 based IPABXwPP with only one relay, in front of each telephone. It can be build for less than $10/each. The phone then rings, depending on which output the relay is connected to.


The SOFTWARE is fairly documented, with both Nassi-Shneidermann diagrams (below), and extensive use of comments in the source (click the subroutines in main and ISR, to view the lower level).
The NS-diagrams were made in a demoversion of Siemens EasyCODE (SPX).

Ringing-type detection Idle state detection
NS-diagram of IPABXwPP
NS-diagram of Init NS-diagram of Main

The basic flow in software is: The 'real' flow is a bit more complex, as I had to fix some problems with IPABXwPP 'picking up the phone' after the 30s delay (when having many phones connected to one line).
The phones on the line not ringing, was in the first versions switched totally off in 30s, and when the line was switched on and capacitively loaded by the phones, the exchange 'thought' the line was offhook in a couple of hundred milliseconds.

The problem was removed by swithing on all lines in spaces between rings, thereby not allowing the phones on the other line to discharge completely. Sometimes this can give problems with 'tinkling' on phones connected to a line which should not ring, so it's optional (with a 'switch' in the source-file).

Slope ringdetection Privacy Phone Update ringing-timers Update led

NS-diagram of ISR

The ISR (Interrupt Service Routine) takes care of updating all timers, I/O-operations etc. It's called every 5th millisecond.


The source is not optimized for speed, as it wasn't necessary. It uses about 350 words, and can therefore be implemented in most 16Cxx device. The software were originally written for a 16F84, using a T0 interrupt, but were later rewritten for use on a 12C508 (which hasn't got any interrupt-capabilities). If the circuit is built with a 12C508, change the PROCESSOR-directive, and assemble the file.


History:
Version Changed Reason Date
1.40r Implemented LED-flashing:
Slow/short flash - Idle state
Constant on - Incoming call
Fast blinking - Phone in use

Fast/short flash:
Shows which line was called, untill the phone is picked up. Makes it possible to see if the phone rang, but wasn't picked up.
1 short flash shows that diff. line 1 was called, 2 shows that diff. line 2 was called, and 3 shows that the 'normal' line was called.
- 09.07.98
1.35 Changed way of detecting privacy phone.
Optimized the source a bit (saved about 20-25 words in codesize).
Problems when using more than 1 IPABXwPP on the same line.
-
09.07.98
1.34 Changed "lines switched on in pauses between ringing" to 'optional'. Suppress relay-noise/tinkling on some (sensitive) phones. 08.07.98
1.33r Fixed a major bug (software not working at all in a 12C50x). Halted at initialization, until WDT timeout. Different implementation of FSR between 12C50x and 16Cxx. (Not possible to check for FSR overflow using the zeroflag on a 12C50x). 07.05.98
1.32r First 'public' release. - 13.03.98

Read the history at the end of the source-file (main.asm) for description of previous revision.


Download:
Ipabxsrc.zip 32KB IPABXwPP 1.40 source and hex-file.
Ipabxwpp.zip 210KB The complete package, including circuit-diagram, PCB-layout, NS-diagrams, source-code and hex-file.
Ipabxepp.zip 59KB Circuit diagram and PCB-layout EPS format (Encapsulated PostScript).


HOME