0 = carrier or data on the phone line, 1 = no carrier
Out ports:
OUT184,# (Reset button will reset any of these)
bit 1 - disable all keys accept for BREAK and PAUSE.
bit 2 - freeze the computer.
bits 1 & 2 - power off, then resume when turned back on.
OUT184,195 - resets the frequency of tone generator.
OUT185,#
bits 0 through 7 is a data byte for the printer.
OUT186,# (its status can be read)
bit 4 - power off.
bit 5 - buzzer toggle (1 = enable tone generator).
bit 7 - send a pulse to the phone line.
OUT186,47 - turns tone generator off.
OUT188,a OUT189,b (a = 0 to 255, b = 64 to 128)
Sends frequency values to the tone generator.
To use the tone generator execute the following:
OUT186,32:OUT188,a:OUT189,b:OUT184,195
OUT232,# (to send any character to the printer, strobe an ACK signal
through this port after a character is latched to port 185)
bit 0 - ACK signal of the printer port:
1 = low, 0 = high
bit 1 - cassette motor on/off:
1 = MOTORON, 0 = MOTOROFF
bit 2 - phone line relay for TELCOM:
1 = on, 0 = off
Using the printer port to interface to the real world:
The BUSY line of the printer port and Barcode reader port can detect a low/high signal. By combining these two inputs with the DATA lines of the printer port 16 independent inputs are possible.
This can be done by having the DATA lines 'select' which inputs are to be read by port 185. Since each DATA line can have either a 1 or 0 depending on what value was sent to the port they can be tied to the BUSY line (pin #25) and give different inputs.
For example if DATA line 0 (pin #3) is connected to BUSY line, sending a value of 254 (1xor255) which pulls bit 0 low and the others high will give a not busy signal, and sending 255 will give a busy signal.
In this way the status of a switch connected between a DATA line and BUSY line can be read, and 8 switches can be connected to one input line and read one at a time. To demonstrate this run the following:
After running it, if a jumper wire is placed between BUSY line and a DATA line (pins 3,5,7,9,11,13,15,17) the corresponding bit will show in inverse graphics.
Machine code is used to read the port, it can be done in Basic but the value latched to port 185 drifts and only machine code can read it before it escapes.
Note: the machine code is stored in a character string so it is safe to run on either the 100 or 200.