Jump to content
IGNORED

SIO2PI -> Raspberry Pi as a floppy


TheMontezuma

Recommended Posts

The Raspberry Pi is a small and inexpensive computer http://www.raspberrypi.org/faqs,

that can also emulate ATARI floppies.

 

It is shipped with UART.

To build a SIO2PI Adapter you will need a level shifter (3.3V <-> 5V).

There is an existing solution for it:

Logic Level Converter Sparkfun BOB-08745

http://www.sparkfun.com/products/8745

 

However one problem still exists.

The SystemOnChip used in Raspberry Pi http://www.raspberry...Peripherals.pdf supports UART with Handshaking, but the Raspberry Pi hardware developers decided for some reasons not to provide the CTS Signal on the GPIO header http://elinux.org/RPi_Low-level_peripherals

 

I found a workaround for it.

I have connected the "command" signal from SIO to one of the I/O PINs of the Raspberry Pi and adapted the Software (AspeQt).

 

post-29824-0-11023200-1361051315_thumb.jpg

 

Atari 2 Level Shifter

SIO 3 (data in) -->|--- TXO (Chan1) via diode (for example 1N5817) direction from Atari to the level shifter
SIO 5 (data out)	 - RXI (Chan1)
SIO 10 (+5V)		 - HV
SIO 4 (gnd)		 - GND
SIO 7 (command)	 - RXI (Chan2)

Level Shifter 2 Raspberry Pi

TXI (Chan1) - P1_08 (GPIO14 / TxD)
RXO (Chan1) - P1_10 (GPIO15 / RxD)
LV		 - P1_01 (+3,3V)
GND		 - P1_06
RXO (Chan2) - P1_11 (GPIO17)

 

Alternatively you can use USB2Serial adapter together with a SIO2PC adapter.

I have tested both variants (FTDI and Profilic).

 

To use UART for our goals, we need to edit two files on the Raspberry:

/boot/cmdline.txt

/etc/inittab

More details:

http://www.irrationa...is-serial-port/

 

Now we need the software.

I've tested two software tools with the Raspberry Pi:

- sio2bsd from drac030 http://drac030.krap....-inne-pliki.php

- AspeQt from Fatih Aygün http://sourceforge.n...rojects/aspeqt/

 

The first tool does not need hardware handshaking, so no changes were required in the code.

After adapting the makefile I could easily compile the code.

Thanks to drac030 I can offer you software download of the Raspberry Pi version (sio2bsd.tar.gz).

 

There were some problems with the AspeQt.

First of all - the Application Window is too big (if you use Composite Video signal of the Raspberry Pi).

So I build two vesions:

- a small size one (emulates only 4 drives)

- a standard one (has a "_hd" suffix)

 

Since some days there is a new version (0.8.7) of the tool available.

That's why I decided to build the following binaries:

aspeqt_0.6

aspeqt_0.6_hd

aspeqt_0.8.7

aspeqt_0.8.7_hd

 

The stable version 0.6 includes changes from Hias.

 

If you want to put AspeQt icon on the Raspberry Pi desktop, you should create a folder called "Desktop" in the "home" folder (/pi/home) and copy the "AspeQt.Desktop" file there.

 

Have Fun!

sio2bsd.tar.gz

AspeQt.tar.gz

Edited by TheMontezuma
  • Like 6
Link to comment
Share on other sites

  • 1 month later...

Thanks for sharing! I really appreciate it.

 

