Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions Operating_Instructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Instructions
==============

Normal dialing
==============

Just pull the dial round from the desired number to the fingerstop and release immediately.

Dialing * and #
===============

for * pull the dial from "1" and hold on the fingerstop for 2 seconds until you hear a beep, release, and a tone for * will be generated.

For # do the same but use "2".

Redial
======

Pull the dial around from "3" and hold on the fingerstop for 2 seconds. Release when you hear the beep, and the last number will be redialed.

Speed dials
===========

There are 7 speed dial locations. 0, 4, 5, 6, 7, 8, 9. Pull the dial around to the fingerstop and hold for 2 seconds, release when you hear the beep and the desired number will be dialed.

Programming a speed dial
========================

Pull the number of the desired location around to the fingerstop and hold for 4 seconds, you will hear a quick rising-tone beep. Release the dial.

You are now in programming mode. Now simply dial out the number you wish to store, releasing the dial immediately after each digit. You will hear a simple beep after digit. Once complete, hang up, the number is now saved.

Up to 32 digits may be saved in each speed dial location. If you enter too many digits a warning beep sequence will sound.

If you want to program another number without hanging up, just finish programming the last number, then select the next memory location to store by holding that digit against the finger stop. Allow the modes to cycle (single beep > rising beeps) until the rapidly rising beep tone is heard and release the dial. Program the number for this location as above.

When doing this you will likely have your telephone exchange furiously beeping at you because you haven"t dialed a number. If annoying, you should dial a number known to be busy or with a recording, while programming.

Hotline Feature
===============

The device can automatically dial a pre-programmed number when the receiver is taken off-hook.

Program the desired hotline number into memory "0" as described above.

Dial and hold the "1" digit against the finger stop for 4 seconds until a beep is heard. Release the dial. A series of slow ascending tones will sound, followed by one beep, indicating the hotdial feature is now active and set for one second delay from off-hook to dial.

Repeat the process. Two beeps will be heard, indicating a two-second delay is active. Three and four second delays may be set in a similar fashion.

After setting a four second delay, if the programming sequence is repeated, s slow descending series of tones will be heard. indicating the hotline feature is disabled.

Hotline settings are saved in nonvolatile EEPROM memory.


Adjusting tone length
=====================
The length of each DTMF tone may be set, from the default of 100 milliseconds. Supported lengths are 50ms, 100ms, 150ms, and 200ms.

Dial and hold the "2" digit against the finger stop for 4 seconds until a beep is heard. Release the dial. A sequence of beeps will play, indicating the set digit duration. One beep = 50ms, two beeps = 100ms, three beeps = 150ms, and four beeps = 200ms. The setting wraps back from 200ms to 50ms.

The tone duration setting is saved in nonvolatile EEPROM memory.


MF (multifrequency) "Blue Box" mode (optional)
==============================================
The unit may be switched so that MF multifrequency trunk signalling tones are played, rather than standard DTMF.

If equipped in software, dial and hold the "3" digit against the finger stop for 4 seconds until a beep is heard. Release the dial. A series of slow ascending tones will sound, indicating that MF mode is active.

To return to normal DTMF mode, repeat the above procedure. Slow descending tones indicate MF mode is off.

Manual dialing is done normally. To dial the "KP" or Key Pulse tone, pull the dial from "1" and hold on the fingerstop for 2 seconds until you hear a beep, release, and a tone for KP will be generated.

For the ST or Start tone, do the same but use "2".

To dial a long 2600Hz trunk seizure tone, pull the dial from "3" and hold on the fingerstop for 2 seconds until you hear a beep, release, and a long 2600 tone will be generated.

Memories saved in MF mode will be played back using MF tones regardless of the current mode of the unit, DTMF or MF (the tone mode is saved along with the digit sequence).

The 2600Hz tone may be saved to a memory like any other tone (in MF mode only, of course). A suitable delay will be inserted after the 2600Hz tone is played from memory to allow time for the trunk wink acknowledgement.

The hotline number, if programmed and used will always play back from memory "0". Memory "0" should be programmed while in DTMF mode when used for hotline operation. If programmed in MF mode, MF tones will be played when going off-hook, resulting in a failed call.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
This code is a branch from Matthew Millman's excellent Pulse > DTMF converter project, which converts a rotary dial telephone to DTMF operation. This branch adds a "blue box" or MF multifrequency mode.

