The programming process

After the physical construction of the REX, the final step is to program it. Programming the REX is done in two stages: The CPLD and the flash.

CPLD

Programming the CPLD is done with a special programmer from Xilinx. The programmer uses the JTAG interface to program the CPLD. JTAG specifies a common standard for on-chip hardware that is used for programming and debugging IC-level stuff. More info can be found on Wikipedia, of course. The connection to the CPLD is six pins that are usually connected via a male pin header. The REX connection, though, is simply unpopulated vias, so a pin set is needed to connect the female header on the Xilinx cable. I used square wire-wrap pins cut from a connector that I had lying around.

Flash

The flash memory on the REX must be programmed by a program running on the Tandy itself, since the REX doesn’t make any connections available for directly programming the flash. I could use a TSOP-48 adapter to program the flash in an external chip programmer (I have access to an older Xeltek) but I’m not sure I would trust the code in the chip after the soldering process.

The flash programming is done my a machine-language executable (.CO) on the Tandy. Of course, getting the .CO file onto a cold-booted Tandy 100 requires us to first have a DOS loaded. Since the REX flasher application needs DOS anyway in order to load the ROM files that we’ll be flashing, this isn’t wasted effort. But it was something I’d never actually managed to do before.

I’m starting to see a pattern with this project: almost as soon as I realize I need something, someone on the M100 list posts and offers exactly what I need. In this case, it was Kurt McCullum who added an awesome feature into the Android version of mComm: the ability to send DOS.

mComm is one of several programs available that emulate some version of the Tandy Portable Disk Drive. This was a device sold by Tandy that connected to the serial port on the M100 and gave you access to 100K of disk storage on a 3.5-inch diskette. It, too, had it’s own bootstrapping procedure where it copied a small disk driver onto the M100. Later, Traveling Software would vastly improve on Tandy’s driver and release their product called “TS-DOS” in both ROM and RAM versions. It is this RAM version that I need to load onto my M102 so that I can get the REX flash utility.

By using a USB on-the-go cable, I can connect a USB-to-serial cable to my Android phone. This connects to my M102 using a null-modem adapter and a 9-to-25 pin adapter. Then, in BASIC on the M102, you type

RUN "COM:98N1E"

and tap “send” on the phone. The BASIC interpreter will execute the bootstrap loader, which basically POKEs TS-DOS into RAM in the right place. It provides handy instructions on the screen and little progress dots as it’s loading DOS. Then, after CLEARing space in high memory (CLEAR 0,55000) you can run TS-DOS from the menu, and you’ve got DOS! Amazing!

I had issues at first that I imagine came down to flow control. The serial UART on the M100/102 have a tiny, tiny little buffer, so it’s easy to drop bits if the CPU can’t keep up. Flow control is used to allow the M100 to tell the sending device to stop for a moment to allow the CPU to catch up. Some (many, actually) cheap USB-serial devices don’t implement flow control properly, and some (again, many) null-modem adapters don’t cross the flow control lines properly. I finally found a combo that worked: an FTDI-based cable and my roughly 30-year-old Radio Shack brand 25-pin null modem adapter. How fitting.

With TS-DOS installed in RAM, I can then load the REX flash program, ‘RF149.CO’. This program, when executed, will make the magic address calls to the REX which will:

  • Erase the flash chip
  • Program the REXMGR software into blocks 0 and 1
  • Program TS-DOS into block 8
  • Create an initial RAM backup image on the flash

RF149.CO pulls these files from the TPDD device (or emulator in my case) which is the other reason we need DOS in RAM in order to flash the REX, since the Tandy doesn’t have anywhere near the RAM capacity to hold all the data that needs to be programmed into the flash chip.

After this, you can cold-start the M100, run CALL 63012 from BASIC and the REXMGR will be loaded. After this, it functions transparently as an option ROM to the Tandy OS.

The REX is a really great little gadget and I see what all the fuss is about. For more information on it’s design check out the Bitchin 100 wiki at

http://bitchin100.com/wiki/index.php?title=REX_Overview

 

2 thoughts on “The programming process”

Comments are closed.