I built an SIO2PI on a protoboard and it works great with sio2bsd (I haven't tried AspeQt yet).

 

I have a usb wireless adapter in the Raspberry Pi. This allows me to connect to the Pi from my main computer (using SSH) and change the ATRs for the Atari.

post-12735-0-98923900-1364168242_thumb.jpg

Edited by griz
  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Thanks so for your work on this! This is a fantastic little project, and got me back into using my Atari!

 

I have assembled this adapter using the level shifter and an old PC Floppy disk cable plugged into the GPIO header on the Pi. I didn't have a Schottky 1N5817 Diode and substituted a 1N4004.

I am able to use this with the CLI based "sio2bsd" provided and it works great!

However, when using the more feature ritch "AspeQt" provided in the Link above, I don't seem to get any activity between my 600XL and the Pi.

I've even gone to re-download the source code and recompile and I get the same results.

 

Essentially what happens, is that when starting emulation in AspeQt, the CPU of the Pi spikes to 100% when I try to perform any communication, i.e. Cold-Starting the 600XL with Option, or attempting to load a .CAS file from AspeQt, or running an LPRINT in BASIC, I don't seem to get anything.

 

I am assuming that the issue I am running into is the Handshaking mentioned in the above posts, via the SIO Command Signal through the level shifter to GPIO Pin 11 (GPIO 17)

Could you offer any assistance, or perhaps post what was modified in the source code to achieve this behavior? I would LOVE to get this working and use the advanced features in AspeQt!

Thanks again!

-Henry

Link to comment
Share on other sites

Thanks so for your work on this! This is a fantastic little project, and got me back into using my Atari!

 

I have assembled this adapter using the level shifter and an old PC Floppy disk cable plugged into the GPIO header on the Pi. I didn't have a Schottky 1N5817 Diode and substituted a 1N4004.

I am able to use this with the CLI based "sio2bsd" provided and it works great!

However, when using the more feature ritch "AspeQt" provided in the Link above, I don't seem to get any activity between my 600XL and the Pi.

I've even gone to re-download the source code and recompile and I get the same results.

 

Essentially what happens, is that when starting emulation in AspeQt, the CPU of the Pi spikes to 100% when I try to perform any communication, i.e. Cold-Starting the 600XL with Option, or attempting to load a .CAS file from AspeQt, or running an LPRINT in BASIC, I don't seem to get anything.

 

I am assuming that the issue I am running into is the Handshaking mentioned in the above posts, via the SIO Command Signal through the level shifter to GPIO Pin 11 (GPIO 17)

Could you offer any assistance, or perhaps post what was modified in the source code to achieve this behavior? I would LOVE to get this working and use the advanced features in AspeQt!

Thanks again!

-Henry

 

Figured it out based on some of your other posts on the Atari forums: I was missing the Raspberry Pi Specific Broadcom BCM 2835 Library found here: http://www.airspayce.com/mikem/bcm2835/

Once I compiled and installed, your custom versions of AspeQt work Fantastic! Thank you so much for doing the back-end work here!

-H

Link to comment
Share on other sites

any chance we can get a guide on how to do this ( the software side of things) The hardware I can figure out :) ? it would be great if we could :) i just purchased an atari 800 and would love to get it up and running with some disk images, I have a couple of raspberry pi's and this sounds like the perfect application for them. I don't have much linux experience, so re-compiling for me usually requires a few detailed steps :) Any help would be awesome :)

 

thank you :)

Edited by Waltermixxx
Link to comment
Share on other sites

  • 11 months later...

OFFTOPIC: First of all, apologies for reviving an old thread, but as far as I can tell, that is the way things work here.

