• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

TashTwenty: Single-Chip DCD (Hard Disk 20) Interface

tashtari

PIC Whisperer
So I went looking for answers on SD card power consumption and found this article which suggests that in SPI mode, cards seem to consume about 20-25 mA, and the PIC is specced to top out at about 5 mA, so that leaves 20 mA of headroom for any losses in the level converting circuitry... maybe that's cutting it close. I'm not sure of the wisdom of hooking up a separate power supply from the Mac's, though, something something ground loops. (I'm not an electrical engineer...)
 

warmech

Well-known member
So I went looking for answers on SD card power consumption and found this article which suggests that in SPI mode, cards seem to consume about 20-25 mA, and the PIC is specced to top out at about 5 mA, so that leaves 20 mA of headroom for any losses in the level converting circuitry... maybe that's cutting it close. I'm not sure of the wisdom of hooking up a separate power supply from the Mac's, though, something something ground loops. (I'm not an electrical engineer...)
Hmm... then I'll probably avoid using an external supply. Out of curiosity, were there any steps getting the PIC flashed outside of just writing the HEX straight to it? Did it need any other control bits set or what have you? Just want to make sure I wrote the darn thing correctly. Grasping at straws, I know, but it's at least one other thing put to rest.
 

tashtari

PIC Whisperer
were there any steps getting the PIC flashed outside of just writing the HEX straight to it?
The .HEX file contains everything, including the config registers, so nothing else should be required. But, just so we have the bases covered, what steps did you follow to write the .HEX file to the PIC?
 

warmech

Well-known member
Okay, good-ish news (but PIC steps first)! When I selected the PIC16F1825 in the MPLAB IPE, it complained about not being able to recognize the device in the PICKit. I dropped the voltage from 5v to 3.125 and it immediately recognized it. I'm entirely unsure of how that worked, as I thought the 16F line could be programmed at 5v out of the box (but I'm probably wrong). Once recognized, I verified the chip was blank and then loaded up the HEX file and wrote it to the PIC. Once finished, I verified the chip and HEX file matched and considered it done. Was I doing something weird by lowering the voltage that low? IPE would just not detect there was a chip present at the stock voltage (which I presume is 5v).

