3
\$\begingroup\$

I am trying to hack some signals coming from an old computer going to a Floppy drive using an ATtiny1614 microcontroller. Normally the computer has full control of the signal lines but at some window in time, the computer is decoupled and MCU takes over. enter image description here

The signal lines (I am using 4, but for simplicity I have drawn only one) are cut off using a CBT3257 FET 4x 2:1 (de)multiplexer as not to disrupt the original timings, since it's high speed. Switching is controlled by the MCU pulling the output-enable (_OE) on the switch high which turns the switch output to high impedance, then making the SEL pin on the MCU an output.

  • Vcc is 5V TTL everywhere
  • No info on the current the computer can sink or source, or on the Floppy
  • ATtiny can sink/source 45mA max per pin
  • I cannot use the secondary input pins of the switch on 2 of the 4 ports since I am using those to switch 2 select lines around.

problem

If there is a bug in the MCU software it can occur that both the switch and MCU outputs are enabled, which then can short.

What can I do to protect the circuit in case I mess up the software?

Preferably using fairly inexpensive components, and not too many. I would like to avoid another IC.

what I've tried

  • I need about 122 Ohm to limit 5.5V TTL to limit the sink/source current of the ATtiny's pins to a a safe 45mA. This can be implemented by putting down two 68 Ohm resistors on the line. The Floppy, however, fails to respond properly using anything much above 22 Ohm (as per the picture). Wether this is because the signal gets too weak, voltages out of spec or some timing issue maybe due to a capacitive effect I don't know.
  • replacing the CBT with a 74LS257, which has proper TTL output, to boost the output and enable me to maybe use a higher resistor on the line, but this resulted in timing errors.
  • AND-ing the lines from the switch and the MCU using diodes and pull-up resistor, but this also caused the computer-floppy communication to fail.

I have access to an 8 port logic analyser with digital (I assume CMOS level) inputs and an analog Scope (so no memory).

Any ideas? Thanks

\$\endgroup\$
5
  • \$\begingroup\$ Which computer? Which floppy interface? Which floppy drive? What pins on the interface? \$\endgroup\$
    – Justme
    Nov 20 '20 at 14:55
  • \$\begingroup\$ Amiga 500; have no info on its floppy controller. Floppy is Chinon F354E, on which I also have no datasheet and besides other Amigas may/will have other drives. As for the interface pins: old.pinouts.ru/HD/InternalDisk_pinout.shtml though not really relevant I think. \$\endgroup\$
    – durandal
    Nov 20 '20 at 15:07
  • \$\begingroup\$ Random trivia: there are actually analog storage oscilloscopes that have analog memory! They are in every way I'm aware of inferior to digital storage scopes, but they're pretty neat. \$\endgroup\$
    – Hearth
    Nov 20 '20 at 15:26
  • \$\begingroup\$ Also consider a "speed-up" capacitor in parallel across the 122Ω. Note that these tend to be EMI-creating; use sparingly. You'll probably have to use an Oscilloscope to see what exactly this does. \$\endgroup\$
    – rdtsc
    Nov 20 '20 at 15:43
  • \$\begingroup\$ Are you going to start a new cracking group? \$\endgroup\$
    – pipe
    Nov 20 '20 at 16:51
2
\$\begingroup\$

The CBT3257 is a 2:1 multiplexer.

Connect one of the input signals to the Computer and the other to the MCU rather than as you have shown. Even if the software does not function correctly you can never have two outputs shorted together.

\$\endgroup\$
3
  • \$\begingroup\$ Maybe you mean the same but this is the datasheet: assets.nexperia.com/documents/data-sheet/CBT3257A.pdf Your suggestion is valid but I forgot to mention that I am using the secondary inputs of the CBT already. Will edit. \$\endgroup\$
    – durandal
    Nov 20 '20 at 15:24
  • \$\begingroup\$ In cases where you don't have an option as easy as this, it's worth noting this is what bus transceivers like the 74xx245 are made for. \$\endgroup\$
    – Hearth
    Nov 20 '20 at 15:24
  • \$\begingroup\$ @durandal - in that case you can use a tri-state buffer to feed the MCU signals to the floppy and use the inverse of the multiplexer enable to enable the buffer. \$\endgroup\$ Nov 20 '20 at 16:47
0
\$\begingroup\$

Use 74xx245s.

Bus transceivers like it are specifically designed for this exact purpose.

The downside is that they're half-duplex, so you can't use them in both directions at once, though you can mix the port-A and port-B connections to the microcontroller and use it with mixed directionality that way.

\$\endgroup\$
2
  • \$\begingroup\$ How would this address the concern? It's still something that has to be discretely enabled, and so could be inappropriately enabled by a software bug, which is what the asker is concerned about. Most real world MCU designs don't worry about that (eg, bad software could drive an input pin as an output...) but that concern is what the question on this page is about, and it's not evident that this is a meaningful response to that. \$\endgroup\$ Nov 20 '20 at 16:53
  • \$\begingroup\$ @ChrisStratton I apparently misunderstood the problem. I thought they wanted a way to prevent the code on the computer (which they either can't or don't know how to directly control) from outputting to the bus while the microcontroller is doing its thing. \$\endgroup\$
    – Hearth
    Nov 20 '20 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.