Building a REX
Building Steven Adolf's REX from scratch.
Brian K. White - email@example.com
Bill of Materials. Order each of these.
These are parts to build 3 REX boards. You can't order fewer than 3 PCBs from OSHPark, but if you only want to build one or two boards, you can reduce the quantities of the parts from DigiKey.
- Card stock, such as from a cereal box. 2 pieces 1/2" x 1-1/2" per REX.
- Xilinx "Platform USB" programmer.
- I used this actual ebay item: http://ebay.com/itm/112073269777
- But ebay links die after a while, so if/when the link above is dead, just search for "Xilinx Platform USB" on ebay or amazon etc.
- There are a lot of overpriced programmers, and I include the official Xilinx ones in that group. There is no reason I can see why a jtag programmer should cost $200.
- So, go on ebay and search exactly "xilinx usb", then sort by "price+shipping, lowest first, and filter by buy-it-now.
- Then skip the cables and adapters until you get to the actual programmers. You want one of the kits that has the programmer and several adapter cables, all for about $25.
- Then expand the item pictures and verify that it says DLC9G or DLC9LP, or DLC9. Prefer DLC9G most, then DLC9LP. DLC9 is oldest but would still work fine for this. DLC10 probably works too, if you feel like spending the money.
- Don't search for DLC9G or DLC9LP directly by name, you will only get the overpriced ones. Search "xilinx usb" and then look at the pics.
- "Modern" PC with at least one usb port, and a COM port or usb-serial adapter.
- To run the Xilinx software to program the CPLD, and to run a TPDD server to complete the programming process, and to get software onto the M100.
- "Modern", only in comparison to the Model 100. I used a 12 year old atom-powered netbook, running Ubuntu 16.04. The point is it is possible to do the entire job with very little special requirements, IE even a dirt cheap netbook running only free software and OS is enough. It did require several gigs of hard drive space for the Xilinx software though, and getting the LabTools software installed and working, and getting the special usb drivers working DID require some non-trivial futzing around. But I described all that [Here] if you want to use Linux. (TODO: Windows directions, MAC directions)
- Sandpaper, medium grit (120 or so)
- This is just to clean up and smooth the edges of the PCB a little.
- Do not necessarily need anything fancy. I actually used this exact one.
- Or the strongest reading glasses you can get at the local drug store.
- Don't really need this. The "no-clean" flux above can be left on, or cleaned with warm water.
- Test Hook to jump between the jtag vcc pin and PORT_EN (R3) to program the CPLD.
- Just need a little section of 6 pins snapped off of one stick. The rest are not needed, but you almost can't buy them in any smaller quantity.
- A Model 100, 102, or 200.
Install these parts:
- 29F800 (on the back side)
- R1 = 0 ohm
- R3 = 10K ohm
- C4 = 1.0 uF
All other locations left empty.
Orientation of the chips:
Spacer & Extractor
- 1/2" double sided tape
- Cereal box
- Cloth Ribbon, 3/8" to 9/16" width.
Cut a length of ribbon about 2 1/2" long, and melt the cut edges with the soldering pen to keep them from fraying.
Apply double sided tape to bottom of REX (The side with the flash chip, not the Xilinx).
Stick the ribbon to the tape on the REX, in the center of the ribbon, aligned lengthwise.
Add another piece of double sided tape on top of the ribbon, only as long as the REX is.
Cut a piece of cereal box about 1/2" x 1-1/4", and stick that to the tape, aligned lengthwise, centered on the REX.
Program the CPLD with the .jed
Now we need to flash the CPLD (Xilinx) with the .jed file. This configures the blank CPLD into a functional device or circuit that actually does something.
- Get the .jed file from here.
- Install LabTools 14.7 from Xilinx
- Supply +5vdc to pin 1 of the board edge, and gnd to pin 14.
- The simplest way to do this is just pop the REX into a Model 100 (or 102, or 200) with new batteries or a wall plug, turn it on, go into BASIC and issue a "POWER CONT" command (tells the M100 not to turn itself off when idle). The ram in the M100 would probably get scrambled along the way, so back up any files you want on the M100 first.
- Another option is take any 5v phone charger, cut off the usb plug, cut off 3 inches of the outer insulation so you have 2 separate wires, strip 1/4" of insulation off of those, and use rubber bands wrapped around the REX to hold the red wire on pin 1, and black or bare on pin 14.
- (TODO indicate where pin 1 and 14 are)
- Hook up the "platform usb" programmer to the jtag pins with the short section of single row pin header.
- The staggered offset of the holes, while the pins in the header are in a straight line, creates the tension so the pin header stays in place and all pins make good electrical contact without needing an actual socket. It takes some wiggling to get the pin header in place, but that is how it works.
- Temporarily pull PORT_EN high on the CPLD (the Xilinx chip) by jumping from the jtag vcc pin (labeled 3V3), to R3, on the side of R3 closer to the Xilinx chip. (Be careful to get this right! The other side of R3 is GND. If you short vcc to gnd you may burn out the LP2980 3.3vdc regulator on the REX.) Lift the programmer vcc wire slightly up the jtag vcc pin, and clip a J-hook test/jumper lead to the jtag vcc pin. Then anually hold the other end of the jumper lead to touch the side of R3, and hold it there carefully.
- While holding the PORT_EN jumper in place, use iMPACT to program the .jed file.
Flash the Firmware
The firmware gets written to the flash memory. This includes an option-rom image loaded in one of the 32k blocks of flash, which in turn contains REXMGR.
To do this, follow the directions for the 4.9 update. The "update" also works for first-time install.
4.9 update directions The latest advice from Steven Adolf is to use the Build 162 files, not higher.
TODO: This step needs you to run a tpdd server on a modern machine and install a dos on the M100. Should walk through the process of using teeny and dlplus.
Roughly, for this step, first you need to get any form of dos installed onto the M100, and any form of "TPDD device" ready to put some files on. IF you happen to have TS-DOS or Tandy's original "floppy" and a real TPDD drive, you can use those. But most people will probably need to use a serial sable and a "TPDD Server" program running on a modern machine, which includes a bootstrapper to install a dos onto your M100. There are a few different options for tpdd server and dos-installer for every major OS. I used dlplus on linux, which includes a program to install "teeny" onto the M100. There is also LaddieAlpha which is available for Windows, MacOS, and Linux, and there is mComm which runs on Android!
Get one of these tpdd server programs and use the included dos installer and use it to move a few files back and forth until you know how to use it. "teeny" is a little tricky to use for instance.
Download the right zip file from the Rex 4.9 upgrade page.
Unpack the zip file and put the files into the tpdd server shared directory so that you can see them from the M100.
Then follow the directions from the 4.9 upgrade page.
This was the last step. You're done! Consult the REX user manual to start using it!
PCB (This is now a dead link)
PCB (This version is probably good, although it's a salvaged earlier version of the rex.brd file that has messier silk screen)
Printed Circuit Board, pre-castellated (this version is converted from the original EagleCAD 5 or lower .brd file, loaded in EagleCAD 6.6 and saved as new xml format EagleCad 6.x .brd file, then imported into KiCAD 4.07 pcbnew, then the edge cut lines edited, and saved as .kicad_pcb)