As for the good news... it kinda works now. I went through some of my SD cards and finally stumbled upon one that worked. Funny enough, it's a cheapo store brand (Micro Center), but System 7 recognized it as soon as it booted up and asked to initialize it. My Classic kept saying it was initialized but not mounting it afterwards, so I tried it in my SE. The SE did the job right the first time and I was able to copy the System directory over on to it and boot from the ahem "HD20" successfully (and I dig the gothic T icon). I moved it back to my Classic and it recognized it and booted from it as well. I have no idea why it worked the second time around on the Classic, but it did. Oddly, though, when I used the MBR table you provided it only recognized one of the two 20MB partitions (nor the third one, either). It appears to have no issues with that first partition, but the other two just don't show up (unless I'm doing something wrong, which I probably am). I haven't tried it with another partition map yet, as I just got it running. I've also got a 3.3v 800mA regulator that should be here tomorrow, so I can test again with that just in case it's drawing just enough current over what the 50mA one can provide.

IMG_3789.jpg
 

tashtari

PIC Whisperer
Was I doing something weird by lowering the voltage that low? IPE would just not detect there was a chip present at the stock voltage (which I presume is 5v).
I'm assuming here that you're powering the chip from the PICkit rather than from an external circuit? I... have had weird results trying to power circuits from my ICD3, the driver invariably crashes for some reason. For that reason, I always program in an externally powered circuit. I don't know if the PICkit is any better or worse, but it wouldn't surprise me if that route is a bit troublesome. In any case, the chip should definitely be able to program in a circuit with a 5V supply voltage.

I've also got a 3.3v 800mA regulator that should be here tomorrow, so I can test again with that just in case it's drawing just enough current over what the 50mA one can provide.
This is just from instinct, not expertise, but the problems you're describing sound fiddly enough to be power problems, so I'd reckon there's reason to hope that a bigger regulator will yield better results.

I'm glad you've had some success, though! I'm wondering if the behavior you're seeing with only the one partition showing up has something to do with your using System 7... my data points are limited, but I've so far tested this on all three of my machines that have floppy ports, and both the 512ke and Classic (both running 6.0.8 or earlier) show all the partitions, while the Classic II (running 7.x) only shows the first. This could be because of the system version, the ROM, or the processor speed, but I did notice that in System 7, the emulated HD20 had a floppy disk icon in file dialog boxes, which makes me suspicious of how it's handled by the operating system. In any case, it's worth testing to see if you get all the partitions if you boot into 6.0.8 instead of 7.x...
 

Iesca

Well-known member
My assembled Tash20!

20220401_191206.jpg

Looking forward to trying it out! Thank you!

Some minor thoughts:

The electrolytic cap should probably have maybe half of a mm more clearance for the dip when it's in its socket (it pushes against the cap slightly once inserted). And a little stickypad for the underside of the sd card board would make it less wobbly! For the DB-19, maybe some solder pads for the rest of the pins on top for structural integrity?
 
Last edited:

warmech

Well-known member
I'm assuming here that you're powering the chip from the PICkit rather than from an external circuit? I... have had weird results trying to power circuits from my ICD3, the driver invariably crashes for some reason. For that reason, I always program in an externally powered circuit. I don't know if the PICkit is any better or worse, but it wouldn't surprise me if that route is a bit troublesome. In any case, the chip should definitely be able to program in a circuit with a 5V supply voltage.


This is just from instinct, not expertise, but the problems you're describing sound fiddly enough to be power problems, so I'd reckon there's reason to hope that a bigger regulator will yield better results.

I'm glad you've had some success, though! I'm wondering if the behavior you're seeing with only the one partition showing up has something to do with your using System 7... my data points are limited, but I've so far tested this on all three of my machines that have floppy ports, and both the 512ke and Classic (both running 6.0.8 or earlier) show all the partitions, while the Classic II (running 7.x) only shows the first. This could be because of the system version, the ROM, or the processor speed, but I did notice that in System 7, the emulated HD20 had a floppy disk icon in file dialog boxes, which makes me suspicious of how it's handled by the operating system. In any case, it's worth testing to see if you get all the partitions if you boot into 6.0.8 instead of 7.x...
Yep, powered by the PICKit; after doing some research, it seems PICKit 3's are hit or miss with internal power. I may try programming another with a jerry-rigged socket that uses a solid 5v external power supply driving the PIC. I also need to test this with the 866 and have the PICKit verify the programming - forgot to try that earlier.

And me too, regarding the success! I'm so glad I got it running to the extent it is now. I'm hopeful that the regulator does the trick, as it's the only deviation from the rest of the parts that I had to make. Stupid part shortages... I plan on doing some more testing tomorrow afternoon after I get my office tidied up and have the regulator on hand. I have a System 5 boot disk somewhere around here (ironically, for messing around with my working HD20); I may toss that into my SE and see if I can get different results. Either way, I'll keep you posted on how everything turns out.

Thanks again for figuring all of this out! This really is an awesome alternative for the HD20; I hope it can bring back some dead ones to life!
 

warmech

Well-known member
My assembled Tash20!

View attachment 40127

Looking forward to trying it out! Thank you!

Some minor thoughts:

The electrolytic cap probably should maybe half of a mm more clearance for the dip when it's in its socket (it pushes against the cap slightly once inserted). And a little stickypad for the underside of the sd card board would make it less wobbly! For the DB-19, maybe some pads for the rest of the pins on top for structural integrity?
Nice! That thing truly is very tiny, lol!
 

demik

Well-known member
So I went looking for answers on SD card power consumption and found this article which suggests that in SPI mode, cards seem to consume about 20-25 mA, and the PIC is specced to top out at about 5 mA, so that leaves 20 mA of headroom for any losses in the level converting circuitry... maybe that's cutting it close. I'm not sure of the wisdom of hooking up a separate power supply from the Mac's, though, something something ground loops. (I'm not an electrical engineer...)
That's true, but is if you look at the schematic, it _averages_ for 20-25 mA but bursts for 95 mA.

On my design, the PIC is powered by the Mac directly (5V), as well as the level converting circuit. The 3.3V regulator is only used by the SD card.

95mA is over the 50mA that @warmech used due to component shortage. It may works is the burst is short enough and the decoupling capacitor but that may not be enough.

If you look at that Datasheet from TDK, it needs for 100mA as well : https://www.mouser.com/catalog/specsheets/tdk_07292019_mmrd4_murd4_.pdf

Okay, good-ish news (but PIC steps first)! When I selected the PIC16F1825 in the MPLAB IPE, it complained about not being able to recognize the device in the PICKit. I dropped the voltage from 5v to 3.125 and it immediately recognized it. I'm entirely unsure of how that worked, as I thought the 16F line could be programmed at 5v out of the box (but I'm probably wrong). Once recognized, I verified the chip was blank and then loaded up the HEX file and wrote it to the PIC. Once finished, I verified the chip and HEX file matched and considered it done. Was I doing something weird by lowering the voltage that low? IPE would just not detect there was a chip present at the stock voltage (which I presume is 5v).

As for the good news... it kinda works now. I went through some of my SD cards and finally stumbled upon one that worked. Funny enough, it's a cheapo store brand (Micro Center), but System 7 recognized it as soon as it booted up and asked to initialize it. My Classic kept saying it was initialized but not mounting it afterwards, so I tried it in my SE. The SE did the job right the first time and I was able to copy the System directory over on to it and boot from the ahem "HD20" successfully (and I dig the gothic T icon). I moved it back to my Classic and it recognized it and booted from it as well. I have no idea why it worked the second time around on the Classic, but it did.

I halo had to program mine two times with a PICKit 3 to get it working and set the voltage to 5V, but it was only providing 4.3V.
First pass it was supposed to be programmed successfully but didn't verify, second time (after a PICKit reboot), it went well.

Anyway, glad you got it working! Good job!

If the power regulator is the issue, I'm assuming this specific SD card is eating less current. It's also possible that the other ones aren't switching to SPI mode correctly. What size is the one that worked ?

And me too, regarding the success! I'm so glad I got it running to the extent it is now. I'm hopeful that the regulator does the trick, as it's the only deviation from the rest of the parts that I had to make. Stupid part shortages... I plan on doing some more testing tomorrow afternoon after I get my office tidied up and have the regulator on hand. I have a System 5 boot disk somewhere around here (ironically, for messing around with my working HD20); I may toss that into my SE and see if I can get different results. Either way, I'll keep you posted on how everything turns out.
What regulator will you be using btw ?
 

warmech

Well-known member
Good news everyone! All problems appear to be generally resolved now. The regulator (more on that below) appears to have absolutely been an issue; the flaky behavior on the Classic is gone and it recognizes and initializes cards (also more on that below) without complaint. It appears 50mA is just low enough to cause edge-case issues. I'd try to stay at 100mA or greater if regulator availability is less than plentiful.
What regulator will you be using btw ?
Not a single "part" per se. I found a cheap set of six pre-assembled barebones 3.3v power supplies on Amazon for under $7 shipped and figured I'd give them a try. I pulled the header off of one and wired it in to the pads where the 50mA regulator went (after removing it first) and it drove the SD card without issue. Not a permanent solution, but it does kind of confirm that I was too low on provided current.