I cleaned up a few operating anomalies and added adjustable DTMF tone length (saved in EEPROM) and a "hotline" mode that auto-dials the number stored in speed dial location zero whenever the phone is taken off-hook.

The time between going off-hook and the start of dialing is adjustable and also saved in EEPROM.

I updated the hardware design schematics to include a diode bridge for polarity protection, as the voltage regulator used is subject to damage if the telephone wiring is polarity reversed from the standard arrangement.

I also added a zener diode to the circuit to assure sufficient voltage is available to the input of the voltage regulator for most telephones and loop currents.

Without the zener diode, certain ATAs with low voltage/current or telephones with low internal network resistance would not develop enough voltage drop to power the unit reliably.

Bugs fixed are the failure to return to normal dialing mode after speed dialing or playing the * or # tones. This made it impossible to use DTMF on a connected call after initial dialing.

I also made it possible to save the * and # tones in speed dial and last number memories.

I also added a "blue box" mode that adds the multifrequency dual-tone "MF" signals historically used by the US long distance network.

"Phone phreaks" could use these tones in conjunction with the 2600Hz supervisory tone to take over a long distance call and re-route it, for free. Google for additional info.

I run an Asterisk server at +1 630-485-2995 which accepts these tones and allows blue box phreaking in a legal environment using a blue box or this circuit with a rotary phone.

Blue box mode is entered by hold-dialing digit 3 for four seconds. MF mode is signified by ascending beeps.

In blue box mode, normal dialing results in the special MF tones. The dialing sequence for * and # generates "KP" and "ST" tones.

Last number dialed recall is disabled in MF mode. Instead, hold-dialing digit 3 produces a 2600Hz tone to seize a trunk.

With this code version, the tone mode (DTMF or MF) is stored in EEPROM memory. Therefore, a mix of DTMF and MF tone sequences may be saved in the speed dial memories. 2600Hz may also be saved and played back.

Both DTMF and MF tone sequences in speed dial memories may be played back in either DTMF or MF mode.

Exit MF mode by hold-dialing digit 3 for 4 seconds. Descending tones indicate entry to DTMF mode.

The hot line number will always play back in DTMF mode. Memory zero should be programmed in DTMF mode if using the hotdial feature.

Numbers are not saved to the last number dialed memory while in MF mode and are therefor retained when returning to the DTMF mode.
5 changes: 5 additions & 0 deletions attiny85_fuse_settings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Correctly set fuse bytes:

LFUSE: 0xFD
HFUSE: 0xDF
EFUSE: 0xFF
79 changes: 74 additions & 5 deletions dtmf.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,40 @@ const uint8_t auc_sin_param[NUM_SAMPLES] = {
// 852hz ---> x_SW = 56
// 941hz ---> x_SW = 61
//
//MF Frequencies
//700hz ---> x_SW = 46
//900hz ---> x_SW = 59
//1100hz ---> x_SW = 72
//1300hz ---> x_SW = 85
//1500hz ---> x_SW = 98
//1700hz ---> x_SW = 111
//
//Trunk Seize Frequency
//2600hz ---> x_SW = 170
//
// | 1209 | 1336 | 1477 | 1633
// 697 | 1 | 2 | 3 | A
// 770 | 4 | 5 | 6 | B
// 852 | 7 | 8 | 9 | C
// 941 | * | 0 | # | D
//
//Digit 0 85 98
//Digit 1 46 59
//Digit 2 46 72
//Digit 3 59 72
//Digit 4 46 85
//Digit 5 59 85
//Digit 6 72 85
//Digit 7 46 98
//Digit 8 59 98
//Digit 9 72 98
//KP 72 111
//ST 98 111

//2600 Seizure 170 170


const uint8_t auc_frequency[12][2] =
const uint8_t auc_frequency[26][2] =
{
{ 87, 61 }, // 0
{ 79, 46 }, // 1
Expand All @@ -111,9 +138,26 @@ const uint8_t auc_frequency[12][2] =
{ 96, 56 }, // 9
{ 79, 61 }, // *
{ 96, 61 }, // #

{ 0, 0 }, // # Placeholder for DIGIT_PRE2600

{ 85, 98 }, // 0
{ 46, 59 }, // 1
{ 46, 72 }, // 2
{ 59, 72 }, // 3
{ 46, 85 }, // 4
{ 59, 85 }, // 5
{ 72, 85 }, // 6
{ 46, 98 }, // 7
{ 59, 98 }, // 8
{ 72, 98 }, // 9
{ 72, 111 }, // KP
{ 98, 111 }, // ST

{ 170, 0 }, // 2600
};

volatile uint32_t _g_delay_counter; // Delay counter for sleep function
volatile uint32_t _g_delay_counter; // Delay counter for sleep function
volatile uint8_t _g_stepwidth_a; // step width of high frequency
volatile uint8_t _g_stepwidth_b; // step width of low frequency
volatile uint16_t _g_cur_sin_val_a; // position freq. A in LUT (extended format)
Expand Down Expand Up @@ -142,15 +186,16 @@ void dtmf_generate_tone(int8_t digit, uint16_t duration_ms)
{
GIMSK = 0;

if (digit >= 0 && digit <= DIGIT_POUND)
if (digit >= 0 && digit <= DIGIT_2600)
{
// Standard digits 0-9, *, #
_g_stepwidth_a = auc_frequency[digit][0];
_g_stepwidth_b = auc_frequency[digit][1];
dtmf_enable_pwm();

// Wait x ms
sleep_ms(duration_ms);
if(digit == DIGIT_2600){sleep_ms(DURATION_MS_2600);}
else{sleep_ms(duration_ms);}
}
else if (digit == DIGIT_BEEP)
{
Expand Down Expand Up @@ -183,6 +228,18 @@ void dtmf_generate_tone(int8_t digit, uint16_t duration_ms)
sleep_ms(duration_ms / 3);
_g_stepwidth_a = 51; // G=784Hz
sleep_ms(duration_ms / 3);
}
else if (digit == DIGIT_TUNE_ASC2)
{
_g_stepwidth_a = 85; // 1300Hz
_g_stepwidth_b = 0;
dtmf_enable_pwm();

sleep_ms(duration_ms / 6);
_g_stepwidth_a = 98; // 1500Hz
sleep_ms(duration_ms / 6);
_g_stepwidth_a = 111; // 1700Hz
sleep_ms(duration_ms / 6);
}
else if (digit == DIGIT_TUNE_DESC)
{
Expand All @@ -196,6 +253,18 @@ void dtmf_generate_tone(int8_t digit, uint16_t duration_ms)
_g_stepwidth_a = 34; // C=523.25Hz
sleep_ms(duration_ms / 3);
}
else if (digit == DIGIT_TUNE_DESC2)
{
_g_stepwidth_a = 111; // 1700Hz
_g_stepwidth_b = 0;
dtmf_enable_pwm();

sleep_ms(duration_ms / 6);
_g_stepwidth_a = 98; // 1500Hz
sleep_ms(duration_ms / 6);
_g_stepwidth_a = 85; // 1300Hz
sleep_ms(duration_ms / 6);
}

// Stop DTMF transmitting
// Disable PWM output (compare match mode 0) and force it to 0
Expand Down Expand Up @@ -258,4 +327,4 @@ void sleep_ms(uint16_t msec)
{
sleep_mode();
}
}
}
20 changes: 20 additions & 0 deletions dtmf.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,31 @@
#define DIGIT_BEEP_LOW -13
#define DIGIT_TUNE_ASC -11
#define DIGIT_TUNE_DESC -12
#define DIGIT_TUNE_ASC2 -14
#define DIGIT_TUNE_DESC2 -15
#define DIGIT_OFF -1
#define DIGIT_STAR 10
#define DIGIT_POUND 11
#define DIGIT_PRE2600 12 //Use to play pending 2600 tone

#define DIGIT_MF0 13
#define DIGIT_MF1 14
#define DIGIT_MF2 15
#define DIGIT_MF3 16
#define DIGIT_MF4 17
#define DIGIT_MF5 18
#define DIGIT_MF6 19
#define DIGIT_MF7 20
#define DIGIT_MF8 21
#define DIGIT_MF9 22
#define DIGIT_MFKP 23
#define DIGIT_MFST 24

#define DIGIT_2600 25

#define DTMF_DURATION_MS 100
#define MF_DURATION_MS 100
#define DURATION_MS_2600 1500

// PWM frequency = 4Mhz/256 = 15625Hz; overflow cycles per MS = 15
#define T0_OVERFLOW_PER_MS 15
Expand Down
Binary file added generic_schematic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading