Monday, March 16, 2015

Building the Tapuino R2


The Tapuino has gone through several iterations, this post is a revisit of the build instructions containing these updates.

DISCLAIMER: If you build this and it blows up your C64, sets your house on fire, kidnaps your dog or any other negative occurrence, I take no responsibility for this or accept no liability whatsoever. That said, I will do my best to help troubleshoot any builds (I do take responsibility for all positive occurrences ;)).

I would highly suggest that you read this entire post at least once before building the Tapuino!

Note: code and hardware design files can be found on my GitHub at:

So lets get started. Firstly a bill of materials:

Major components:
  • Arduino Nano V3
  • 16x2 LCD Display with I2C backpack
  • SD Card module with built-in level conversion
  • 40 wire Dupont female-female 'ribbon'
I got all of this from eBay. Here is an example shopping list:

Additional components:
  • Piece of vero board. The one I got was 100mm wide x 200mm long. This is also known as strip board and must be the kind with strips of copper (as opposed to individual 'cells')
  • 32 pin (16x2) WIDE dip socket (this is what the Nano will plug into) or 2x15 female headers
  • 6 pin (3x2) dip socket (for the opto-coupler)
  • A strip of male pin headers
  • A strip of male right-angle pin headers
  • 2 strips of female pin headers (sockets)
  • 1x 430 Ohm resistor
  • 4x Tactile switches (6x6)
  • 1x 4N25 Opto-coupler
  • Some jumper wire (I use single core wire from a piece of telephone cable)
Here are examples of the headers:

Here is a schematic of the board in Fritzing format:
Tapuino V2 schematic

So lets build the main board first. You'll want to put it together like this:
Top view of the main board

Note the minimum dimensions of the board: 29x17. You may wish to make the board larger to allow for mounting holes.

Before you assemble:

The Nano has 2x15 pins and the socket is 2x16 so if you use the socket make sure the extra pins are on the right (in the diagram above after the D12 and D13 pins), or use 2x15 pin female headers.

R1 = 430 Ohm
Green blocks = straight header pins.
Grey blocks = female headers

Break the header pins into appropriate size groups:
2x3 pins
1x6 pins
1x4 pins
and cut the female pin headers to size (mine were 40 pin, so cut down to 8 pins):

Bottom view of the main board

The lighter yellow bits are where the vero board has been cut. It is essential that you check that these tracks are cut properly. Use a multimeter to test for continuity between the tracks once cut. To cut the tracks on my prototype I used a small sharp drill bit that was luckily a perfect fit.
Please take note of the cut track between the two pins of R1 (under the resistor).

I would suggest that you solder in this order:
  1. 32 pin wide socket (or 2x15 pin female headers)
  2. 6 pin dip
  3. 2x3 pin header group next to the 6 pin dip
  4. Remaining pin headers
  5. Jumper wires

Feel free to extend the pin headers to access additional pins on the Nano if you like, I just wanted to keep it simple for wire-up later and expose only the pins necessary.

Next up is the button board, this is the much simpler V2 button board that uses internal pullups on the Nano and so doesn't need any resistors:
Top view of the button board

Note the minimum dimensions of the board: 20 x 13. You may wish to make the board larger to allow for mounting holes.

Green pin headers are right angle.The pinouts of the green pin headers, left to right are as follows: GND, BTN1, BTN2, BTN3, BTN4

Bottom view of the button board

Take careful note of the track to cut: on the 4th track (from the left) to isolate button 3 from button 1
Also note that the jumper wires for the ground lines are soldered through to multiple points. I achieved this by cutting the wires into individual sections:
  • ground line (top most line) there are 4 jumper wires of 4, 6, 6, 6 tracks in length.

Now lets install the components and connect it all up.
Firstly install the 4N25 opto-coupler into the 6 pin socket, noting where pin 1 is according to the vero board schematic. Here is a picture with the correct orientation:

Installing the 4N25 opto-coupler

Note the small dot on the chip, this indicates pin 1. The chip should be oriented such that pin 1 connects through to the 440 Ohm resistor (R1).