As far as the rest of the unit working with SD cards... I think my issue was that I was using some pretty ancient cards. Most of my inventory is several years old (I don't appear to own anything over 16GB, save for a 256GB card in my Switch, and most of those 16GB cards were all purchased when 16GB on a microSD was nothing to sneeze at) except for the one that worked, which I bought several months ago now. I checked the card and saw that it was a Class 10, U1 model and thought, heck, why not try to find another one nearby for cheap. Once quick trip to Walmart later and I had two no-name brand 32GB C10/U1 microSD cards for the low price of $12 - and they both worked flawlessly. So far, I've only run into a couple of issues:
  • Both my SE and Classic will only recognize the first partition; while they are both running System 7.1, I booted the SE to System 5 and encountered the same result. However, when I booted my Plus to System 5. it saw all four and initialized them with no issue. Well, sort of; this leads into issue two. I'll run some more tests on this issue later once I have my office cleaned up.
  • All the Macs I used will initialize a 20MB volume just fine, but the 931MB partition from the MBR file @tashtari provided sat there for ~10-12 minutes initializing (the activity light was blinking, so I know the system wasn't hanging) and then crashed the system (video attached of what that looks like - it's kinda neat and I've never seen a system bomb dialogue like it before). I tried with a 100MB partition and got the same result. I haven't narrowed down a sweet spot yet, but I'll try again in a bit.
Outside of these issues, this thing's humming along fine! I even used it to recover the contents of my one good HD20 that I'd imaged a while back. As a neat bonus, I've attached the StartupScreen file that I was very pleasantly surprised with when I got the thing to boot the first time. I wonder if this was a thing provided by Infocom at some point? The HD20 in question had Zork I buried several directories deep, but no other games, so who knows.

IMG_3698.jpg
 

Attachments

  • IMG_3795_720.mov
    8.4 MB
  • Infocom_Startup_Screen.dsk.zip
    2.5 KB · Views: 2

tashtari

PIC Whisperer
Interesting stuff!

Not sure how to account for the differences in behavior with regard to the partitions beyond the first. I haven't yet tried my unit on an SE, but it would surprise me to learn that the SE's ROM doesn't support it while the Classic's does - I've successfully got four partitions to show up on my Classic.

I have heard tell that really old SD cards are more power-hungry than newer ones, but I haven't been able to test this for myself, since my design only takes microSD cards, which are necessarily a bit younger than full size cards can be. For my part, my two cards that I've tested with are 32GB and 1GB, so anything of the vintage where 1GB was a lot ought to be fine. From a software perspective, anything dating back to the original MMC card spec really should be all right, but I can't discount the possibility of a firmware bug - initializing SD/MMC cards seems to be a bit black magic by nature.

I wonder if the crash while initializing the big partition is a System 5 thing. It took several minutes, but I was able to successfully initialize the big partition on 6.0.8. Maybe not, though, as it looks like support for partitions up to 2 GB in size was introduced in 4.1...
 

demik

Well-known member
Good news everyone! All problems appear to be generally resolved now. The regulator (more on that below) appears to have absolutely been an issue; the flaky behavior on the Classic is gone and it recognizes and initializes cards (also more on that below) without complaint. It appears 50mA is just low enough to cause edge-case issues. I'd try to stay at 100mA or greater if regulator availability is less than plentiful.

That's good news ! Nice idea with the Amazon regulators, I didn't think if this issue. So yeah the 50mA is too short but some low power SD cards.
The formatting thing is interesting, I will give it a try as well.

By the way, are you using your TashTwenty with your HD20 or with the companion board ?
 

tashtari

PIC Whisperer
it would surprise me to learn that the SE's ROM doesn't support it while the Classic's does
Actually, I just had a thought about this. The SE is unique among Macs in that it supports two internal floppy drives and an external one. Maybe they decided to forego chained DCD support in the process of supporting the two internal drives and the Classic's ROM was based on the Plus ROM instead which is why it supports four. But also-also, System 7 cuts support for DCDs off at the first. It's out there, but it could be true...
 
Last edited:

tashtari

PIC Whisperer
The support matrix so far, given experiences from myself and warmech:
MachineSystem 6 or earlierSystem 7
512keall partitionscan't run
Plusall partitions?
SE (FDHD?)one partitionone partition
Classicall partitionsone partition
Classic II?one partition
Portable, IIci, IIsi, LC, IIcx with ROMinator, IIx with ROMinator, SE/30 with ROMinator, SE (non-FDHD?)??
 

tashtari

PIC Whisperer
Trying to figure out what I could do by way of experimentation on my own, I used my real-and-apparently-sort-of-working HD20 to run a few tests.
  • The HD20 with TashTwenty in its daisy chain port, connected to the 512ke: HD20 and all TashTwenty drives appear.
  • The HD20 with TashTwenty in its daisy chain port, connected to the Classic II: only the HD20 appears.
  • The HD20 with the Floppy Emu (in floppy mode) in its daisy chain port, connected to the Classic II: both HD20 and emulated floppy appear.
None of this was unexpected... but here's the kicker.
  • The HD20 with the Floppy Emu (in HD20 mode) in its daisy chain port, connected to the Classic II: both real HD20 and emulated HD20 appear!
Well, now we know some things we didn't before: System 7 does support multiple chained DCDs, but mainly, sometimes TashTwenty's speed of response to the control signals comes up short. Apparently this includes being anything but the primary device on the Classic II and, it wouldn't surprise me to learn, other 030 Macs.

I still can't explain why @warmech is seeing only one partition on the Classic, though, since my Classic gets all of them...
 

warmech

Well-known member
The support matrix so far, given experiences from myself and warmech:
MachineSystem 6 or earlierSystem 7
512keall partitionscan't run
Plusall partitions?
SE (FDHD?)one partitionone partition
Classicall partitionsone partition
Classic II?one partition
Portable, IIci, IIsi, LC, IIcx with ROMinator, IIx with ROMinator, SE/30 with ROMinator, SE (non-FDHD?)??
Okay, sorry for the delay - it was a busy weekend. :(

I ran the TashTwenty through the gamut of my Macs and can add the following:
  • your assessment and mine of the 512K line up perfectly, so we're good there
  • I had an identical experience with System 6 and earlier on my Plus, and also found success with System 7 seeing all partitions
  • I tested against the following SE models and had the same results as you - one partition across all OSes:
    • SE (Dual 800K Floppy)
    • SE (800K drive w/40MB HD)
    • SE FDHD
    • SE SuperDrive
  • I tested both of my Classics and had the same result as before: one partition across all OSes
  • I tested both of my Classic IIs and had the same result as you with respect to System 7 and also tested 6.0.8L and only got one partition there as well
I'm starting to wonder if, with my Classics, it's a power issue. Their analogue boards probably need recapping, so I may drop them into the Classic II I have recapped fairly recently for further testing. I also plan on reprogramming one of the spare PICs I bought with external power driving it during programming instead of relying on the PICKit to provide power. It's a reach, but it would be one more thing crossed off the list of possibilities.

Edit: The range of OSes I tested against were: 3.2, 4.0, 5.0, 6.0, 6.0.8, 6.0.8L, 7.0.1, 7.1, and 7.5.3 (where applicable on each Mac). I have a System 2 HD20 startup disk image that is corrupt, apparently, so I need to replace that and try again with my 512K, but I don't expect any difference in behavior. Heh, I don't have a ROMinator, but if I did, I would be very curious to install OS8 on one of my SE/30s and try it there...
 

tashtari

PIC Whisperer
I ran the TashTwenty through the gamut of my Macs
Thanks for being so thorough! I'm beginning to question my memory now - did I really see four partitions on the Classic? I looked back at page one of this thread, and realized that the picture showing the four partitions was on my 512ke. I'm going to have to haul the Classic out and try it again.

At this point I'm ready to posit that system version doesn't matter and that there's something about the timing of the routines in the Plus/512ke ROM (possibly also the 512k ROM with HD20 extension) that allows TashTwenty to get away with software-emulating the response to PH3 pulses that was changed in later ROMs. I looked at the code again, and the loop for device selection just cannot possibly be any tighter.

If I'm right, this is where we are - multiple partitions and chaining on the 512ke and Plus, one partition only on everything else (so far). Disappointing but far from useless.
 
Top