A Tandy Portable Disk Drive emultaor implemented on Arduino, using a micro-sd card for storage.
PDDuino was based originally on SD2TPDD by Jimmy Petit.
DISCLAIMER: This is not a great reference for a TPDD server yet. dl2 is.
pdd.sh is a good reference for a TPDD client, though not especially easy to follow the bash code since it is written to conform to a purist standard as a stunt more than to be easy to read and follow.
The next major TODO is to rewrite this using dl2 as the reference.
- Tandy Portable Disk Drive 1 emulation
- TS-DOS directories
- TPDD2-style bootstrapper to install a TPDD Client onto the computer
PDDuino runs on most any Arduino-compatible microcontroller.
Configs are already included to support the following particularly handy development boards that have a small form factor, built-in usb power & console, and built-in SD-card reader, and which are supported by MounT and BCR_Breakout for the serial connection, power, and physical attachment to the computer.
- Teensy 3.5 and 3.6 (4.1 pending)
- Adafruit Feather 32u4 Adalogger(most recommended) and Feather M0 Adalogger
PDDuino may be used with any machine that has TPDD client software or firmware.
- TRS-80/TANDY Models 100, 102, 200, WP-2
- NEC PC-8201, PC-8201A, PC-8300, PC-8401A, PC-8500
- Olivetti M10
- Kyotronic KC-85
- Cambridge Z88
- Brother knitting machines
- Anything with a python interpreter
- pdd.sh
- Arduino-compatible microcontroller board with at least one hardware serial port
- SD card reader
- RS-232 to TTL/CMOS level shifter
- Serial cable
- Battery or usb power source for the microcontroller board
These boards have a small form-factor, and sd-card reader built-in:
Adafruit Feather 32u4 Adalogger (best choice)
Adafruit Feather M0 Adalogger (20200916 broken)
Teensy 3.5
Teensy 3.6
Teensy 4.1 (not yet tested)
The ideal is the Alalogger 32u4, even though it's old and you can get far more powerful boards for the same or less cost, and you may have to get it from a reseller like Digikey or Mouser, the Adalogger 32u4 is really the optimal choice for several reasons, at least until the glitch with the M0 version is worked out, or one of the new Huzzah boards are supported.
The Teensy's work well in all the impoprtant ways, but they have symmetrical pin headers so they can be plugged in backwards, don't have battery connectors or chargers, or card-detect switches on the card slots. The extra led next to the card slot on the Adafruit boards is nice for a disk activity light too. But without wifi and with the ability to underclock down to nothing, they draw low enough power that the lack of battery is offset by the fact that it can be powered from the BCR port without destabilizing the computer.
This adapter takes the place of a serial cable, and includes the level-shifter:
MounT
This adapter can power the microcontroller board from the M100:
BCR-USB-Power adapter
The following below are NOT needed if using the MounT adapter.
You would only need these for bread-boarding or building in a box attached by a cable.
RS-232<-->TTL/CMOS level-shifter module:
NulSom
Has a male connector and DTE pinout like a PC
Use the same special null-modem cable as for connecting a "Model T" to a PC.
Solder jumper wires on the back of the 9-pin connector to join pins 1, 4, and 6
DSR-DTR-DCD Wiring, top
DSR-DTR-DCD Wiring, bottom
This short-circuits the DSR/DTR detection, which pacifies TS-DOS so it will run, but means you can't test the bootstrap function except by wiring up a fake DTR/DSR signal using a pulldown resistor to gnd and a momentary button to vcc/3v3 on gpio pin 6.
RS-232 cable:
PCCables 0103
Or Any of these
TODO: find a ttl-serial module that actually supports the dsr/dtr lines.
https://www.pololu.com/product/126 breadboard-friendly single row of pins
https://www.amazon.com/dp/B0190WSINY/ double row pin header needs jumper wires to a breadboard
Female plug, DCE pinout, needs a different serial cable, or adapters.
Use as you would use a real TPDD or any other TPDD emulator.
Assuming you are using a MounT adapter to host a Feather or Teensy.
Assuming you are using the BCR-USB adapter to power the MounT.
Assuming the portable is a Model 100.
Assuming you want to install TS-DOS.
-
Start with the Model 100 turned off.
Plug the MounT and BCR adapters into the Model 100 and connect the usb cable from the BCR adapter to the MounT.
Eject the SD card. -
Place an ascii format BASIC loader file on the root of the SD card, renamed as LOADER.DO.
You can use any of the loader files from dlplus.
Example 1: To install TS-DOS on a TRS-80 Model 100: Take TS-DOS.100, and save it asLOADER.DO
on the root of the SD card.
Note the associated pre-install and post-install directions.
Example 2: To install DSKMGR on an Olivetti M10: Take DSKMGR.M10, and save it asLOADER.DO
on the root of the SD card.
Note the associated pre-install and post-install directions. -
Turn on the Model 100 while the SD card is still ejected.
The Arduino board should now have a steady slow blinking LED, indicating it's waiting for an SD card.
Don't insert the SD card yet. -
In BASIC, type
RUN "COM:98N1E"
and press Enter.
(Or follow the pre-install directions are for the loader you're using. The exact command is different for different models of computer. This example is for TRS-80 Model 100 or 102.) -
Insert the SD card.
-
Wait while the loader program is transferred and then executed.
For approximately 20 seconds (exact time depends on the size of LOADER.DO) there will be no indication of acivity on the computer, and the LED on the Arduino board will be ON solid and not blinking. The loader program is being sent to the computer during this time.
After the LED goes out, the computer executes the program that was just loaded.
Follow any on-screen directions (different loaders have different prompts & directions), and the post-install directions for the loader you're using.
In the case if TS-DOS, this would be:
TypeSAVE "TS-DOS"
and press Enter.
Exit BASIC (pressF8
or typeMENU
)
RunTS-DOS.BA
from the main menu.
UseF2-Kill
to deleteTMP.DO
You now have the ram version of TS-DOS (or other tpdd client) installed.
You can immediately use it to browse the contents of the SD card.
If you plan on using Ultimate Rom II, it has a "TS-DOS" feature which works by loading TS-DOS into ram on the fly, from a file on disk.
The file must be named DOS100.CO, and be in the root directory of the media.
This file can be downloaded from http://www.club100.org/nads/dos100.co, or,
a modified/updated version can be found here: http://www.club100.org/memfiles/index.php?direction=0&order=&directory=Ken%20Pettit/NewDos
At power-on the Model 100 rs232 port sets all data & control pins to -5v.
On RUN "COM:98N1E", pins 4 and 20 go to +5v.
- Change "PARENT.<>" to "..<>" if possible
- https://www.arduinolibraries.info/libraries/double-reset-detector_generic
- https://github.com/rocketscream/Low-Power
simplify the sleep calls, same lib for both avr and samd21 - RTC (Teensy has built-in rtc)
- play & record audio as virtual cassette (Teensy has built-in audio, and enough cpu & ram to use it)
- Battery level (Adalogger has built-in voltage reference and adc, and a built-in lipo charger)
- A command-line that can be accessed from the computer's terminal emulator for quicker file manipulation
- Hayes modem emulation using an ESP8266 (https://www.cbmstuff.com/proddetail.php?prod=WiModem232)
- FTP server/client access using an ESP8266
-
20200916 Feather M0 isn't working.
Unknown why. It used to work. -
Works with TS-DOS.
-
Doesn't work with TEENY. (hangs)
-
File transfers don't work with TpddTool.py .
Seems to be due to mis-matches in handling the space-padding in the filenames?
Problem may be at least partly in TpddTool.py -
Some kind of working directory initial/default state issue, which affects Ultimate Rom II loading DOS100.CO on the fly. If you have DOS100.CO in ram, then UR-2 works all the time, because it will use that copy if available.
TS-DOS from rom or ram, not via UR-2, seems to be working pretty well all the time.
TS-DOS from rom or ram, not via UR-2, can successfully load a file like DOS100.CO from the root dir, but Ultimate Rom 2 usually can not load that same file, but sometimes it can.
If you try to use TS-DOS from UR2 after a fresh power-cycle of both Arduino and M100, It doesn't work.
But If you load TS-DOS some other way (for example, use a REX to switch to TS-DOS rom), and use TS-DOS to read the directory listing once, then switch roms back to UR-2, THEN the TS-DOS menu entry in UR-2 works (successfully loads DOS100.CO from the disk).
Maybe TS-DOS does some kind of initialization that UR-2 isn't doing?
UR-2 works fine with a real TPDD/TPDD2 and other emulators like dlplus and LaddieAlpha, so maybe there is some sort of default condition that we should be resetting to? -
If you use UR-2 to load TS-DOS in ram, and switch to a subdirectory like /Games while in TS-DOS, then exit TS-DOS, then you can't use TS-DOS any more, because the next time UR-2 tries to load DOS100.CO from disk, SD2TPDD looks for /Games/DOS100.CO, which does not exist.
-
When UR-2 loads DOS100.CO, sucessfully or not, the LED doesn't shut off after.
-
Sometimes displays the "PARENT.<>" directory entry even when you are already in the root dir.
Goes away if you try to open PARENT.<> again when you're already in root.
- 0.5.0 Incorporated Jim Brain's replacement return_*() and main loop.
- Moved PCB to its own repo
- Added TPDD2-style bootstrap function
- Added PCB adapter "PDDuino_Feather".
Takes the place of the serial cable and ttl-rs232 module.
Supports Adafruit Feather 32u4 Adalogger and Adafruit Feather M0 Adalogger.
- Support Adafruit Feather M0 Adalogger
needs "compiler.cpp.extra_flags=-fpermissive" in ~/.arduino15/packages/adafruit/hardware/samd/1.5.4/platform.local.txt - Combine all boards supported into the same code
Time to break this out into a config.h file?
- Support Teensy 3.5/3.6
- Support Adafruit Feather 32u4 Adalogger
- Macro-ify all serial port access, debug and tpdd client
- sleepNow() powersaving, idles at 3ma
- dmeLabel[] & setLabel() TS-DOS shows current working dir in top-right corner
- disk-activity led
- Added DME support
- Corrected some file name padding bugs
- Initial testing release with basic TPDD1 emulation