Next the Nano:

Installing the Nano

As discussed above, the Nano has 2x15 pins and the socket 2x16 pins. If you chose to use the 32 pin socket, care must be taken to place the Nano correctly. The Nano must be aligned so that the empty socket pins are on the right most pins of the socket as per the image above i.e. the Nano is mounted as close as possible to the opto-coupler.

If you trace out the circuit you will observe that the 2x3 pin headers between the opto and the Nano expose a ground and power rail (left is GND, right is PWR). You will use these rails to provide power to the LCD, SD Card and Button breakout boards.

Connect according to the legend in the main board image, here is a guide:

  • Power and Ground go to the rails described above
  • Nano A5 goes to SCL
  • Nano A4 goes to SDA
SD Card:
  • Power and Ground go to the rails described above
  • Nano D13 goes to SCK
  • Nano D12 goes to MISO
  • Nano D11 goes to MOSI
  • Nano D10 goes to SS
Button Board:
  • Ground go to the rail described above
  • Nano A3 goes to BTN1
  • Nano A2 goes to BTN2
  • Nano A1 goes to BTN3
  • Nano A0 goes to BTN4
Finally the pinout for the C2N connector to the board:
CN2 to Tapuino connector pinout

You will need to break out 8 pins from a pin header.
Solder the C2N connector to the pins in the following manner:

  • GND to PIN 1
  • PWR to PIN 2
  • READ to PIN 3
  • MOTOR to PIN 4
  • SENSE to PIN 5
  • WRITE to PIN 8
I recommend you heat-shrink the pins as above.

Your connector should look like the one above, the colour to pin map in my case is:
  • Black (GND) to PIN 1
  • Green (PWR) to PIN 2
  • White (READ) to PIN 3
  • Red (MOTOR) to PIN 4
  • Blue (SENSE) to PIN 5
  • Brown (WRITE) to PIN8
Should look something like this:
C2N connected to the Tapuino

PIN 1 (GND) is connected to the left-most pin of the female pin header.

Now all that is left to do is flash the sketch to the Nano, disconnect it from USB, insert an SD Card with TAP files, connect the Tapuino to the C64 and enjoy!

The U.I. is controlled as follows:

BTN 2 is ABORT (during a load) or BACK one directory if browsing

If you have directories on your SD card they will be indicated by an arrow in the right-most column of the LCD where the filename is displayed. Long filenames are now supported!

Caution: Do not connect the Nano to both the C64 and PC. Also check all soldering very carefully for shorts before wiring up to your beloved machine!

The astute reader will note that the bus connector has 2 additional pins that are not connected: CTRL1 and CTRL2. These are used in the MUX board to allow switching between the C64 and a real Datasette as a target device and will be covered in a future blog.

