Jump to content

HiassofT's Photo

HiassofT

Member Since 3 May 2006
ONLINE Last Active Today, 2:59 PM

Topics I've Started

Testers needed: AtariSIO with USB / standard serial ports

Fri Oct 19, 2018 12:26 PM

I recently implemented support for USB serial adapters and standard serial ports (like eg on RPi) in AtariSIO.

This means atariserver and atarixfer can also be used on non-x86 platforms and with serial ports other than 16550/16950.

On x86 PCs with a 16550/16950 serial port it is still (and always will be) recommended to use the kernel driver as it offers a lot more features and is more reliable than the new userspace implementation.

It's still very early days but so far things are looking quite good: atariserver worked with pokey divisor 0 on a FTDI SIO adapter and on an RPi2 with the simple "SIO2PI" levelshifter interface, atarixfer could access a 1050 Happy and Speedy in highspeed with these setups as well.

Some features of the kernel driver, like XF551 mode or FSK (copy protection) support in CAS files, will probably never make it into the userspace implementation because it's next to impossible to get the very tight timing right.

I've uploaded a first preview of the new version here:
http://www.horus.com...o-181019.tar.gz

To compile it you need the usual C development tools in linux plus the ncurses and zlib development packages. Eg in Debian/Raspbian just run this command to install those:
sudo apt-get install build-essential libncurses5-dev zlib1g-dev
Then to compile and install AtariSIO withot the kernel driver run these 2 commands in the unpacked AtariSIO source directory (of course you can also use the usual "make" / "sudo make install" procedure on x86 to also build the kernel driver):
make tools
sudo make tools-install
 
To use atariserver and atarixfer with a USB or standard serial port you have to start it with the "-f /dev/ttyXXX" option (note: this option has to be the very first options, all other options have to be set after these) or set the ATARISERVER_DEVICE and/or ATARIXFER_DEVICE environment variables. eg
atariserver -f /dev/ttyUSB0 -S 0 mydos.atr
 
By default atariserver will expect the command line to be connected to RING, to use DSR add the "-c" option, to use CTS add "-C" and if you don't have any command line and want to use the less reliable "no command line" mode add "-N".
 
Note: on RPi both the standard UART /dev/ttyAMA0 and the miniuart /dev/ttyS0 have support for RTS and CTS lines on GPIO pins, but these are disabled by default. I've included devicetree overlays to enable these in the contrib/rpi directory. Just copy these to /boot/overlays and then add either "dtoverlay=uart-ctsrts" or "dtoverlay=miniuart-ctsrts" to your config.txt. RTS is then available on GPIO 17 (pin 11 of the 40-pijn GPIO header) and CTS on GPIO 16 (pin 36 of the GPIO header). RTS is essential for using atarixfer (you need a command line to talk to a 1050) and CTS is nice to have because with a command line atariserver will work more reliable.
 
To connect a 1050 to the RPi you have to swap the TxD and RxD lines on the level shifter, connect RTS through the level shifter to the command line of the SIO port and connect the +5V output on GPIO pins 4 or 6 to the +5V line of the SIO port (a 1050 needs both, +5V input to detect the presence of an Atari and a command line).
 
Then you can create an ATR image of the floppy in your 1050 with eg this command ("-S" enables Happy/Speedy highspeed transfer - remove it if you have problems)
atarixfer -f /dev/ttyAMA0 -S -r my.atr
 
To write an ATR to a floppy use the "-w" option. eg:
atarixfer -f /dev/ttyAMA0 -S -w my.atr

It would be great to get some feedback about these new features, what works and what doesn't work, and I'm pretty sure there'll be some rough edges or bugs in this rather new code. Even if everything works fine on your setup I'd be glad to read a "works fine" or similar line to know about that :-)
 
so long & happy testing,
 
Hias