Tapuino / Tape Emulation Mods: Difference between revisions

Created page with "{{Infobox hardware | name = Tapuino / Tape-Port Emulation Mods | image = 260px | caption = '''Tapuino OLED v1.5''' assembled on a single 5 × 7 cm PCB | type = External solid-state replacement for Commodore '''Datasette''' | developer = Andrew Beer (“Sweetlilmre”) – original Tapuino design<br />Community forks: Arananet Reloaded, OpenC64 Tapuino, Tapuino OLED, Tapuino W, etc. | first_released..."
 
Rewrite from the project's own repo and FAQ: author is Peter Edwards not 'Andrew Beer'; latest firmware is v2.10.0 (Feb 2022) under MIT; cassette READ is pin 4 and WRITE is pin 5 per Commodore's service manual (the page had them swapped); SENSE is open-collector, not held low, because the plus/4 shares it with user port data pin 2; add the 'never power from USB and the C64 together' warning
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Infobox hardware
{{Infobox hardware
| name          = Tapuino / Tape-Port Emulation Mods
| name          = Tapuino
| image          = [[File:Tapuino_oled_v1_top.jpg|260px]]
| image          = [[File:Tapuino_oled_v1_top.jpg|260px]]
| caption        = '''Tapuino OLED v1.5''' assembled on a single 5 × 7 cm PCB
| caption        = A Tapuino tape emulator
| type          = External solid-state replacement for Commodore '''Datasette'''
| developer      = Peter Edwards ("sweetlilmre")
| developer      = Andrew Beer (“Sweetlilmre”) – original Tapuino design<br />Community forks: Arananet Reloaded, OpenC64 Tapuino, Tapuino OLED, Tapuino W, etc.
| type          = Solid-state replacement for the Commodore Datasette
| first_released = April 2014 – public GitHub release of Tapuino v1.0 firmware
| first_released = 2014
| latest_release = Tapuino firmware v2.01 (Feb 2023)
| latest_release = Firmware v2.10.0, February 2022
| operating_voltage = 5 V DC (drawn from cassette port pin 2)
| application    = Commodore machines with the 1530/1531 cassette interface
| application    = Commodore 64, 64C, SX-64, VIC-20, C16/+4, PET* (with adaptor) – any IEC-less CBM 8-bit that uses the '''1530/1531 Datasette''' interface
}}
}}
<templatestyles src="Template:StyledTable/styles.css" />


The '''Tapuino''' is an open-hardware, Arduino-based device that emulates Commodore’s 1530 '''Datasette''' mechanism, allowing cassette images (‎*.TAP*, ‎*.PRG*, ‎*.TCRT*) stored on a micro-SD card to be loaded, saved, and fast-forwarded with perfect digital fidelity. 
The '''Tapuino''' is an open-source, ATmega-based device that plays '''.TAP''' images from a micro-SD card into a Commodore's cassette port, standing in for a 1530 Datasette. It was published as "the $20 C64 tape emulator".
Because it plugs into the cassette port rather than the serial IEC bus, Tapuino is an attractive solution for VIC-20 owners and for C64 software that was never released on disk.


== 📜 History ==
'''Everything below is cited to the project's own repository and wiki, or to Commodore's own service manual.'''<ref name="repo">Peter Edwards ("sweetlilmre"), ''Tapuino'', https://github.com/sweetlilmre/tapuino . Repository, README, <code>config.h</code> and <code>version.h</code>. Source for the author, the MIT licence, the repository's creation in June 2014, the current firmware version v2.10.0 (tagged 10 February 2022), the statement that the project is in maintenance mode and superseded by TapuinoNext, the supported displays, and the open-collector handling of the SENSE line together with its rationale on the plus/4.</ref><ref name="faq">''Tapuino FAQ'', project wiki, https://github.com/sweetlilmre/tapuino/wiki/FAQ . Source for the instruction never to power the Tapuino from USB and the C64 at the same time; for the motor-sense fault symptom and its checks; and for the recording procedure and the invert settings.</ref><ref name="csm">Commodore Business Machines, ''Commodore 64 / 64C Service Manual'', hosted at [[Commodore 64 / 64C Service Manual]]. "The Cassette Interface Circuits": the 6510's parallel port lines P3 to P5 drive the cassette interface, with write data from P3 (U7 pin 26) reaching connector CN3 on '''pins E and 5''', read data entering on '''pins D and 4''' into the FLAG input of CIA U1, P4 sensing the play switch and P5 controlling the motor through Q1/Q2/Q3 with CR2 holding the base of Q1 at 7.5 V.</ref>
* '''2014-04 – Tapuino v1.0''' published on GitHub; Arduino Pro Mini + 16×2 LCD shield, push-buttons and SD-module.
* '''2015-02 – Hackaday write-up''' brings wider attention; hundreds of DIY units are built.
* '''2016-17 – “Reloaded” & OLED forks''' replace the LCD with a 128×32 I²C OLED and move to an Arduino Nano for native USB flashing.
* '''2019 – Tapuino-W''' adds ESP-8266 Wi-Fi so images can be pushed over the network. 
* '''2022 – Tapuino v2.x''' firmware rewrites the loader to support '''Turbo-TAPE''' fast-loaders and arbitrary sample rates up to 100 kHz.