Hope you enjoyed this, it was a helluva post to write!



  1. Awesome! I will build one of these for sure!

  2. Amazing, just built one just need to hook it up to the computer now, tomorrows job. C64 and PET here. Cheers & Beers!!!!!

    1. Super! Glad you got it built! Share pics and let me know how the PET works :-)

  3. awsome work! will defenitly build one :-)
    One question were do i find the sketch for flashing to the Arduino?
    Looked at the link to the code but there was alot of files, wich one to use?
    Would love i guide for the flashing as well :-)

    Keep the great work up! /Dan

    1. Just grab a zip of the source from GitHub, extract it to your hdd and inside will be the tapuino.ino file. Make sure the directory you extracted to is called "tapuino" (GitHub calls it "tapuino_release" or something so rename it), load the .ino into the IDE and flash as normal.

  4. Dear Peter Edwards, what's the usb nano correct?

    this :

    or this :

  5. The 2nd link (CH340G cheapo) is the one you want. Get 2 for the price of the more expensive one :-)

    1. Hi Sweetlilmre, is it possible to use arduino with ATMEGA168P chip? i bought these one by error instead ATMEGA328P... :(

  6. Dear Sweetlimre,
    I have built the tapuino but i have problems with the recordings. This is strange for me, because I have recorded (always with tapuino) games without errors of the same cassette in which there are games that I don’t record with success (after many attempts) : cassette with same loader! However ALL games load without errors when the tape record is connected directly to commodore 64 (then i don't have problem of azimuth, cleaning, etc.).
    The sd card is fast (HC)
    The invert is "1" when record and "0" when play
    The cables of the recorders are originals....
    What's the problem?

    1. I think i am facing with similar errors/problems. I was able successfully record 1-2 tapes with no issues with my Tapuino. (I used my datasette as source, and recorded it with Tapuino). On these tapes there were about 40-50 games / casette side, but these games can only be loaded using ABC-Turbo (or actually any turbo is fine). When i use the datasette, first I load the ABC-Turbo, then afterwards the game. It just works fine.
      On Tapuino... I am able to load ABC-Turbo, but i am unable to load any Turbo-Tape games afterwards, as i get Load Error every time.

      Any other programs recorded on Tapuino with no Turbo, works just fine, but seems like turbo-games are exceptions. Maybe because of pulse or something, i could not figure it out yet.

    2. Please see my reply below. Recording does have issues with high speed loaders. Advice on how to replicate your issues would be appreciated.

  7. Could you add support for ZX Spectrum and TI99/4a? They have Ear and Mic plug and TI have remote plug for pausing tape recorder.
    Is this possible?
    I have build tapuni by your instructions and it work GREAT!

  8. Hi all I was wondering if you can help me, I've built the Tapunio and it powers up ok and it does the Init, then it starts scrolling through the play and record and options on the screen, if I disconnect button 4 it stops. So I changed the button and checked if there is a short and all seems ok. But still it scrolls through the list of play record , and options so any help would be great full thanks

  9. Hi Peter, waiting for the parts to arrive so I can make my own Tapuino - really looking forward to making it. Would love to see you make something better than the UNO2IEC as well (ie not require a pc). Thanks for makin this guide!

  10. This is an awesome project! I'm fairly new to Arduino (but have been programming in C for many years) and could use your help to make a small modification. I have an LCD shield that has buttons on it already and want to reuse that for this project. The buttons are set up to use only one analog pin, so 5 buttons only take up one pin. I've been looking through to code to see where I'd need to make a change to how buttons are read. I can't seem to find where that would be. I'm thinking somewhere in comms.c (input_callback?) - but I can't see how you read the digital pins for the buttons. Can you give me a pointer? I can't seem to find digitalRead being used anywhere to read the button pins in the rest of the code either. How do you do it? I see lots of shifting, but no pin reading. I think I might be missing something (like another way to read the button pins without using digitalRead?)

    The LCD module I'm using is this:

    1. Hi, you've probably moved on by now (damn commenting notification was off for my blog).

      If not, I read the buttons directly by reading the RAW register state in the input_callback() function.

      i = key_state ^ ~KEYS_READ_PINS;

      You would have to replace this functionality by reading the analog pin there and then making appropriate changes to player_handleInputKeys()

  11. Thanks for putting this up here! I've just ordered the parts and hope to build mine soon ;-)

    One question: would it be possible to use an Arduino Due instead of a Nano?


  12. Wow, you did a fantastic job here! I am currently surfing around and looking for the parts I am going to need in order to make my own Tapuino. Since you put so much effort into creating this, I think it is only fair that you should be earning some commissions from selling the parts via an affiliate link!

    Brian Hopkins @ Micro Tips USA

  13. can you send hex file to me ?

  14. can you send hex file to me ?

  15. how enable the C16 support on 2.5.0-beta?

  16. I build one, thank you :)

  17. Hi,

    I am trying to compile tapuino but seems there is a file missing dsip_lcd.h can you please guide me where to find the the current file?


    1. Sorry for the late reply, notifications for posts were disabled somehow. Did you manage to get this working?

  18. Can you post a schematic of the connection to the c64? In the explanation I didn't understand at all.

  19. This comment has been removed by the author.

  20. Hi! I just finished building tapuino. Thank you for that awsome device! I've got one suggestion: I think that optocoupler is overkill - NPN transistor (I used BC547, but nearly any shoulkd be ok) would be sufficient. Connection like this:
    Vcc - [resistor 10k] - collector and D4
    Motor from C64 - [resistor 10k] - base
    GND - emitter
    I tested NPN mod with PSU and m changes to M on LCD when I supply 9V to motor pin.
    I'll test tapuino with C128D in two days, i'll post results.

    1. Hi, I initially used a transistor but had issues with it for some reason (probably because I didn't know what I was doing). I cant quite recall what the problem was, but I think I had some leakage across the transistor that was unreliably powering the Nano or something. I chose the opto after that to ensure isolation, but if the transistor works for you then that is great. Looking forward to hearing about your results.

    2. Would it work if you replace the optocoupler with a led and a resistor and take the input from between ?

    3. Maybe... If you drop the voltage to 5v or slightly below then it could work. As per the voltage is approximately 6v and the opto is used to safely decouple this signal from the other 5v lines.

  21. Hi Peter,
    I've built the circuit as per your instructions but no matter what I do it always comes up with Init Failed. I've used both an Arduino Nano (cheap Chinese clone) and a barebones ATMega328PU circuit and I get the same result. Do you have any suggestions to make this work?

    Kind regards,

    1. Hi,

      So this is almost certainly an SD init failure. If I2C init fails the board hangs. Check your SPI connections carefully and ensure that you have an SD card inserted. Also what SD module are you using?
      It might be easier to continue this discussion over mail. My address is sweetlilmre at gmail dot com.

    2. Hi Peter,
      In your inbox! Cheers for taking the time to discuss this.

  22. This comment has been removed by the author.

  23. I have built one, and it works great. Thanks for the plans.

    I was able to use a Carvey CNC machine at my local maker-space to CNC the lid of the project box. It was my first time using a CNC machine; the cutout for the LCD is a smidge too small, so I had to enlarge it by hand. If I were doing it again, I would also cut the letters shallower.

    Photos are here:

    Since taking the photos, I've also placed a piece of opaque tape over the bright red LED on the Arduino preventing the light from shining through.

    I was also able to locate the proper connector to interface with a Commodore tape port.

  24. Hi Peter:

    This is the most ingenious device I have seen, and per your instructions I have gotten most of the components together, just the 5 volt line for the four buttons is missing still. However, when uploading the code and making the config-user.h file, indicating 1602 and the I2C address of 0x27, which according to the manufacture specs, I still get nothing. I thought it may have been an under-powering but no matter how much current, just "blocks" across the screen. As simple of device as this is, I am starting suspect the Nano is no good or the at I get a warning in the IDE about low memory and that it may cause stability problems. Other than that, I think everything else should be fine--any thoughts?

    1. I had the same problem. I changed 0x27 adress to 0x3F and it worked

      #define LCD_I2C_ADDR 0x3F // I2C address for the LCD

    2. Glad to hear you got it working and thanks for sharing your solution.

  25. This comment has been removed by the author.

  26. Hi Peter

    I built another Tapuino the Tapuino mini 1.03 and added the 0.96 inch 128X64 OLED Display, which works fine, I've uncommented the big fonts line to try and get big fonts but it does not seem to work on my oled, i was wondering if there is anything else i need to add to it to get big fonts working.



  27. Hi Brian

    What oled are you using?
    The big fonts code uses a trick of the display setup mechanism so may not be compatible.

    1. Hi Peter I bought this 1

      it works ok but i can't do the big fonts trick, or have you got a link for a cheap oled that is compatible.



  28. Hi does any one recommend a Oled screen for the Tapuino so i can do the big fonts trick



  29. Quick question: do you have pictures of the underside for soldering the 2x3 4N25 opto-coupler and for a future reference? I'm planning on making my own and I don't want to mess it up big time. Thank you and great project as well.

    1. This image shows the bottom of the board where the 4N25 socket is soldered (unless I'm misunderstanding you?):

  30. Replies
    1. No this is only for the C64. However there is another piece of hardware called the TZXDuino that does the same thing but for the speccy.

  31. Hello, I am very beginner for electronic montages.
    I would like to build your Tapuino installation, I have ordered the pieces and I am waiting to receive them.
    is it possible to use the Tapuino to record a program from the Commodore 64 to the SD card, by recording on the SD a EMPTY CASSETTE by examble (I would like to program on C64 and save it on SD).
    As I told you I'm a beginner, I do not understand all the editing, moreover I'm French and the language barrier limits my understanding. The C64 cable at Tapuino is that of an original Datasette? I planned to use a "Jamma 3.96mm connector", I cross my fingers to make it work.
    Additional photos of the montage would be welcome in both sides in the details.
    I thank you in advance for your answer, especially your Tuto.
    (Google trad ^^)

    1. Replied by email, the summary is:
      Yes, you can record. The JAMMA connector should be fine, just watch polarity.


  32. Hi Peter
    I've built the above strip board version and it works great. I noticed in the wiki it mentioned recording from a real datassette to the tapuio - is there a design for the extra needed to add to the stripboard version so I can archive some old tapes?

  33. Hello, I have finalized the project, it remains for me to put it in a correct box. And to test it with a Commodore 64, I receive mine this week hopefully. :-). thank you for the help and the pleasure I had to do it. I will put pictures by email when everything will be in box. thanks again

  34. Hello I build this Tapuino with a 2x8LCD because I didn't had a bigger one and it works too.
    I build it because I wanted to emulate a Quick Disk from my Akai Sampler but it does not work:(
    Its strange when I plugged my headphones to the read pin I could hear sound like the c64 did so far I know but at the write pin it does not come same signal out. I recorded this on mp3 just to see which pins give signals.
    Maybe I can send you those mp3 and pictures and maybe it is possible to upgrade the Maschine that old samplers or keyboards can emulate there 2.8inch Quick disks. A lot artist outside asking for that:/
    The cable by the akai sampler has 10 pins. I took 2 to gnd that the sampler see always disk is mounted and that the disk is not write protect. There are 8 pins left but I took your 7pins to them and the sampler recognised your Tapuino as a Disk. The Menü let me write samples to it but reading does not work.
    Is it possible to send you the pictures and recording I did?
    This project is so nice you did so far.

  35. Hi,

    I have built this tapuino but I get a "startup failed" on the LCD when I power up the C64. What can this be?

    1. Sorry it is 'Init Failure' displayed on the LCD.

    2. Hi, this could be several things, badly formatted SD card, incorrectly wired SD card module or bad SD card module. Make sure you use the SD Association formatting tool, format to FAT32, check your wiring and finally check your SD module (someone else had this issue with a module the other day). You could try a simple example SD sketch from the Arduino examples to see if your module is OK.

  36. Thanks man! I built one, with a 3d printed case. Superv!

  37. Hi, just wanted to confirm that this version will work on a Pet 2001? thx :)

    1. Hi, I don't have a pet to test with, but from what I've heard it should work.

    2. ok thanks. Ill give making one and go and report back :)

    3. I just built one today for my PET 2001, and it works like a charm. Thanks!

    4. Fantastic news! So glad it worked!

  38. It's great to see support for this build �� I have parts ordered and planning to build a joystick for the c64 at the same time and integrate both whereby loading games will be done at the joystick,Will post photos and joystick details on completion. Thanking you for this great work!

  39. How do you copy audio files to the SD card?

    1. You don't :-) you copy C64 .tap files to the SD card.

  40. Nice work - Just built the Tapuino R2 on a breadboard … worked first try!
    Now onto the Stripboard version

  41. Hi. Thanks for posting your plans for the Tapuino. I just ran across this recently and now have all the parts. I loaded the Master zip version into my Arduino IDE and when I compiled it, it shows 31,604 bytes. This won't leave room for the bootloader on a 328P chip. What do you suggest?

    1. Hi. I haven't had this issue using an arduino nano, perhaps the bootloader is different in yours. There are smaller bootloaders available which you could flash with an isp programmer or another arduino. Contact me on my Gmail address, its sweetlilmre@ if you want discuss further.

  42. Hi, I made a tiny change to the 'filename_ticker' function as it was scrolling a filename that had a perfect screen fit. (+ replaced the font8x8 with a smallFont5x7 as your code was nice to work with and was quick to do)

    void filename_ticker(FILINFO* pfile_info, uint32_t cur_tick) {
    // if needed adjust scroll amount for the end director marker
    uint8_t limit = (pfile_info->fattrib & AM_DIR) ? MAX_LCD_LINE_LEN-1 : MAX_LCD_LINE_LEN;

    // is the filename within screen bounds?
    if ((strlen(g_ticker_string) - g_ticker_index) <= limit) {

  43. Hi Sweetlilmre,

    First of all, thank you very much for this amazing work you did with Tapuino. Based on your page, i was able to build one for myself and it just works fine in general, however one thing just came up after i started to test my archives i created with Tapuino.

    I don't have any orginal games/tapes, but ones, with so called "cracked games" that can only be loaded using a turbo (such as ABC-Turbo II)

    So I was able successfully record/archive 1-2 tapes with no issues (I used my datasette as source, and recorded it with Tapuino). On these tapes there were about 40-50 games / casette side, but these games can only be loaded using ABC-Turbo (or actually any turbo is fine).
    When Datasette is connected to the C64, I can load the ABC-Turbo first, then with the turbo, games are loading just fine.

    Having Tapuino connected to the C64... I am able to load ABC-Turbo with no issues, but i am unable to load any Turbo-Tape games afterwards, as i get Load Error every time.

    Any other programs recorded with Tapuino with no Turbo works just fine, but seems like turbo-tape games are exceptions.
    Would you have any hints, as to what may causes this? Is it relates to the pulses? Not sure, if you ever came across any such problems.

    Many thanks for any hints
    Best Regards:

    1. Hi,

      Is there any chance you could send me some of these games in tap format?
      The timing on these are extremely tight and it would be very useful to check them. The recording function of the Tapuino is known to struggle with very fast loaders.

  44. Thank you for your answer! Sure, I am sending you an example .TAP file

  45. Any tips for connecting the tapuino to the C64 datasette port?

      and follow the pinout described above.

  46. Hi, first of all congrats on a fantastic device, loved the CBM64 since its release and this device just helps bring back all the memories :-)
    But here is my issue, I have a Tapuino and a copymaster, I can download and play a TAP fine but struggling to create TAP from original tape. Ive set the invert to 1 and then start to record on auto. Once the tape ends I press Abort and its says its completed but the created file is only 1k and is corrupted/unusable. Im assuming im just doing something dumb ?

    1. Hi,

      Thank you for the compliment!

      I'm assuming the copymaster is something like this:

      Is the counter increasing as you record? If not then the Tapuino will not be receiving any signal and so not writing to the file.

      The clone hardware seems to already invert the signal so this setting may not be necessary. I don't know if I have the hardware around any more to even test this, but if you'd like to continue the conversation, feel free to email me: my username at gmail dot com

  47. Hello and first of all congratulations for the project that allowed me to be able to re-admire games and programs that I haven't seen for 40 years! I made a version of the Tapuino and it works quite well, except that when connected to my Vic-20 some keys like the letter "N" print the number "0" instead of the letter corresponding to the key. I set the Italian language in the firmware configuration file. can you help me? Thanks in advance.

  48. Good afternoon ..first of all I want to congratulate you on an outstanding project. I've been looking for this for a long time since I have
    a C64 whose tape deck doesn't work. BUT...I have a problem...I got to the point where I need to program the Arduino Nano...How do I do it?
    I did everything as You said...changed config-user.h.example to config-user.h... I have changed config settings in it...AND NOW WHICH FILE
    TO LOAD IN Arduino IDE... to compile it??? I'm a little confused!!! PLESE HELP...HELP!!!