M20 Olivetti M20

Transferring files using a RS232 connection

by Davide Bucci

The Olivetti M20 has a RS232 interface mounted on the motherboard. RS232 is a standard used to set up a serial communication between a wide range of devices. A lot of modern PC include a RS232 interface, even if recently it becomes to be superseded in favor of USB. Anyway, cheap USB/RS232 adaptors are available for PC and Macintosh computer.
It is interesting to create a cable to use the interface to communicate with an another system. Expanded M20's could mount 2 additional RS232 interfaces, here we refer only to the first one.

The serial connector on the Olivetti M20 This is the pinout of the serial connector you can see on the back of the M20 (the leftmost connector on the lower row). This image is taken from the Olivetti M20 hardware description manual.

The DB9 serial connector This is the pinout of a DB9 connector you most likely can find on the back of your PC. This image has been found in the Internet thanks to google images :-)

It becomes easy to fabricate a null-modem cable:

M20 connector pin: Female DB9 pin:
1 (TXD) 2 (RXD)
2 (RXD) 3 (TXD)
3 (DTR) 6 (DSR)
4 (DSR) 4 (DTR)
5 (CTS) 7 (RTS)
6 (RTS) 8 (CTS)
9 (GND) 5 (GND)

The PC used to transfer the disks Once you fabricated a cable, you need a program to implement a protocol to transfer files between the Olivetti M20 and another system. I choose the XMODEM, which is a simple transmission protocol in which the files are transmitted in 128 bytes long packets, with a checksum and a simple software handshake system.

On the PC (or Macintosh) side, you have to find a program able to understand the XMODEM protocol. In my case, I used a laptop PC running Linux and Minicom, which is a menu driven terminal emulation program.
On the M20, I did not have a terminal emulation program, so I decided to write one of my own. Unfortunately, I was not able in BASIC to transfer correctly a bynary file (problems with the ASCII 0 character). Anyway, this method should work very well with BASIC files.
You first have to load and make resident the routines needed to use the serial port. To do this, type at the PCOS prompt:
pl ci
You then must configure and open the serial port on the M20. I choose a 9600 baud, 8N1 protocol without XON/XOFF and hardware handshake and a buffer of 256 bytes. To select it, you should type on the PCOS prompt:
sc com:, 9600, none, 0,8,half,off,256
Remember to use the same port configuration on your PC running the XMODEM uploader. On an unexpanded M20, you should reconfigure the BASIC interpreter to use less memory to leave the space for the resident RS232 routines:
sb 3,30000,16,256
You can now start the Basic interpreter with:
and open the communication port with the command:
call "ci"(0,"o",&E%)
You can now load or type on the M20 xreceive.bas, which implements the XMODEM downloader. You start the transmission on the uploader. After you run xreceive.bas, you are asked the name to be given to the file that will be downloaded. After that, the download will begin.
You find BASIC files to download in the corresponding section of the site.

Page log

  • Feb. 11, 2024 - Added this log.
  • Mai. 1, 2007 - File transfer pages reorganized.
  • Nov. 7, 2005 - Original version of the page.

M20 lineart decoration


Search in the M20 site
Search in the Internet