• Please review our updated Terms and Rules here

My floppy remapper project, version 2

mrthreeplates

Experienced Member
Joined
Jul 22, 2018
Messages
77
Hi,

While in lockdown, I've been working on an improved version of my floppy drive switch. I'm happy to report that it is working...

TL;DR: I can boot from an external floppy on my model 4P GA, with the boot drive switchable via s/w.

Sorry for the long post, skip to the bottom if you want to see some pictures.

For my previous attempts, see my thread here.

The purpose of this switch is to allow me to boot from (and use) my external floppy drives as though they were placed internally. This is a convenient way to use a floppy drive emulator or a real floppy (interchangeably) without having to retrofit the case or swap cables each time.

My previous board, while it worked okay, had a few issues that I wanted to address:

1) On a Model 4 GA (or a Model 4P non-GA), my board requires some minor external modifications to the motherboard. I wanted to minimize these changes.
2) The floppy map was limited to one (switchable) hard wired remapping. I want to be able to select different mappings via software on the TRS-80 (perhaps via a key sequence at boot). Credit to Gonk23 for this suggestion!
3) If I fixed #2, then I wouldn't actually need a physical switch anymore (although I've kept the switch as a backup option).
4) The Model 4P only supports 2 internal floppy drives. I want to add external drives, just like my Model 4 and 3. Although there is a mod for this in the January 1986 80 Micro magazine, I wanted to reduce the number of hacking and external wires needed to implement it (while adding my floppy switch at the same time).

Additionally, I had a few extra design goals in mind:

1) I wanted to move components to the underside of the board (in case I needed it to fit in a low profile space). I was worried (perhaps unnecessarily) that my board might run into the graphics card or case on my model 4P.
2) I needed to switch to surface mount components (due to #1).
3) I needed to have the board assembled for me (due to #2).
4) I added a proper h/w debounce for the enable switch.
5) I needed to add colorful blinking leds. Okay, I really didn't need this, but they are cool.

This is also an excuse for me to do more hardware hacking.

Note that this board is only useful for TRS-80s with built in floppy drives and which share a common floppy controller design. So far this includes the M3, M4, M4 GA, M4P and M4P GA. I haven't tested a M4 or M4P (non-GA) yet.

The common element for all of these floppy disk controllers (whether on an external controller or integrated onto the motherboard) is a 6-bit flip flop (using a 74LS174) that is used to latch the four drive select lines (and two additional control lines). My board replaces the flip flop with programmable logic. Minimally, this requires removing the chip and installing a socket.

As it is "illegal" (and not very useful) to select more than one drive at a time, I thought I could exploit this. Since I am using a MCU, I can monitor the drive select lines for this illegal condition, effectively using this as a code to get the MCU to change the mapping.

Additionally, the MCU I selected has the ability to emulate logic functions without the aid of software. This allows me to nearly match the speed of the original flip-flop, making the MCU act like a GAL/SPLD, but much more flexible.

So, my idea is to use drive selects 0 & 1 (simultaneously enabled) as a "flag" to tell the MCU that it should change mapping modes. This left me 4 remaining bits to play with.

In theory, the floppy drives could be re-ordered in 24 different drive combinations (requiring 5 bits). IMO, many of these combinations aren't useful, so I narrowed the list down to the 8 that I put into a table in the MCU. With 8 mappings, I only needed 3-bits. This left me with 1 free bit left. I use this bit (if set) to tell the MCU to save the current mapping in EEPROM (to be restored when the MCU first powers up). This allowed me to set the mapping either temporarily or permanently. Setting the mapping temporarily works even if the TRS-80 is reset (but not power cycled).

The way to switch the mapping (or save it permanently), is with a single out command (e.g. from BASIC).

While there are 8-bits that can be set in the out command, only bits 0, 1, 2, 3, 4 and 7 actually go to the flip-flop my board replaces. In particular, bits 0 and 1 represent drive select 0 and 1. I use bit 7 as the flag to save the mapping to EEPROM. This left bits 2, 3 and 4 for the mapping.

So, putting this all together, I can change or reset the mapping via a single command:

out 244, 3 + 4*map

or, to save the mapping permanently, I add 128:

out 244, 3 + 4*map + 128

The table of mappings I programmed is:

map 0: 0 1 2 3 (no change)
map 1: 1 0 2 3 (i.e. swap drives 0 and 1 only, drive 1 becomes the boot drive).
map 2: 2 0 1 3
map 3: 3 0 1 2
map 4: 0 2 1 3
map 5: 1 2 0 3
map 6: 2 3 0 1
map 7: 3 2 0 1

Since the MIII and M4's all have built in BASIC roms, this means I can change the drive mapping at any time. I figured I could still get myself into trouble on a M4P (since it has no basic rom) if I accidentally selected an un-bootable configuration. Because of this, and because I like switches, I've kept the enable switch.

Note: being able to s/w select the boot drive means that I can also do this via the keyboard at boot if I want. All that is required is a boot rom change (to issue the out instructions desired based on key presses). Maybe I'll try to implement this later.

So, what happens to the drives when multiple drives are selected? This is supposed to be an illegal condition! Good question. Since I would only do this when there is no i/o active, nothing should happen. As a precaution, I also have the MCU clear the drive select lines nearly immediately (< 1 microsecond), just in case. The motor does run briefly, but I don't see any drive lights come on.

Yes, all of this is a total hack. In my defense, I'm just having fun and wanted to see if I could do it. So far, it seems to work... If this breaks something, I can always reprogram the MCU.

Ok, now let me get back to the problem of those extra (4) bodge wires needed for my M4 GA (see my other thread). To solve this problem, I added an additional output on the MCU to create an "external bus" select line. This means that I only have to jumper one wire from my remapper board to the M4 GA. This can be done with a clip, just like the one used on the graphics card. Unfortunately, I still need to cut one trace. As far as I know, this is no way to avoid this.

And finally there is my M4P GA. Like the M4 GA, there are several wires and mods needed if you want to add support for drives 2 and 3 (see the 80 micro article). I moved some of this logic into the MCU. The result is that my M4P GA shouldn't need any bodge wires to remap the floppy drives *and* add support for the extra external drives. I did need to create a new floppy drive cable however (but this is fairly easy).

The M4P non-GA is slightly more complicated as it has a different floppy disk controller chip. Similar to the M4 GA, I think I'll need to cut one trace and run a jumper in it's place. As I don't have a M4P non-GA, this is only based on my analysis of the schematics... I am also not sure about the physical placement of the remapper board on the non-GA (or variants if there are different revisions). Again, I don't have one so I can't test this.

Finally, no project is complete without colorful blinking lights.

There is a green "enable" LED which lights up when the enable line is not grounded.

There is a green "default" LED which lights up whenever the current mapping matches what is saved as default in the EEPROM.

There are four row (and one bank) red LEDs showing which mapping is currently active.

There are also two modes, selected by an input pin. Non-M4P mode is the default. M4P mode is enabled by grounding the input pin.

While in M4P mode, the MCU changes how it how it "drives" drive 2 and 3, as well as the behavior of the external bus output. These eliminates some of the bodge wires which would otherwise be needed.

To visually distinguish which mode is enabled, I change the flashing behavior of the row led.

In non-M4P mode, the row LED will flash slowly. In M4P mode, the row LED will do a fast double flash. Flashing the leds also tells me the MCU is alive.

BTW: I had a really good experience with PCBWay. They built my design with very little hassle (especially considering Covid-19). At $80 for 5 boards fully built (including sourcing the parts), I can't complain at all!

There are still a few things that I'd like to fix:

1) I messed up on the silkscreen. In particular, I added the "M4P" mode after I sent the files for manufacturing. The comments next to the pins don't match the behavior I described above.
2) I should have added through hole jumpers for Drive selects #2 and #3. This would make it simpler to use clips that would go to the floppy drive header on my M4P GA. My workaround was to add two wires directly on my M4P GA instead.
3) While PCBWay was excellent, I didn't expect that they would hand solder my boards(!). This resulted in some of the LEDs being flaky. In the future, I'll either use larger component packages or insist on machine soldering.

Here is a picture of the new board:

IMG_20200504_170158.jpg IMG_20200504_170146.jpg

I program it with a PicKit4 (so it can be powered and it run self-tests). The programming header is also used for i/o pins for selecting the mode, the enable switch, external bus select, and as a run jumper.

IMG_20200504_190904.jpg

Here it is installed in my M4 GA:

IMG_20200505_183604.jpg

And in my M4P GA:

IMG_20200509_193711.jpg IMG_20200517_154606.jpg

And the back of the M4P GA (with the dangling external cable and enable switch):

IMG_20200523_191707.jpg

Here is the cable I had to make for the M4P GA:

IMG_20200523_170907.jpg IMG_20200523_183400.jpg

Using the out command to change the boot drive to boot from drive #2 on my M4P GA (using a HXC USB floppy simulator as the boot drive):

IMG_20200517_155622.jpg IMG_20200523_192910.jpg

George
 
Last edited:
Love the project, sounds like another one for The Custom TRS-80 & Other mysteries, Vol 2!
 
Update: I tweaked my M4P drive external floppy drive cable a bit:

Note: On the model 3 and 4, the external drives are mapped as #2 and #3 (although they are in fact addressed on the bus internally as drives #0 and #1).

With a straight through cable (like I created), I could accidentally interfere with the internal drives if I jumpered my external drives incorrectly.

It turns out that this is easy to do. My HxC USB floppy emulator can emulate drives 0, 1, and 2 (not 3 for some odd reason). Even more annoying on the HxC, drive 0 is the power on default (which I can't change!).

So, I thought I'd fix this "problem" by rewiring drives 2 and 3 at the external connector.

IMG_20200523_170907.jpgIMG_20200523_191707.jpg

It was a little tricky disassembling the external connector and carving up the cable, but some tape helped keep everything in place.

IMG_20200620_112215.jpgIMG_20200620_112805.jpgIMG_20200620_112809.jpg

Now the cable out the back of my M4P acts just like the card edge connector M3 and M4. "Problem" solved!
 
KiCad is so much fun...

I went ahead and fixed the issues I had with version 2.

First, I adding headers at the top for the external signals (needed for M4P or M4 GA) and the optional disable switch. This will make installation much cleaner / simpler.

noname_jumpers.jpg

Next, I cleaned up the silk screening for the programming / jumper header on the bottom. By swapping two input lines I can get away with using 1 or 2 simple jumpers.

noname_prog.jpg

While I was at it, I toned down the brightness of the LEDs and increased the minimum package size to 0402 (from 0201). I hope the larger size improves the reliability problem I had with some of my previous boards (due to hand soldering):

noname3_front.jpgnoname3_back.jpg

Note: ignore the rendering of the header at U2, it isn't correct.

Now I just have to impatiently wait for the boards to be finished...
 
If I read your post correctly, the modifications to the Model 4P mobo to enable external drives are not needed for your system to work. But would it work if the mods have already been done? Or would the system need to be returned to original configuration?
 
If I read your post correctly, the modifications to the Model 4P mobo to enable external drives are not needed for your system to work. But would it work if the mods have already been done? Or would the system need to be returned to original configuration?

Hi Lafos,

Yes, for a model 4p ga, no mods to the mobo are needed (other than installing a socket for the 74ls174). A m4p non-ga will require one trace cut and jumper clip. However, this is far less invasive (and easily reversible) when compared to the original method for adding external floppy support to the m4p.

If you happen to have already done the external floppy mod on a m4p mobo (of either type) and wanted to just use my board to do the floppy remapping, this should work too. In this case the m4p jumper would be removed.

George
 
Boards are back, programmed, and seem to work. This is version 3.

Here is the front and back:

MVIMG_20200814_212224.jpgMVIMG_20200814_212203.jpg

The dupont headers on the front are for the (optional) disable switch and output signals.

The output signals are needed for M4P and M4 GA installations (see previous lengthy post).

Here is my M4 GA:

MVIMG_20200816_093112.jpgMVIMG_20200816_094450.jpgMVIMG_20200816_093000.jpg

In the first image, you can see I've installed a disable switch, and one jumper connected to pin #1 of U95. This is the EXTBUS line. If you look closely, you can see I cut the trace just above U95. This allows my board to supply the EXTBUS signal instead of the gate array. Non-GA M4s or M3s won't need this minor (but necessary) modification.

Here is the board installed in my M4P GA:

MVIMG_20200816_193628.jpg

I also have the disable switch installed. The M4P (either non-GA or GA) requires that I hook up the drive select lines to support external drives. To make things simple, I made up a special floppy cable:

MVIMG_20200816_193237.jpgMVIMG_20200816_193212.jpg

Notice that I separated drive select 0 and 1 from the external connector and connected it to a two pin dupont header (and to my board). My board outputs drive selects for drives 2 and 3. So, an externally configured drive 0 or 1 will appear as drive 2 or 3, just like on the M3 and M4.

Using this approach, no bodge wires are needed on my M4P GA and I get external drives with the ability to remap them as I like. This is a cleaner/simpler install than my previous version.

Note that a M4P non-GA would still require one (unavoidable) trace cut and jumper, just like my M4 GA above.

I welcome any comments, suggestions or questions.

If there is any interest in these boards, I'll figure out a way to share them.
 
George, thank you for following through with this solution. It solves the same nagging problem for me when using a floppy emulator so I would definitely be interested in obtaining a few of these.
 
Can someone provide some more detail on the 4P non GA bodge wire details? I read the other thread and I understand the GA handles some of the drive mapping inside, which is why this is needed, but I'm not as familiar with the drive logic on these units, so the explanation got lost for me.

I gather that the 74ls174 latch exists on the 4p non GA, and this device thus can still latch the values.
But, the bus mux logic is not familiar to me.

Jim
 
Hi Jim,

Thanks for the interest.

I'm working on a better documentation for my project (including answers to your very good question). This thread (and my original thread), are very hard to follow as my experiments and hacking have evolved. Sorry about that.

Towards that end, I've started dumping all of my design files on Github:

https://github.com/mrthreeplates/TRS-80_floppy_remapper

Here you will find my schematic, gerbers, BOM, source code, etc. This is still WIP, so give me some time to clean it up.

With regards to your question, I don't have a 4P non-GA, so take what I say here as unverified.

The 4P non-GA's floppy controller chip needs a signal (HLT/RDY) which is active whenever any of the floppy drives are active. Since the 4P has only two drives, they used a simple OR gate driven from drives 0 and 1. Actually it is a NOR fed into an inverter, but effectively it is an OR. This two input gate is U75 on my schematic. In order to add two more drives, you'd need to supply the same HLT/RDY signal, but would need to change this to a 4-input gate (fed by all four drive signals).

I solve this problem on my v3 board by generating the HLT/RDY signal directly and route it to the external pin on the front of the board. You then need to connect this output to HLT/RDY. This requires you to cut one trace from the OR gate on the motherboard and jumper in the signal from my board. This is still much simpler than the major modifications you need if you followed the original article from 80 micro (January 1986).

On my 4P GA, due to the different design, even this minor mod isn't required.

Interestingly, the 74LS174 (hex flip-flop) is common to all of the Model 3, 4, and 4P computers (including GA / non-GA variants). This flip flop latches the 4 drive select lines driving the floppy drives. The other two bits are for the side select and density. The whole secret to my board is that it can swap these bits around, effectively remapping the drives in any way desired. Adding support for external drives on the model 4P is a bonus.

HTH,

Regards,

George
 
FYI: I have several test boards available, which have accumulated due to my experiments:

One v3 board (this is the latest version described at the end of this thread) - See the GitHub files for v3 information.
Four v2 boards (these are functionally the same as V3, but don't have the convenient headers on the front).
One v1 board (this one is the dumb non-programmable simple switch). This works best in a M3 or M4.
Four unpopulated v1 PCBs (I may have the parts for some too). Consider this a kit without instructions.

Some of the v2 boards have minor defects (due to the leds), which are likely repairable. They all are functional.

I am happy to send these to people who would like to play with them.

Preference goes to those who have computers I don't have (e.g. a M4 non-GA and M4P non-GA), those who are comfortable hacking on hardware, programming PIC controllers, and aren't afraid of damaging their vintage computers...

Bonus points awarded to anyone who wants to contribute to the GitHub design files, source code, PCB, etc.

Double bonus points for creative ways for me to avoid having to ship out multiple packages.

PM me if interested.

Thanks,

George
 
Thanks for the better explanation. I'll have to check if I have a 4P GA or just 4P non GA.

JIm
 
I finally got around to installing the floppy remapper today in my Model 4D. It works great! It solves a common problem in a simple yet elegant fashion. I'm quite impressed and give it a solid recommendation. Now, it's not for the complete noob as there is some chip removal involved, which if you are not experienced could quickly devolve into a nightmare. The 4D motherboard has fairly small traces so you need to be careful when desoldering. Take your time.

I want to thank George for developing this accessory. I've been watching this thread and then on his Github site as he constantly iterated and evolved this project. I know from experience that it takes a lot of effort to keep going on a project like this that only a handful of people may ever use. It is a labor of love for these magical old computers.

Thanks, George!

IMG_2851 2.jpgIMG_2852 2.JPGIMG_2853.jpgIMG_2855.JPG
 
I finally got around to installing the floppy remapper today in my Model 4D. It works great! It solves a common problem in a simple yet elegant fashion. I'm quite impressed and give it a solid recommendation. Now, it's not for the complete noob as there is some chip removal involved, which if you are not experienced could quickly devolve into a nightmare. The 4D motherboard has fairly small traces so you need to be careful when desoldering. Take your time.

I want to thank George for developing this accessory. I've been watching this thread and then on his Github site as he constantly iterated and evolved this project. I know from experience that it takes a lot of effort to keep going on a project like this that only a handful of people may ever use. It is a labor of love for these magical old computers.

Thanks, George!

View attachment 63268View attachment 63269View attachment 63270View attachment 63271

Hi Pete,

That is so great to hear that it works for you! Thank you for taking the time to test it out and the kind words. Your additional socketing of U95 is a much cleaner solution and avoids the trace cut! I really wish I had done this.

For anyone else who is interested, I'd really like to find out if this board will work on a M4P (non-gate array) or even a M4 (non-gate array). I'm particularly concerned about the M4P non-gate array with a graphics board. I'll send my remapper boards (from what I have) to people who'd like to try this out. My earlier board versions (of which I have several) will work best on non-M4P computers.

I've cleaned up the instructions quite a bit, you can see them at: https://github.com/mrthreeplates/TRS-80_floppy_remapper.

As Pete rightly points out, careful soldering is involved (installation of 1 or 2 sockets), but is otherwise a reversible modification. The M4P install (which adds external floppy drive support), requires that you make a special floppy cable.

Depending upon interest (and confirmation that there aren't any problems with the design), I'd like to find a way to get these boards made for those who'd like them.

Thanks!

George
 
Ok, George, you knew this was coming. After using this solution for a bit, I do have a request. :)

Most of my floppy work on the 4D will be using the HxC on the external floppy connector in the "2301" mode. However, every time I access my HxC, the motors on the internal floppy drives spin up. This is due to the common Motor Enable signal. In order to not abuse the original drives, it would be a great feature if the motor enable could be controlled, if not per drive, then at least on the internal floppy channel. ie. only trigger Motor Enable for the internal channel when one of the internal drives is accessed. I guess it would require another line from the board to the internal ribbon cable.


Doable?
 
Hah! Nice one. I think this would be a cool feature and it could be optional.

One the model 3 and 4, all the signals are available (extbus and motoron) you just need an inverter and two AND gates to control motor-i and motor-e independently. There may be spare gates to do this on the 4d.

To merge this into the remapper a pcb change would be needed, but it could be prototyped on the existing boards and needs a relatively small sw change.

I would need two additional output signals, one each for motor-i and motor-e As I'm out of pins, I'd have to steal them from the leds.

Also, I'm out of clc blocks, I'd have to drive the motor pins via sw. This means there may be a couple of microsecond delay when turning on the motors. I assume this is probably ok. As a bonus, I can avoid spinning up the drives when I change the mapping too.

I do wonder if there could be a problem copying from an internal drive to external drive. Would the floppy drivers handle the additional drive spin up time? This might be fixable in software as I could probably detect the drive to drive copy case.

The 4p has only one motor control, so this would require a mod to the cable to separate the motor signal wire going to the external connector.

Assuming none of these things are issues, it seems doable!

George
 
Ok, George, you knew this was coming. After using this solution for a bit, I do have a request. :)

Most of my floppy work on the 4D will be using the HxC on the external floppy connector in the "2301" mode. However, every time I access my HxC, the motors on the internal floppy drives spin up. This is due to the common Motor Enable signal. In order to not abuse the original drives, it would be a great feature if the motor enable could be controlled, if not per drive, then at least on the internal floppy channel. ie. only trigger Motor Enable for the internal channel when one of the internal drives is accessed. I guess it would require another line from the board to the internal ribbon cable.


Doable?

Actually, if you want per drive control, I think this may be fairly straightforward, without any changes to the remapper board.

Take the following as unverified, I've yet to try this...

In the Tandon TM-50 service manual (for my Model 4P), and it looks like there are some jumpers to do exactly what you want. There is a jumper to disconnect pin 16 (N-Motor-On) (W1 on the motor control board) and a jumper block (U19) "MTR SEL" to control Motor-On using the Drive Select line.

On older drives, the same change may be possible with a minimal mod (i.e. jumper wire) on each drive (as far as I can tell from the schematics). I think you need to be careful of the termination resistors to make sure you don't modify the termination value.

I still worry that doing this may have some unintended side effect (or failure mode) when copying from drive to drive.

If your Model 4D has Tandon TM-50-2 drives, this could be exactly what you want.

George
 
It may be best if I just rig up a manual switch on the internal motor line.
 
Here's an update on my final configuration. I rigged up 2 switches. One switch is for the floppy remapper enable/disable circuit. The second switch is on the internal floppy drive 12v power line. This allows me to turn off the internal drive motors when using the HxC on the external floppy channel which I plan to do 95% of the time.

IMG_2907.jpegIMG_2908.jpegIMG_2909.jpeg

I like to joke that it makes my M4 look like another one of my favorite computers, the SuperPET. :)

commodore_mmf9000-cbm_8050_2.jpg
 
Back
Top