Subscribe via RSS
21Aug/1710

MSX – Arduino as Tape Drive (CASDuino)

As usual, no vintage equipment is complete until you've maxxed it out with all possible peripherals! I had previously made an old 'Datasette' drive work for a Commodore 64 and so started searching for an appropriate tape player for my MSX. It turns out that you either pay big dollars for a specific data recorder, or you use an off-the-shelf tape player and hope-it-works.

I then stumbled across Arduitape (aka TZXDuino). The slogan says it all: 'ARDUITAPE MARK II - THE TAPE PLAYER REPLACEMENT SD CARD SYTEM FOR 8-BIT COMPUTERS'. After a lot of digging on the blog, the instructions presented themselves. As you can see, the instructions aren't as clear as they could be and so I henceforth present the complete construction and usage of an Arduino as a fake Tape Recorder for an MSX.

Update: Current link to TZDuino 1.8 is here. Seems the links above are now dead :(

Ingredients

I ended up testing out multiple components during this build. I initially started with a 128x128 LCD but found that the libraries required to run it used too much memory and therefore the whole project was useless on a UNO/Leonardo. Instead I switched back to a 16x2 LCD.

Component Substitute Comments
Arduino Nano Arduino Leonardo r3 This Leonardo r3 from Jaycar worked fine, or a UNO.
16x2 Character LCD Find any 16x2 I2C LCD from eBay.
SD Card Shield SD Card Module Jaycar also has a full shield for SD Card reading, but we don't need that much infrastructure.
AMP Shield Arduino Compatible 2 X 3W Amplifier Module Different, but with two channels, we can use one for input.
4 x 4.7k resistors Filter Board
3 x 4.7nF Capacitors Filter Board
1 x 100nF Capacitor Filter Board
2 x 3.5 mm Female Jack PS0122 (One is for recording... can we get it to work?)
1 x 2.5 mm Female Jack PS0105
5 pushbuttons SP0711
Some kind of box to put it all in.

From here, I'll describe how to hook up and test each component to make sure that you build up a stable base for troubleshooting!

The Circuit

Here's an overview of what we're building. It's really just a rigging of off-the-shelf components, apart from the filter board.

CASDUINO

Note that the buttons aren't in the exact order. You can customise which button does what below.

Arduino

I used both a Uno and a Leonardo whilst constructing this. I bought the Leonardo as I thought it had more RAM than the Uno. Turns out it doesn't and so I switched from the 128x128 memory-expensive LCD to a simple 16x2 LCD. Either way, grab an Arduino and a nice case to house it in.

DSC00043

DSC00047 DSC00049 DSC00050

Punch holes where required and mount it all in place with hot glue.

LCD

This was a quick solder and plug-in. VCC and GND to the Arduino. SDA and SDL to analog pins A4 and A5. Make sure you have the daughterboard on the correct way around. It's on backwards in the first picture below. In the second and third pictures you'll see that you can't see the daughterboard as it's aligned behind the LCD.

DSC00118 DSC00119 DSC00121

If you get a single bar of black blocks, then chances are you have the I2C daughterboard on backwards. There's something that looks like a 'pin 1' designation on the board, but this only worked once I plugged it onto pin 16! I have it on BACKWARDS on the first shot above!.

SD Card

This is another I2C device which means it just needs to be wired into the bus. Again, hook VCC and GND to the Arduino. Then hook up CS to D10, SCK to D13, MOSI to D11 and finally MISO to D12.

DSC00070 DSC00067 DSC00069

You now should get a new message showing the first file/folder in the root directory. Go test out your google-fu to find CAS files for the MSX. You'll need one to test with.

DSC00122

You'll want to start showing-all-files-and-folders in Windows to get rid of the hidden items that'll now show up on this device. There's no filter in the card to disregard the kludge that OS' keep hidden on disks.

Buttons

These are easy enough... they just need a common ground and then 5 wires to the specified digital inputs. You can customise the order of your buttons, but in the end make sure you have then connected to the associated inputs of btnPlay, btnStop, btnUp, btnDown and btnMselect.

DSC00124 DSC00128 DSC00130

Not a TZXTape? Come again? Oh right, we're meant to be using CASDuino, not TZXDuino!

Filter and Amp

UPDATE: You can skip this circuit... just wire the the audio out straight into the amp board.

This little board is pretty straight-forward. I built it up as per the instructions.

DSC00139

You then need to provide GND and Audio In (Digital Pin 9) from the Arduino. Audio Out is fed into your Amplifier, which happens to be R-In on my tiny board from Jaycar. Yes, I'm using a RED wire for GND on the filter board, running to GND on the button row. It's a really good idea to tie ALL GNDs together wherever possible.

DSC00140

Disregard my colour-coding... that blue is actually GND and is using the GND rail from the LCD panel. Black is audio-out from the filter board to Audio-in on the amp. The amp then also needed VCC and all GND pins joined. From there, add on the 3.5mm headphone socket.

DSC00142

At this point I actually plugged the output into my stereo. An awful noise, to the tune of the data loading of the Commodore 64 (or even a modem dialing up), played loudly! Data!

DSC00145

Finally hook up the little 2.5mm socket to GND and D6. This will allow the MSX to tell the player when to play/pause.

Loading a game

With everything hooked up, I turned the device on. I then powered up the MSX, with no cartridges installed. At the BASIC prompt, my CASDuino started flickering between play/pause. It looked like the remote-control signal was floating instead of being pulled high or low. Regardless, I typed in the magic command: RUN"CAS:" (yes, double-quotes and all)

The CASDuino settled on PLAYING and I heard interference through the TV Audio!

DSC00147

Found:TURTLE appeared... but then it crashed?

DSC00149

Turns out you can set the BAUD rate of the tape playback. Default is 3600, but this was too high for my construction skills, or maybe even my MSX.

DSC00162

Setting this to 1200 or 2400 saw the game (slowly) load!

Teenage Mutant Hero Turtles

Did you know that UK/Ireland preferred Heroes over Ninjas? Supposedly Ninjas were too thought-provokingly violent. Either way, the game loaded. If you want to play with the keyboard, keys Q and A are UP/DOWN and keys O and P are LEFT/RIGHT.

DSC00151

DSC00153 DSC00154 DSC00158

DSC00160 DSC00156 DSC00157

Final Notes

Grab your glue gun and secure everything. This will hold it in place and also insulate any floating components.

DSC00164

DSC00166 DSC00167 DSC00168

Then mount the headphone plugs and close the box... it'll look much neater :) I ended up mounting a socket for the recording plug also... although it's not currently connected to anything. Might try and play with that in the future!

DSC00170

..and don't forget to clean up..

Filed under: Arduino, Retro Leave a comment
Comments (10) Trackbacks (1)
  1. I really do need to update my how to build instructions.
    BTW the low pass filter is not required for the CASDuino, only the Arduitape.

    • Thanks for this note. I’ve updated the article. Will try it out soon enough also.

    • Couldn’t find the build instructions on your site, so i stumbled across this manual.
      I will try to build it myself in a few weeks.

      Are there any options to use this device to load DSK-files?
      It seems not all games I would like to play are available as CAS.

  2. Hi! Very nice guide!
    But the link to how to build the filter is gone!

    Have you the schematics for it?

    Thans!

  3. Fantástica explicación de como hacer un CASDuino, aunque cuanto más detallado mejor. Podrías hacer un gran tutorial en Youtube.
    Tres preguntas:
    ¿Puedo cargar cualquier juego de MSX, ya sea de cinta o cartucho?. (Yo tuve juegos de cartucho en cinta)
    ¿Cómo paso los juegos a la tarjeta SD para cargarlos en el CASDuino?
    ¿Cómo grabo cualquier programa que haga en mi MSX en el Arduitape?
    Gracias de antemano

  4. Fantastic explanation of how to make a CASDuino, if more detailed, better for us. You could do a great tutorial on YouTube.
    Three questions:
    Can I load any MSX game, either tape or cartridge? (I had old cartridge games on tape)
    How do I pass the games to the SD card to load them in the CASDuino?
    How do I record any program I do with my MSX in the Arduitape?
    Thanks in advance

    • Kike,
      I do believe any MSX game will work? As long as it’s compatible with your MSX (i.e. MSX 1 vs 2)

      You need to put the SD card into your computer and then copy the tape files on it. These will then show on the LCD and you’ll be able to select through them.

      Recording… ! I haven’t implemented or tested this. If I get time in the future I’ll hook it up and attempt to modify the code to support recording.

      Steven.

  5. What about the sketch for arduino?


Leave a comment


*