2.13 Using the RS232 channel This was the only Spectrum i/o channel that could be used in the early versions of the emulator. Using .TAP files instead of the RS232 channel is often easier, but sometimes using the RS232 channel can be very useful too, for instance if you've got a null-modem lead that connects a Spectrum with interface I to the PC you can use it to transfer data and programs easily. Furthermore, the RS232 channel is the easiest way to let the emulator communicate with a PC printer. Several things send their output to the channel designated as 'RS232 output channel'. First of all the ordinary Interface I RS232 "B" and "T" channels. Secondly the 128K printer "P" channel. Thirdly, ZX Printer output is converted to a format appropriate for Epson or HP PCL printers (works for most dot matrix, and most laser/inkjet printers respectively) and also sent to this channel. Input from the 'RS232 input channel' is sent to the Interface I's "B" and "T" channels. The Interface I RS232 port, the "B" or "T" channel, behave slightly differently. The first, binary, channel is the raw channel. It will let all data go through unchanged. The "T" channel won't let all control codes through and will expand any keyword; useful for LISTing a program but otherwise annoying. The Spectrum 128 has its own RS232 port; it is called the "P" channel. Output to either the Interface I's or Spectrum 128's own RS232 port will all be processed as 'RS232 output'. The output to the RS232 channel can be routed to an LPT port, to a COM port or to a file on disk. Input can come from either a file or a COM port. If you want to use the RS232 channel for printing using LPRINT and LLIST (shorthand for PRINT #3 and LIST #3), be sure to open that channel for output to RS232; by default it sends its output to the ZX Printer, which is not supported. You can open the channel by typing OPEN #3,"B" (or "T" for listings, or "P" on a Spectrum 128). Input and output are buffered. This is important to remember when you're transferring files using the SAVE and LOAD *"b" commands of the Interface I. If the header is missed, for instance if you try to load the wrong file type, re-sending the file will not directly work because there will still be bytes in the buffer. You have to clear the input buffer before re-sending the file. When inputting from a disk file, the file pointer can be reset to point to the start of the file again to re-read the header. When inputting from or outputting to a disk file, the read or write position is displayed as a byte-count. An sign will appear if an input file is read completely through to the end. The RS232 redirection options are in the Change Settings (F4) menu. When using a COM port, make sure you have initialised it before starting the emulator with the Dos MODE command, for instance MODE com1:96,n,8,1 initialises COM1 to send and receive at 9600 baud, no parity, 8 data bits and 1 stop bit, the default for the Interface I. Here is how to transfer programs from a Spectrum to the PC using the RS232 lead. First, you need a null-modem lead. I myself use the following cable: Spectrum 'AT' 'PC' (9 pins) (9 pins) (25 pins) 3 TxD ------------------------- RxD 2 3 4 DSR ------------------------- DTR 4 20 +---- CTS 7 4 +---- RTS 8 5 7 GND ------------------------- GND 5 7 (so CTS and RTS have to be connected!) This is not a full null-modem lead; you can only send data from the Spectrum to a PC. If you have an Interface I, you can use the LOAD *"b" and SAVE *"b" commands on both your real Spectrum and the emulator to transfer programs and data. It's best to first type LOAD *"b" and then SAVE instead of the other way around. If you have problems with transferring data, try to lower the baud rate to 4800 or 2400 baud; this sometimes helps. If you don't have an Interface I, but do have a printer interface using RS232 leads, then you can transfer data using LPRINT on the Spectrum side, and INKEY$ #3 on the emulator side. It needs a little bit of programming.