== 🔧 Hardware Overview ==
== Status ==
{| class="wikitable"
 
! Variant !! MCU / Clock !! Display !! Media !! Notable Features
The original Tapuino is '''in maintenance mode'''. Its author has superseded it with '''TapuinoNext'''. The last tagged firmware for the original is '''v2.10.0''', committed on '''10 February 2022'''. The firmware is '''MIT licensed'''.<ref name="repo" />
 
If you are reading a description that gives the current version as 2.0x or the licence as CERN-OHL or GPL, it is not describing this project.
 
== The cassette port ==
 
Getting this wrong is the most common way to damage something, so take it from Commodore's own service manual rather than from a pinout table copied between sites:<ref name="csm" />
 
{| class="wikitable styled-table" style="width:75%; text-align:left;"
|+'''Commodore cassette connector (CN3 on the C64)'''
! Pin !! Signal !! Driven by
|-
| A / 1 || Ground ||
|-
|-
| '''Tapuino v1.0''' || Atmega328P @ 16 MHz || 16×2 HD44780 LCD || micro-SD || Through-hole shield stack
| B / 2 || +5 V ||
|-
|-
| '''Tapuino OLED''' || Atmega328P || 128×32 OLED || micro-SD || Smaller 5 × 7 cm PCB, rotary encoder option
| C / 3 || Cassette motor || 6510 port line P5, via Q1/Q2/Q3
|-
|-
| '''Tapuino Reloaded''' :contentReference[oaicite:7]{index=7} || Atmega328P (Nano) || 128×32 OLED || micro-SD || All-SMD, USB update, protected 5 V regulator
| '''D / 4''' || '''Cassette read''' || Into the FLAG input of CIA U1 (pin 24)
|-
|-
| '''Tapuino-W''' || ESP-8266 (NodeMCU) || 128×64 OLED || micro-SD / Wi-Fi || HTTP file upload, OTA firmware
| '''E / 5''' || '''Cassette write''' || 6510 port line P3, U7 pin 26
|-
|-
| '''OpenC64 Datasette Saver''' || STM32F103 || 0.96" IPS || micro-SD || Adds over-current & brown-out protection
| F / 6 || Cassette sense || 6510 port line P4 — senses the play switch
|}
|}


=== Electrical Interface ===
'''Read is pin 4 and write is pin 5.''' Commodore's manual names both explicitly. Motor is pin 3, not pin 5.
The Tapuino connects to the six-pin '''cassette port''':
 
== Two things the project tells you that matter for the machine's safety ==
 
=== Never power it from USB and the C64 at the same time ===
 
