bkw777 / PDDuino

A hardware emulator of the Tandy Portable Disk Drive using an SD card for mass storage
GNU General Public License v3.0
29 stars 4 forks source link

PDDuino

A Tandy Portable Disk Drive emultaor implemented on Arduino, using a micro-sd card for storage.

Video of PDDuino doing TPDD2-style bootstrap installing TS-DOS

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.

Features

Hardware support

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.

PDDuino may be used with any machine that has TPDD client software or firmware.

Requirements / Setup

Software

Arduino IDE Setup

Hardware

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.

Usage:

Normal usage

Use as you would use a real TPDD or any other TPDD emulator.

Bootstrap Procedure

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.

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

  2. 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 as LOADER.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 as LOADER.DO on the root of the SD card.
    Note the associated pre-install and post-install directions.

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

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

  5. Insert the SD card.

  6. 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:
      Type SAVE "TS-DOS" and press Enter.
      Exit BASIC (press F8 or type MENU)
      Run TS-DOS.BA from the main menu.
      Use F2-Kill to delete TMP.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.

Notes

Ultimate ROM II TS-DOS loader

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

"Model T" serial port control lines

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.

To-Dos, or merely ideas, not necessarily realistic

BUGS/STATUS

Change-log

20210404

20200819

20200817

20191025

20180921

SD2TPDD - PDDuino

v0.2 (7/27/2018)

v0.1 (7/21/2018)