SIO2Arduino

SIO2Arduino is an Atari 8-bit (800/XL/XE) device emulator that runs on the Arduino platform. It currently emulates a single Atari 1050 disk drive (D1:) but there are plans to extend it to support multiple drives as well as other devices.

In its current state, SIO2Arduino allows you to put single and enhanced density Atari 8-bit disk images (ATR, XFD, XEX and many PRO and ATX) onto a microSD card and boot them on real Atari hardware.

Why SIO2Arduino?

Many years ago, I purchased and have continued to use the excellent APE software. However, I don't have a Windows machine anymore and breaking out the laptop (and Parallels) every time I want to use the Atari is a hassle. After my recent Arduino experience creating my company's Servus Pagerlink device, I thought it would be an interesting challenge to emulate an Atari drive.

My hope is that this device will eventually have many of the capabilities of APE but without the need for a PC. In order to accomplish that goal, I've decided to make this project open-source under the GPL. This way the device can be continuously improved by myself as well as others. I'm definitely not an Atari expert but there are still many out there that are. If you think you can contribute, please do!

SIO2Arduino vs. Others

I'm aware of two other devices (both excellent) that are very similar to this one: SIO2SD and SDrive. However, they both require purpose-built hardware and I was unable to find the firmware source for at least one of them. SIO2Arduino is built on a general-purpose, readily-obtainable hardware platform that has a thriving developer community.

I'm also not aware of any hardware based drive emulators that can emulate copy-protected disk images (e.g. APE ProSystem and VAPI).

Hardware

I've tried to make the supported hardware reasonably flexible so that people can build a la carte devices targeting different size and feature requirements. There are two pieces of hardware that are mandatory: an Arduino board and an SD card reader. The firmware currently supports the Arduino Uno, the Arduino Mega 2560/ADK and the Teensy 2.0. For an SD card reader, you can use an SD breakout board (Arduino Uno/Mega 2560), Arduino Ethernet Shield (Mega 2560 only) or Teensy SD Adapter (Teensy 2.0).

Optional hardware includes an LCD screen and physical buttons for image selection or auto-mounting an AUTORUN.ATR file.

Arduino Uno

If using an Arduino Uno, make sure the ARDUINO_UNO define in config.h is uncommented before compiling. You will also need an SD breakout board like the Adafruit one which is what I've tested with. The wiring is as follows:

Atari Data In  (SIO pin 3) -> Arduino digital pin 1 (TX) (note: this is usually the orange SIO cable)
Atari Ground   (SIO pin 4) -> Arduino ground (GND)
Atari Data Out (SIO pin 5) -> Arduino digital pin 0 (RX) (note: this is usually the green SIO cable)
Atari Command  (SIO pin 7) -> Arduino digital pin 2

SD board CS pin            -> Arduino digital pin 10
SD board DI pin            -> Arduino digital pin 11
SD board DO pin            -> Arduino digital pin 12
SD board CLK pin           -> Arduino digital pin 13
SD board 5v pin            -> Arduino 5V pin
SD board GND pin           -> Arduino GND pin
LCD Display (optional)
If you want to use an LCD display (like this one), make sure the LCD_DISPLAY define in config.h is uncommented and wire the LCD as follows:

LCD RD pin                 -> Arduino digital pin 4
LCD EN (E) pin             -> Arduino digital pin 5
LCD RW pin                 -> Arduino GND pin
LCD DB4 pin                -> Arduino digital pin 9
LCD DB5 pin                -> Arduino digital pin 8
LCD DB6 pin                -> Arduino digital pin 7
LCD DB7 pin                -> Arduino digital pin 6

When using an LCD, you may need to wire in a potentiometer for contrast adjustment. There is a nice tutorial here on how to do that.
Disk Image Selection Button (optional)
If you want a physical button to select disk images, make sure the SELECTOR_BUTTON define in config.h is uncommented and wire the button so that when it is pressed it shorts the Arduino digital pin 3 to GND.
Reset Button
If you'd prefer to use SDrive software rather than an LCD screen to select disk images, you'll need to wire up a reset button which changes the mounted drive image to AUTORUN.ATR on the SD card when pressed. Uncomment the RESET_BUTTON define in config.h (make sure SELECTOR_BUTTON is commented out) and wire a button so that when it is pressed it shorts the Arduino digital pin 3 to GND.

