The SIO protocol description Written by Draco, 18Sep1996 Last update 7Nov1996 What is the SIO? ---------------- The SIO stands for the "Serial Input/Output". It is a data transfer protocol used by the Atari 8-bit machines to communicate with a printer, disk drive, modem etc. via the SIO connector. These transfers are controlled by the PokEY chip. Is this something like RS-232? Basically, yes. It is possible to connect the SIO port to a RS-232 port, the only one you should change is the voltage: the SIO uses TTL-signals. Serial transfer parameters usually are as follows: * 1 start bit * 1 stop bit * 8 data bits * No parity control * 19200 bits per second The last parameter may vary, as for example so called "cassette recorders" (who can remember such data storage?) use 600 baud; also some disk drives may operate at 38400, 52000, 67000, 96000 or 125000 baud. SIO commands: ------------- The command block contains 4 (four) bytes: * CDEVIC - device ID, e.g. $31 for the DI:, $32 for the D2: etc. * CCMND - command * CAUXI * CAUX2 - sector number (low/high) Most commonly used commands (DCMND values) for disk drives are as follows: * $50 (P) - put a sector (128 or 256 data bytes to the drive) * $52 (R) - read a sector (128 or 256 data bytes from the disk drive) * $53 (S) - read status (4 data bytes from the drive) * $57 (W) - write sector (the same as P command, but with verify) * $21 (!) - format disk (128 data bytes from the drive, 18 sectors per track) * $22 (") - format disk in the medium density (128 data bytes from the drive, 26 sectors per track) * $4E (N) - read configuration (12 data bytes from the drive) * $4F (O) - set configuration (12 data bytes to the drive) Communication: -------------- * first, the computer sets the COMMAND line at the SIO connector * then sends the command block (4 bytes + checksum) * then waits for a response (1 byte without a checksum): + $41 (A) = Acknowledge, the command is valid and will be executed + $4E (N) = Negative, the command is invalid. * if the device responds "N", the transfer is aborted. * otherwise ("A") the data block is transferred with the checksum. * now the computer waits for a final acknowledge (1 B without a checksum): + $43 (C) = Complete, operation completed successfully. + $45 (E) = an Error has occurred.