Jump to content
IGNORED

SIO2Arduino


Farb

Recommended Posts

 

This is such a great project. I'd love to see it further developed.

 

Yes it is a great project! Last night I built up my own SIO2Arduino using a Canakit breadboard / Arduino Uno / Seeedstudio SD shield combination. To my complete amazement it worked on the first try! I built the Reset / SDrive version of the project since I did not feel like wiring up an LCD.

 

Regarding maintenance, I would not say I could take over the fulltime development but I am going to extend it a bit - for example I noticed on first powerup that you got BOOT ERROR until pushing the special Reset selector button to tell the Arduino to default to the AUTORUN.ATR file. Guessing it's a bug... I also wanted to have a disk access LED so I made a small change to the code to make it flash the Uno's onboard LED when processing a command. It's only giving a light flicker however, so that must mean it is really speedy and/or I put the on/off calls in the wrong place. DId not look into it too much further.

 

So being completely new to the world of Atari DOS, I am ignorant of what I can do with (for example) the Atari DOS 2.5 prompt. I'm used to the Linux command line and it was not obvious what I could do to load/save programs or how to go into BASIC once I booted DOS. I'll have to look for some tutorials.

Link to comment
Share on other sites

I've just built this, and apart from some issues with the LCD screen interacting with the SDFAT library (which was partly due to pins used, and due to ATX files strangely), I've got it working. I also got annoyed with the lack of back button, so I've coded that up and got it working. I'll clean up the code at some point this weekend (work is being a pain) and then I can post it somewhere.

 

Basically whenever I go to next disk, I store the index of the file (before opening, since open changes the index). Then when you press the previous disk button, it moves the currDir pointer to the start of the directory, and then iterates until it gets to the index of the current file; all the while checking what the previous index before it is. I've found the assuming the previous index is the current one - 2 doesn't work.

 

Once it's found this new index for the last file, I rewind to the start of the directory again, and then iterate once more until I get to this new index. This then sets the pointer up to the right position to open the previous disk. I store this pointer to the last index variable like I do with the next disk, and it works (though it doesn't wrap around, but that's ok)

 

One weirdness I found was the next disk button with the original code skipped me ahead 3 disks every time I pressed it. I chased this down to the open function. So to fix that, I stored the currDir pointer before going mounting the disk, and then reset it when it comes back. Very strange behaviour of the SDFat library!

Link to comment
Share on other sites

My next plan, btw, is to get this to navigate through directories (either with three buttons, and adding '..' dirs, or four buttons with one acting as up to parent dir). Going into directories should be simple, however I'm not sure on how to go to the parent. Again, weirdly after google searching, I can only find one question about doing the change to parent directory thing, which is odd as it would seem like a common task. If I figure it out, I'll post here with the details.

Link to comment
Share on other sites

Wow, I had no idea more than 2-3 people had actually built and used my project :-)

 

@Arcanis-Will - I had tried doing the same thing with Arduino LED too. The SIO commands are so fast the flicker is hard to see. I had thought about maybe turning on the light on the first SIO command and then keeping it on until a certain interval passed with no commands. This would sort of act like the Atari drive light.

 

@deanolium - Once you clean up your changes, I'd be happy to incorporate them into the project and create a new version.

Link to comment
Share on other sites

My next plan, btw, is to get this to navigate through directories (either with three buttons, and adding '..' dirs, or four buttons with one acting as up to parent dir). Going into directories should be simple, however I'm not sure on how to go to the parent. Again, weirdly after google searching, I can only find one question about doing the change to parent directory thing, which is odd as it would seem like a common task. If I figure it out, I'll post here with the details.

 

Yes, I had explored the same thing and found it wasn't as trivial as one might think. I had intended to go back and work on that piece but there never seemed to be much interest in the project so I didn't bother.

 

I'll be interested to see what you find!

Link to comment
Share on other sites

 

There must be 140 ATR files or so. I'll delete some and see if it fixes it.

Your website Usage section states that LCD does not allow subdirectory navigation, which made me think all of the subdirectory code I found was for another scenario...

 

I spent a few hours yesterday digging the SDfat libraries searching for a way to browse backwards and add the two-button option... No luck.

 

This is such a great project. I'd love to see it further developed.

 

Thanks, I'm glad you are enjoying it!

 

Sorry, I forgot that the current version doesn't have directory navigation. I had explored that a bit and found that I couldn't easily get it working reliably.

 

I don't think I ever tested with more than maybe 30 image files on an SD card. It could be a bug due to the number of files on the card. I'll need to take a look at it but work is killing me at the moment so it probably won't be for a little while.