ONTOPIC: Some time has passed since the initial design was posted here, and in the meantime sparkfun has dropped the used version (BOB-08745) of the level converter in favour of a bidirectional one (https://www.sparkfun.com/products/12009). This means (beside a different product to purchase) there are also some minor changes in the naming of the connections. The connections to be made to the BOB-12009 Level Shifter are:

*** Atari TO Level Shifter
SIO 3 (data in) -->|--- HV1    *via diode (for example 1N5817) direction from Atari to the level shifter*
SIO 5 (data out) - HV2
SIO 10 (+5V) - HV
SIO 4 (gnd) - GND
SIO 7 (command) - HV3          *OPTIONAL*

*** Level Shifter TO Raspberry Pi
LV1 (Chan1) - P1_08 (GPIO14 / TxD)
LV2 (Chan1) - P1_10 (GPIO15 / RxD)
LV - P1_01 (+3,3V)
GND - P1_06
LV3 (Chan2) - P1_11 (GPIO17)   *OPTIONAL*

The patched version of sio2bsd from this post does not need the optional wire and works fine without it - at least on my setup.

 

I initially purchased the SIO2PC/10502PC Dual-USB device from Atari8Warez for use with my Raspberry Pi. And described the installation in http://atariage.com/forums/topic/225479-raspberry-pi-sio2pc10502pc-dual-usb/ everything from that post can be used with this device as well. The modification of the /etc/inittab file (to free up the serial port on the pi) is the default setting of the distribution used in the post, so it's all (solder,) plug and play!

 

*EDIT* Almost forgot: due to the use of the 'internal' UART (serial port) of the Pi with this device, replace /dev/ttyUSB0 from my installation post with /dev/ttyAMA0

Edited by SenorRossie
  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

Thanks for the info (especially the update)! Managed to put this together today and had it up and running in no time. Some of the disk images I got don't seem to work, just heard the loading noises and then end up in BASIC, but I guess that's more a machine compatibility thing or something.

 

Kudos for getting this worked out!

Link to comment
Share on other sites

  • 1 year later...

Thanks for the info (especially the update)! Managed to put this together today and had it up and running in no time. Some of the disk images I got don't seem to work, just heard the loading noises and then end up in BASIC, but I guess that's more a machine compatibility thing or something.

 

Kudos for getting this worked out!

 

Some programs won't disable basic during their load. I think it's hold down Option during boot to disable basic. I'd try that for the disks that don't load.

 

Bob

Link to comment
Share on other sites

  • 1 year later...

As long as there is a software running on the Raspberry, which would support it.
Btw.
As discussed in the RespeQt forum, this version of the "SIO2PI" cable can be simplified if used with RespeQt.
No connection is required between Atari command line and a GPIO pin. Instead a "NONE" or "Software" handshake setting shall be used in RespeQt.
A cheap level shifter supporting only 2 lines (RxD, TxD) will work.

Edited by TheMontezuma
Link to comment
Share on other sites

  • 2 months later...

Originally I built an sio2pi interface board (see above) to accept the ribbon cable for the original Raspberry Pi. Currently I only have a Raspberry Pi A+ to play with and the gpio cables are different, so I wired it up manually.

 

post-12735-0-45868600-1502575736_thumb.jpg

 

I think this would be a good project for a Raspberry Pi Zero W. The logic level converter could be done very small and the whole thing could fit into a tiny 3D printed case. The "W" even has built-in wireless which my rpi A+ does not (hence the wifi dongle).

 

post-12735-0-88302400-1502575759_thumb.jpg

I then installed Apache + PHP and wrote a little front-end for sio2bsd. A very basic ATR selector but it works well. Now I can access my ATRs from my real Atari using my tablet. I simply point the web browser to http://ataripi/ (the name of this rpi).

 

post-12735-0-65435000-1502575778.png

 

It's cool to have a web based interface to load ATRs into my Atari using wifi.

  • Like 10
Link to comment
Share on other sites

  • 1 year later...

Hi,

 

I built a couple, they work very well. I used a no-name bidirectional logic level shifter (4 of them for 4 pounds sterling including P&P from ebay.co.uk). There's a detailed write up (from someone else) here: http://blog.lmorchard.com/2018/03/01/sio2pi/

 

I'll try and upload some photos later, I built one using a breadboard, and one just soldering wires (and a diode) to the level shifter. Still using the second one, and it plays nice with 1050s, etc.

Link to comment
Share on other sites

Hi,

 

Here are some pictures I made when I was building the interfaces (bread boarded picture is to show the level shifter, not how to use the bread board). I used a couple of IDE cables (40 pin, not 80 - 80 will trash your Raspberry Pi) and a few other items, but it was not very difficult (the Raspberry Leaf printout was quite useful too - https://www.raspberrypi.org/blog/raspberry-leaf/ )

 

The Raspberry Pi is connected to the network, so I don't have to sneaker net the files onto a memory card like I have to for the SDrive Max, and is usually up 24/7, as it is used for other (non-Atari) purposes. This is very handy if I am hacking any code to test on a real 8-bit.

 

Price wise, I already had a Raspberry Pi (model B, 1st generation), so the only extra cost was the bi-directional logic level shifter (1 pound), and 3D printing the SIO connector (about 1.50 pounds for filament use and electricity costs). All the other parts I had, or could use from my local HackSpace. So it cost me about 2.50 pounds sterling per sio2pi (plus my time, but I enjoyed making them). I think a Raspberry Pi Zero is about 5 pounds, and a Raspberry Pi Zero W (with Wifi) is about 10 pounds. Power supply is extra. Both systems need a memory card. It's a home made project, and involves some soldering.

 

Hope this helps.

post-64501-0-45574400-1539619180_thumb.jpg

post-64501-0-86911700-1539619222_thumb.jpg

post-64501-0-99848200-1539619256_thumb.jpg

post-64501-0-70613500-1539619299_thumb.jpg

  • Like 6
Link to comment
Share on other sites

I recently played a bit with my RPi, implemented SIO2PC and 1050-2-PC mode for standard serial ports in AtariSIO and successfully used a SIO2PI-like interface on an RPi2 to connect to my Atari computer and Atari Happy/Speedy 1050 in highspeed.

 

Read more about it here: http://atariage.com/forums/topic/284137-testers-needed-atarisio-with-usb-standard-serial-ports/

 

so long,

 

Hias

  • Like 3
Link to comment
Share on other sites

I recently played a bit with my RPi, implemented SIO2PC and 1050-2-PC mode for standard serial ports in AtariSIO and successfully used a SIO2PI-like interface on an RPi2 to connect to my Atari computer and Atari Happy/Speedy 1050 in highspeed.

 

Read more about it here: http://atariage.com/forums/topic/284137-testers-needed-atarisio-with-usb-standard-serial-ports/

 

so long,

 

Hias

 

Great news :)

Long time ago you explained me that the RPI chipset can trigger an interrupt when at least 2 bytes are received over the serial line, that's why the kernel driver implementation of the AtariSIO is not possible, correct?

And now your new userspace implementation of the AtariSIO makes it possible to use RPI with atarixfer to read/write data directly from a floppy drive. Cool :)