Arduino Mega 2560

If using an Arduino Mega 2560, make sure the ARDUINO_MEGA define is uncommented in config.h when compiling. The Mega 2560 has a lot more digital pins, more hardware UARTs and 4x the memory which will allow for more interesting features to be added in the future. There are two SD card options: either the same type of SD breakout board as used with an Arduino Uno or the Arduino Ethernet Shield.

The wiring is as follows:

Atari Data In  (SIO pin 3) -> Arduino digital pin 18 (TX1) (note: this is usually the orange SIO cable)
Atari Ground   (SIO pin 4) -> Arduino ground (GND)
Atari Data Out (SIO pin 5) -> Arduino digital pin 19 (RX1) (note: this is usually the green SIO cable)
Atari Command  (SIO pin 7) -> Arduino digital pin 2
SD Breakout Board (unneeded if using Ethernet Shield)
If using an SD breakout board, wire it to the Mega 2560 as follows:

SD board CS pin            -> Arduino digital pin 53
SD board DI pin            -> Arduino digital pin 51
SD board DO pin            -> Arduino digital pin 50
SD board CLK pin           -> Arduino digital pin 52
SD board 5v pin            -> Arduino 5V pin
SD board GND pin           -> Arduino GND pin
Arduino Ethernet Shield (unneeded if using SD breakout board)
If using the Arduino Ethernet Shield, simply plug it into the top of the Mega 2560 and make sure the ETHERNET_SHIELD define in config.h is uncommented.
LCD Display (optional)
If you want to use an LCD display (like this one), make sure the LCD_DISPLAY define in config.h is uncommented and wire the LCD as follows:

LCD RD pin                 -> Arduino digital pin 5
LCD EN (E) pin             -> Arduino digital pin 6
LCD RW pin                 -> Arduino GND pin
LCD DB4 pin                -> Arduino digital pin 10
LCD DB5 pin                -> Arduino digital pin 9
LCD DB6 pin                -> Arduino digital pin 8
LCD DB7 pin                -> Arduino digital pin 7

When using an LCD, you may need to wire in a potentiometer for contrast adjustment. There is a nice tutorial here on how to do that.
Disk Image Selection Button (optional)
If you want a physical button to select disk images, make sure the SELECTOR_BUTTON define in config.h is uncommented and wire the button so that when it is pressed it sends 5v to Arduino digital pin 3. Make sure you use a pull-up resistor as shown here: http://arduino.cc/en/tutorial/button.
Reset Button
If you'd prefer to use SDrive software rather than an LCD screen to select disk images, you'll need to wire up a reset button which changes the mounted drive image to AUTORUN.ATR on the SD card when pressed. Uncomment the RESET_BUTTON define in config.h (make sure SELECTOR_BUTTON is commented out) and wire a button so that when it is pressed it sends 5v to Arduino digital pin 3. Make sure you use a pull-up resistor as shown here: http://arduino.cc/en/tutorial/button.

Usage

There are two options for controlling what disk image is mounted in SIO2Arduino:

1. You can wire up an LCD panel and a disk image selection button as mentioned above. Each time you press the disk image selection button, the name of the currently mounted disk image will be output to the LCD. This method does not allow subdirectory navigation at the moment.

2. You can use the SDrive software and a reset button (uncomment RESET_BUTTON in config.h) to control which disk is mounted. You rename SDRIVE.ATR to AUTORUN.ATR and put it in the root of your SD card. When you press the reset button, the SDrive software will be automatically mounted. (Re)booting your machine will bring up the SDrive control program where you can navigate the images/subdirectories on the card and choose which one to mount.

Source Code

The latest C++ source code is available on GitHub.

Commercial Use

I obviously didn't create SIO2Arduino to make money or I wouldn't have made its firmware open source. I do ask that you don't just take the hard work that went into developing SIO2Arduino and start selling devices to make a quick buck. If you do decide to make money from it, I ask that you at least contribute something back to the project in the form of either additional firmware enhancements or a proceed from your device sales.

If there is enough demand, I might consider making pre-built, tested devices available at a reasonable cost (basically the cost of parts plus a little extra for my time). Please let me know if there's interest in that regard.

Contributions

Thanks to Chris Osborn for adding support for the Teensy 2.0.