Link to comment
Share on other sites

Wow, I had no idea more than 2-3 people had actually built and used my project :-)

 

@Arcanis-Will - I had tried doing the same thing with Arduino LED too. The SIO commands are so fast the flicker is hard to see. I had thought about maybe turning on the light on the first SIO command and then keeping it on until a certain interval passed with no commands. This would sort of act like the Atari drive light.

 

@deanolium - Once you clean up your changes, I'd be happy to incorporate them into the project and create a new version.

 

I had something like that thought, and then I also considered just adding a pickaxe or similar super cheap processor to perform LED blinking. Would be nice to have a Read/Write access light and/or SD card activity vs SIO activity but they are probably intertwined so much that it's hard to differentiate.

 

Many thanks for the well-written code! I can't say enough about what a relief it is to have well structured code, as compared to so many projects which are a) One gigantic file; and b) One 4000-line mainloop; and c) The same 4000-line function pasted in multiple places with one minor change in each.

Link to comment
Share on other sites

Hey guys. After reading this disscussion and reading the SIO2Arduino code, has anyone tried hooking this up to a 1050 and transfering real disketts to .atr using the USB cable and APE (or something like it)?

 

Bit zombie. Maybe 10-15 years ago I posted a dual SIO2PC 1050-2-PC design to csa8. Just a 14C89 with ~3 diode for logic switching. Kind of rusty, I think I had to use a slightly different switching detecting scheme then was in use at the time. Well, I think there was no other one cable does all at the time but I could be wrong since I remember doing it but not when.

 

Depending on your criteria i.e. open design, easy to duplicate, inexpensive compared to everything else, it would have been a good one to support. Of course with the elimination of serial ports from PCs nowadays, it could be done via USB with just a converter chip using the same diode scheme.

 

Anyway, took a quick look/search and couldn't find my original post. :_( If someone thinks it could be worthwhile, I could do some more looking around. No time to build one myself but I will lend some support *IF* I can remember what the heck I was thinking.

Edited by ricortes
Link to comment
Share on other sites

 

I spent a few hours yesterday digging the SDfat libraries searching for a way to browse backwards and add the two-button option... No luck.

 

 

 

Just do a file.rewind and count back up "-1". This is what I do in SIO2MicroSD. You can do a modify to the SDFat library to aid in full directory navigation if needed as well. Good luck!

Link to comment
Share on other sites

My next plan, btw, is to get this to navigate through directories (either with three buttons, and adding '..' dirs, or four buttons with one acting as up to parent dir). Going into directories should be simple, however I'm not sure on how to go to the parent. Again, weirdly after google searching, I can only find one question about doing the change to parent directory thing, which is odd as it would seem like a common task. If I figure it out, I'll post here with the details.

I modified the SDFat to not ignore "..". Made all the difference for me moving forward in my project.

 

I just mentioned the file.rewind and didn't see your post. Oooops. :)

Link to comment
Share on other sites

Wow, I had no idea more than 2-3 people had actually built and used my project :-)

 

@Arcanis-Will - I had tried doing the same thing with Arduino LED too. The SIO commands are so fast the flicker is hard to see. I had thought about maybe turning on the light on the first SIO command and then keeping it on until a certain interval passed with no commands. This would sort of act like the Atari drive light.

 

@deanolium - Once you clean up your changes, I'd be happy to incorporate them into the project and create a new version.

 

lol - I'm sure there's more people out there also using it. It's a good project, and has worked generally well for me. It's actually been a massive boon for me, as I just recently (this week) got my Atari 800xl and being in the UK, getting something like the SIO2PC-USB version will take an absolute age. Since I have a load of arduinos floating around and the shields are easy to get, it became a no brainer. Without it, I'd probably be stuck with tape games for a month or so. So major kudos!

 

I'll let you know when I get the code tidied -- right now the source is all kinds of hacked up from my various probing attempts to see what's happening in the directory.

Link to comment
Share on other sites

Many thanks for the well-written code! I can't say enough about what a relief it is to have well structured code, as compared to so many projects which are a) One gigantic file; and b) One 4000-line mainloop; and c) The same 4000-line function pasted in multiple places with one minor change in each.

 

Thank you for the kind words! I figured if I was going to open source it that I didn't want to be totally ashamed of it :-)

Link to comment
Share on other sites

Puzzled, I ended up reinstalling pristine versions of both SIO2Arduino and SDFat. I also removed the LCD.

When using another SD program to list the files, I get the full list of ATR files, no problem.

 

As soon as I upload SIO2ARDUINO, it lists to the serial port only a few files out of what's available in the SD card. Has anyone else experienced something similar? cheers

