Skip to content

bkw777/PDDuino

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Tandy Portable Disk Drive 1 emulation
  • TS-DOS directories
  • TPDD2-style bootstrapper to install a TPDD Client onto the computer

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

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

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

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

Change-log

20210404

  • 0.5.0 Incorporated Jim Brain's replacement return_*() and main loop.

20200819

  • Moved PCB to its own repo
  • Added TPDD2-style bootstrap function

20200817

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

20191025

  • 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?

20180921

  • 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

SD2TPDD - PDDuino

v0.2 (7/27/2018)

  • Added DME support
  • Corrected some file name padding bugs

v0.1 (7/21/2018)

  • Initial testing release with basic TPDD1 emulation

About

A hardware emulator of the Tandy Portable Disk Drive using an SD card for mass storage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 84.6%
  • C 15.4%