AOH :: DIAL.TXT How to program a 1650 or similar modem to do pulse auto-dialing
```

Many modems, that are available for the Commodore 64 and 128, can be
classified as "dumb" modems. Unlike the Hayes standard "smart" modems, the
features of a dumb modem are almost exclusively software controlled.

The major example of a software controlled function, is auto-dialing.
Dialing is by no means automatic. It is a semi-complicated
toggling of the modem on and offline. Despite this sounding rather
undependable, it is in fact the method that electronic phones use, when
they pulse dial.

The following is intended as a guide for terminal programmers who wish
to write their own pulse dialing routines. The first part outlines the
dialing process. The second describes how the following process can
can be applied to the popular modems.

The dialing process consists of the following steps:

1: Put the modem online. A delay is now necessary, to give the telephone
exchange sufficient time to supply a dial tone. 1.5 to 2 seconds is
usually enough, but this might be different for your particular
exchange.

2: Form a PULSE COUNTER using next digit of the phone number. Digits 1-9
are converted to the representative value 1-9 in the counter. Zero
are represented by the representative value 1-9 in the counter. Zero
is special. As zero doesn't convey information, the digit zero
is converted into 10 pulses (counter = 10).

3: The pulse loop commences. The toggling of the modem on/offline is
timed as follows:

a) Put modem offline for 60 milliseconds. Modem back online.
b) Delay for 40 milliseconds.
c) Decrement pulse counter. If pulse counter is not zero go
back to step a).

4: An inter-digit delay for 700 milliseconds. If all digits of
phone number have not been dialed, go back to step 2.

5: Wait for carrier.

The above delays can be considered the maximum needed for dependable
dialing. I have found that 40/30/300 to be as dependable. Your range will

An example delay routine in BASIC:

10 t=value: rem value is milleseconds/10 eg 700 -> value = 70
20 t=t-1: if t<>0 then 10

I've written an ML version, but, if your doing it in ML, then that's a
nice exercise (grin).

PART 2:
-------

It seems like every modem manufacturer takes great pride in making
their modem operate differently from their competitor's. Fortunately,
through the fog, there is light. The dialing mode of nearly all 64/128
dumb modems can be classified into two categories:

1) 1650 compatible. eg Pocket modem, 1064, 64 Modem

2) 1660 compatible. eg Mitey Mo, HES-II

The computer communicates with the modem via the user port, which is
hooked to the NMI generating CIA chip. The location that concerns
the programmer, is dec 56577 (\$DD01) which is Data Port B of this CIA.

The Data Direction Register at location 56579 (\$DD03) controls the
direction (in or out of the computer) of the lines represented in 56577.

POKE56579,38   This is a universal POKE. In addition to the hook line, this
sets as outputs the lines Request to Send, and
Data Terminal Ready. These are used by modems for
various purposes, but the POKE is common. The other 5
lines are inputs.

Bit 5 of 56577, and its corresponding line, are used by the
Commodore compatible dumb modems, for controlling the hook. By toggling
this bit, the modem can be put on and offline, or, if you prefer,
off and on hook.

The on/offline POKEs in BASIC are:

Modem             Online                       Offline

1650 compatible    POKE56577,PEEK(56577)OR32    POKE56577,PEEK(56577)AND223
1660 compatible    POKE56577,PEEK(56577)AND223  POKE56577,PEEK(56577)OR32

As you can see, the logic for the 1650 and 1660 are exactly opposite. The
reason the change was made (the 1660 being a later design), was probably
because the 64 defaults to bit 5 on, and thus a 1650 defaults online,
even when not in use.

This should give you information to get started. Please feel free to
leave me any questions you have.

GOOD LUCK!

Sysop Gary Farmaner.  Compuserve

```

The entire AOH site is optimized to look best in Firefox® 3 on a widescreen monitor (1440x900 or better).