Link to comment
Share on other sites

By the way - do you think, you could convince the atari800 emulator (on RPI) to talk to a real floppy drive?

I have spent one day on experimenting (look at the links below), but I was not successful...

 

https://github.com/atari800/atari800/issues/22

https://github.com/TheMontezuma/atari800/commits/real_disk

https://github.com/TheMontezuma/atari800/commit/cf899e858227f6db6c19580b2a5a6bdc208bacd6

Link to comment
Share on other sites

Long time ago you explained me that the RPI chipset can trigger an interrupt when at least 2 bytes are received over the serial line, that's why the kernel driver implementation of the AtariSIO is not possible, correct?

Yes, that's correct - and it's also still true.

 

In the userspace implementation I used a completely different approach and try to deal with the various latencies from the hardware, linux kernel and drivers. The timing won't be as exact as with the atarisio kernel driver and a 16550/16950 serial port but it's good enough to work with the RPi's serial port(s) and FTDI based adapters.

 

I've spent quite a bit of time analyzing the (timing) characteristics of serial ports plus drivers and ran into a bunch of nasty quirks. For example tcdrain() can take up to 3 more jiffies (which is 30ms on RPi) before it returns, using tcdrain() with PL2303 adapters doesn't work at all (it returns immediately while the adapter is still sending out data) and polling via the TIOCSERGETLSR ioctl works fine on 8250/16550 ports but not with the FTDI adapter and PL2303 doesn't even implement the ioctl.

 

So, there'll be limitations, eg PL2303 works quite well in SIO2PC mode but is useless for 1050-2-PC, and now it's time to check if the workarounds that I implemented for the various quirks really do their job. Could be that they need to be tweaked a bit - we'll find out :-)

 

As for atari800: I'm not really familiar with it and getting the timing right between a non-realtime app (atari800 can stop it's emulation clock whenever it wants) and a timing constrained interface could be very tricky. That also means timing for copy protected disks might fail, so I'm not sure if it's really worth the hassle.

 

so long,

 

Hias

Edited by HiassofT
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...