Sharp logo
MZ-700 Modems 
written by Tim Cowell / SUC/UK
Source: SUC-magazine March 1988, Volume 8, Number 1, pp. 45 - 50 

Modems


Following the request in the last magazine for someone to write Modem Software for the MZ700, I thought I would have a go. First I needed to connect a modem to my MZ700, I borrowed an appropriate modem from work and set about building a serial interface to connect it to. I then wrote some simple software which just sent characters to the modem from the keyboard and received characters from the modem and displayed them on the screen. The next step is to make the software a little smarter and easier to use, but wait until the next edition for that, this will give you plenty of time to acquire a modem and interface.

The interface was made compatible with the TO3-DUAL RS232 serial link for the MZ700, as sold by Peterson Electronics. This means that anyone unable to build the interface for themselves can buy a ready made & working equivalent from Peterson Electronics.
Their address is :-

Peterson Electronics Ltd.,
Academy Street,
Forfar,
Angus DD8 2HA

Tel. FORFAR 62591

Circuit


The circuit diagram for the serial interface is on the following page, it uses very few components, 5 chips, 3 resistors, 2 capacitors, a crystal, some switches and connectors. It offers two serial interfaces with switchable baud rates from 75 baud through to 9600 baud. I have designed the interface to provide one channel with full handshaking support for modems etc., and one channel with just transmit and receive data for non-intellegent devices like printers. This allows you to use a serial printer at the same time as the modem. If you require more handshake lines on the second serial port it is simply a matter of adding the drivers for them.

Diagram of the RS232 interface

A standard RS232 interface provides drivers capable of switching at +/- 12V, however this is very complicated to do on an MZ700 because it only has a 5V power supply. I have therefore given the interface 5 volt drivers, these work with most modem serial devices and should not therefore be a problem. I have used mine successfully to connect to an IBM PC, a serial printer and a modem.

Parts


All the components required for the interface are available from MAPLIN electronics, their catalogues are readily available from leading newsagents and their prices are quite fair. I assembled mine on a piece of vero-board 148 by 74 mm, using the wire wrapping system with prototyping pen, wire spools and wiring combs. It is also advisable to use IC sockets for all the IC‘s because this makes repairs and testing very much easier. The voltage on all pins of the circuit can be checked before the ICs are plugged in, possibly preventing a very expensive mistake. The crystal is standard microprocessor crystal at 2.4576 MHZ.

Shopping List

1 * Z80A DART & IC socket
1 * CD4060 & IC socket
1 * 74LS138 & IC socket
1 * 7404 & IC socket
1 * MC1489 & IC socket
2 * 39 pf capacitors
1 * 560k resistor
1 * 10k resistor
1 * 3k3 resistor
1 * 2.4576 MHz Crystal
2 * 8 way dip switches
1 * vero-board
2 * 9 way ‘D' type connectors ( male )
1 * 50 way IDC card edge connector
1 * 50 way PCB transition header
1 * approx. 1 ft by 50 way ribbon cable.

Connections


Connection to the MZ700 is made by a 50 way IDC Edge connector plugged into the Expansion port, a short length of 50 way ribbon cable into a 50 way PCB transition header soldered onto the interface. The pin numbers of the 50 way connector are given on page 141 of your MZ700 manual under the table P-11. Power for the interface can either be taken from the 4 pin internal plotter connector or one of the 5 pin joystick connectors.

The standard connector for serial interface, is the 25 way ‘D‘ type, however this is a bit on the large size and a better connector to use is the 9 way 'D‘ type. Many IBM compatible computers use this 9 way connector so this seems a reasonable decision, the pins used are :-

25 way
pin No.
9 way
pin No.
Name Direction
8
1
DCD Data carrier detect
input from modem
3
2
Rxd Received data
input from modem
2
3
Txd Transmitted data
output to modem
20
4
DTR Data terminal ready
output to modem
7
5
GND Common signal ground
 
6*
6
DSR Data Set ready
input from modem
4
7
Rts Request To Send
output to modem
5
8
Cts Clear To Send
input from modem
22*
9
Ring Indicator input from modem

Connections marked * are not implemented.

Technicalities


Baud rates are generated by the CD4080 which is an oscillator / counter, this provides 8 outputs which are various divisions of its 2.4576 MHZ input clock. By switching one of these outputs to the Z80A DART we can select the Baud rate. Switch A selects the channel A rate, switch B selects the channel B rate. It is important that only one switch 1 - 8 is closed at any one time. The switch settings are :-

Sw
1
2
3
4
5
6
7
8
Baud
75
150
300
600
1200
2400
4800
9600

The most common setting will be 1200 baud ( switch 5 on ), this is the baud rate of most low cost modems and printers.

These baud rates assume the Z80A DART is programmed for a clock rate of 16 times, which the sample software will use.

The IO addressing of the DART is a follows :-

Port Address DART Register
BC Channel A data
BD Channel B data
BE Channel A control
BF Channel B control

References


The Z80A Dart is software compatible with the Z80A SIO, of which there are many references, most Z80 books give examples of using a Z80 SIO. A particularly good one is Z80 Applications by James W. Coffron.

Programming


Assuming you have made your interface or bought one from Peterson Electronics you will want to test it. This can be done quite simply in BASIC, although BASIC is not really going to be suitable for the final modem software because it just isn‘t fast enough ! To begin with we will try the interface communicating with itself, to do this connect pins 2 and 3 of the channel A connector together. Now type in the following BASIC program :-

1 AC = $BE : AD = $BC
2 GOSUB 1000
3 CLS
4 INP#AC, D : IF D > 2 * INT( D / 2 ) INP#AD, D : PRINT CHR$( D );
5 GET A$ : IF ASC( A$ ) <> 0 OUT #AD, ASC( A$)
6 GOTO 4
7 END

1000 OUT #AC, $18 : REM RESET CHANNEL
1010 OUT #AC, $4 : REM SELECT REGISTER 4
1020 OUT #AC, $84 : REM 16 CLOCK, 1 STOP BIT, NO PARITY
1030 OUT #AC, $3 : REM SELECT REGISTER 3
1040 OUT #AC, $C1 : REM RECEIVE 8 BITS PER CHARACTER
1050 OUT #AC, $5 : REM SELECT REGISTER 5
1060 OUT #AC, $68 : REM TRANSMIT 8 BITS PER CHARACTER
1070 OUT #AC, $1 : REM SELECT REGISTER 1
1080 OUT #AC, $0 : REM NO INTERRUPTS
1090 RETURN

Line 1 defines the control register as address BE, and the data register as address BC. Line 2 calls the initialization subroutine which programs the Z80A DART. Line 4 tests the DART to see if a character has been received by it, if so it reads the character into D and displays the corresponding character. Line 5 tests the keyboard, if a key was pressed it is sent to the DART which will transmit it. There should be a test before doing this to make sure the DART is ready, but we are relying on the fact that there is no handshaking and the DART can send faster then we can type.

To test channel B connect channel B connector pins 2 and 3, then change line 1 to 1 AC = $BF : AD = $BD

When you type characters at the keyboard they should be sent through the DART and displayed on the screen. If you have a serial device, i.e. a printer, you can try connecting to this, whatever you type will be sent to the device. You must however check that you are using the correct baud rate etc.


Go to the top of this page      Get next page - part II      Home     

last updated October 17, 2003
SUC / UK: Tim Cowell