The first entry in the project's own FAQ, and the answer is one line: '''"Don't do this, ever."'''<ref name="faq" />
 
=== The SENSE line must be driven open-collector ===
 
On a real Datasette, SENSE is a physical switch that '''grounds the line when a key is pressed and leaves it floating otherwise'''. The Tapuino reproduces that by switching its pin between output-low and input/high-impedance rather than driving it high.
 
The reason is spelled out in the source: '''on the plus/4 the SENSE line is shared with data pin 2 of the user port''', so a Tapuino that held SENSE permanently low would fight whatever else is on that line. Any description that says SENSE is "always pulled low (tape present)" is describing a device that will misbehave on a plus/4.<ref name="repo" />
 
== Motor sense ==
 
The Tapuino '''uses''' the MOTOR line to decide whether the TAP data should play or pause — which is what makes multi-load games work and what pauses playback while the filename is shown.
 
The documented failure symptom is precise and worth memorising: '''the display stuck at 0 per cent with a small "m" showing''' means motor sense is not working. The project's checks are:<ref name="faq" />


* '''+5 V''' (pin 2) – powers the MCU (≈70 mA peak with OLED). 
* The MOTOR line should be '''HIGH''' from the C64 to the opto-coupler and '''LOW''' from the opto-coupler to the Nano.
* '''GND''' (pin 1) 
* The Datasette edge connector should be fully seated on the C64.
* '''MOTOR''' output (pin 5) – emulated by polling; Tapuino ignores the line or gates file play. 
* '''READ''' (pin 4) – 0/+5 V pulse stream generated by DAC/bit-bang at original 300 baud or turbo rates.
* '''WRITE''' (pin 3) – edge-captured and stored as WAV-like data when user presses “Record”. 
* '''SENSE''' (pin 6) – always pulled low (tape present).


Opto-isolation is optional; most PCBs use 74HC14/LM311 to shape the READ line back to digital logic levels.
== Recording ==


== 💾 Firmware & File Support ==
The project documents three cases and they need different settings:<ref name="faq" />
Current stock firmware (v2.xx) recognises:


* '''.TAP v0/v1''' images up to 64 MB. 
{| class="wikitable styled-table" style="width:90%; text-align:left;"
* '''.PRG''' files auto-wrapped in a minimal TAP header.
|+'''Recording settings'''
* '''.TCRT''' (Tapecart) container – load *instantaneously* via turbo @ 38 kBaud.
! Direction !! Invert !! Procedure
* Partial experimental support for '''TurboTape''', '''SpeedDOS''', '''Vorpal''' timing.
|-
| Datasette → Tapuino (archiving a real tape) || '''1''' || Tapuino record (auto or manual), then Datasette play. '''Stop the Tapuino manually''' at the end.
|-
| Tapuino → Datasette || '''1''' || Datasette record, then Tapuino play. Stop the Datasette manually at the end. The Commodore is only switched on — no play, no record.
|-
| Commodore SAVE → Tapuino || '''0''' || Commodore save, then Tapuino record. Recording stops automatically at the end.
|}


Menu navigation is via four push-buttons (Next, Prev, Play, Stop) or a rotary encoder; long-press on STOP enters settings where motor-sense polarity, turbo-boost and LCD contrast can be tweaked.
Archiving needs '''as fast an SD card as you can get''' — the project calls this essential.<ref name="faq" />


== 🛠️ Building Your Own ==
== Displays ==
A DIY Tapuino can be completed for '''US$15–20''' in parts:


; Mandatory
Three I²C display types are supported, selected in <code>config-user.h</code> at compile time, with the I²C address set by <code>LCD_I2C_ADDR</code>:<ref name="repo" />
: * Arduino Nano (ATmega328P) 
: * micro-SD module (5 V tolerant) 
: * 0.96″ monochrome OLED (I²C) 
: * 74HC14 Schmitt trigger + 2N3904 for READ shaping 
: * 6-pin edge connector or sacrificial Datasette cable


; Optional
* 1602 LCD modules based on the Hitachi '''HD44780'''
: * Level-shifting buffer for WRITE 
* OLEDs based on the '''SSD1306'''
: * Protective polyfuse on +5 V line 
* OLEDs based on the '''SSD131X'''
: * 3D-printed enclosure


Gerbers for multiple boards (Reloaded, Mini, Slim) are on GitHub under CERN-OHL-S or GPL-2.0 licences.
Exactly one display type and exactly one language must be defined, or the build fails with an explicit error.<ref name="repo" />


== 🚀 Usage Tips ==
== Boards and forks ==
* Hold '''Play''' at power-on to enter fast-loader patch mode – needed for some turbo loaders that poll the keyboard. 
* Keep SD cards formatted as FAT32 with 8.3 filenames; deep directory trees slow the directory parser. 
* You can '''record''' real tapes: insert blank SD, press ➤⏺ combo and start the physical tape in the Datasette. 
* For VIC-20, set *AUTO-PRG offset* to $1201 so PRG files auto-run after load. 


== ⚖️ Alternatives & Related Projects ==
The README points at one third-party board design — '''arananet/tapuinomini1.03''' — and includes its schematics in the repository's <code>layout</code> folder. A 3D-printable enclosure by fabriziofiorucci is in the <code>CAD</code> folder.<ref name="repo" />
* '''Tapecart Micro-SD''' – cartridge-sized STM32 design streaming PRGs at 38 kBaud.
* '''Casduino / ArduiTape''' – WAV player on Arduino Nano feeding READ line with pure analogue audio.
* '''Super‐SCP TapeCart Deluxe''' – CPLD-based loader with 2 MB internal flash.
* '''Pi1541 “Tape Mode”''' – Raspberry Pi emulates both IEC disk and cassette via GPIO add-on.


== ⚠️ Limitations ==
'''This wiki has not verified any other Tapuino variant.''' Named variants with their own microcontrollers, Wi-Fi modules or displays circulate in summaries of this project; none of them is described in the project's own documentation and none is listed here.
* Will not power a '''real''' Datasette motor; cannot be daisy-chained. 
* SAVE speed is limited to original 300 baud even in v2 firmware. 
* Very long turbo loaders (>100 kB/s) may exceed the 16 MHz timer resolution. 
* C16/+4 require a €3 1531-to-1530 passive adaptor due to different pin-out.


== See Also ==
== Related pages ==
* [[Commodore 1530 Datasette]]
* [[SD2IEC & IEC-2-SD Adapters]]
* [[SD2IEC & IEC-2-SD Adapters]]
* [[PLA Replacement Options]]
* [[Commodore 64]]
* [[Commodore VIC-20]]
* [[JiffyDOS Kernal Upgrade]]
 
== References ==
<references />


[[Category:Commodore 64 Modifications and Enhancements]]
[[Category:Commodore 64 Modifications and Enhancements]]
[[Category:Commodore Systems]]
[[Category:Commodore Systems]]