Link to comment
Share on other sites

Puzzled, I ended up reinstalling pristine versions of both SIO2Arduino and SDFat. I also removed the LCD.

When using another SD program to list the files, I get the full list of ATR files, no problem.

 

As soon as I upload SIO2ARDUINO, it lists to the serial port only a few files out of what's available in the SD card. Has anyone else experienced something similar? cheers

I have not noticed but I have only 10 or 15 files on my SD card. I will do some experimenting.

 

Do you know how I can accomplish the "disk swap" needed for a multiple-disk game? There are some I would like to play where it has side A, side B, side C and I don't know how to do it without wiring an LCD (I don't have one yet). I am using the one-button Sdrive menu right now with a Reset button so it resets back to the autorun image.

Link to comment
Share on other sites

 

I also wanted to have a disk access LED so I made a small change to the code to make it flash the Uno's onboard LED when processing a command.

 

It's only giving a light flicker however...

 

After a lot of puzzling "why isn't this working as I expect!!!???" I had the realization that one cannot use the onboard LED connected to pin 13 as a "disk access" light. Because it is also (drumroll) the SPI clock driving the SD card!

 

That explains a lot doesn't it? The intermittent flicker is the SPI read/write to the SD card. Avoid using that pin for other duties. I am looking at using an offboard LED on another output pin instead. Much better behavior!

  • Like 1
Link to comment
Share on other sites

One thing which keeps getting me is that the files have to be writeable - that is, they don't have the read only attribute set.

 

Best bet is to select all on your sd card, click properties, and then clear the read only bit.

 

Hope that helps!

 

BTW, work has been a pain this last couple of weeks; but is easing off, so hopefully will get the code cleaned up for the back button and up soon.

 

 

Puzzled, I ended up reinstalling pristine versions of both SIO2Arduino and SDFat. I also removed the LCD.

When using another SD program to list the files, I get the full list of ATR files, no problem.

 

As soon as I upload SIO2ARDUINO, it lists to the serial port only a few files out of what's available in the SD card. Has anyone else experienced something similar? cheers

Link to comment
Share on other sites

Thanks for the tip, but I already tried that before -along reformatting the SD card and downloading the ATR files from different sources- but nothing helped.

 

I began trying with XEX files, but as soon as I activate support in config.h for XEX files, the serial output stops working so that didn't work either.

 

where can I download .PRO images from? I may have to try those.

Link to comment
Share on other sites

Thanks for the tip, but I already tried that before -along reformatting the SD card and downloading the ATR files from different sources- but nothing helped.

 

I began trying with XEX files, but as soon as I activate support in config.h for XEX files, the serial output stops working so that didn't work either.

 

where can I download .PRO images from? I may have to try those.

 

You are probably already aware but I thought it worth checking. The Arduino serial port used for SIO might conflict with the debug port depending on which board you have. Which Arduino are you using?

Link to comment
Share on other sites

 

You are probably already aware but I thought it worth checking. The Arduino serial port used for SIO might conflict with the debug port depending on which board you have. Which Arduino are you using?

 

 

thanks for your help!

EVERYTHING is worth checking when troubleshooting I must agree. I am using an original Arduino UNO and tried with a Duemilanove just in case but with the same results. Also tried a separate SD card and both FAT and FAT32 filesystems.

 

Debug port works just fine unless I un-comment the XEX support (super weird), preventing me from testing those files.

Link to comment
Share on other sites

  • 2 months later...

I'm trying to figure out if there's a problem with my ATR files.

 

If any of you can do me a favor and see if you can access these I have attached in a Zip from your SD card using SIO2Arduino software.

I have found that the code checks the header of any ATR file but I can't find what's wrong. Out of these 30 files, the arduino can only list through 6 or so...

test file.zip

Edited by RodCastler
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...

Hi everyone,

I've just terminated my sio2arduino project but i have a little problem with sdrive software.

I can run the disk images using arduino "switch" button (file names change on lcd display). But if i change button mode to "reset" and i load sdrive (AUTORUN.ATR) the program starts but the file list is empty (no files stored on sd card).

Any ideas? I try to find solution for several hours. Different memory cards, file names. None works.

I don't want to install lcd, I would like to mount images using sdrive

Yar

Link to comment
Share on other sites

I tried 3 versions (2012,2013,2015) but compilation works only with 20130629 (various errors with other versions)

It's strange why sd card access from arduino is ok and only SDRIVE is not able to read memory card. I think if sdfat version was the problem it would not work at all.

There is only one version of SDRIVE.ATR? Do you know any other program to mount disk images?

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...