Smonson's untitled simple harddisk project

General discussions or ideas about hardware.
User avatar
exxos
Site Admin
Site Admin
Posts: 28344
Joined: 16 Aug 2017 23:19
Location: UK

Re: Smonson's untitled simple harddisk project

Post by exxos »

Bodge wires :excited: :excited: :excited:
User avatar
Smonson
Posts: 717
Joined: 28 Oct 2017 10:21
Location: Canberra, Australia

Re: Smonson's untitled simple harddisk project

Post by Smonson »

My USB Blaster stopped working last week, which has put a damper on projects for the time being. It was one of those little cheap ones with nothing inside it but a PIC microcontroller. I've bought one of the bigger "official" Altera-designed ones but it'll take a few more weeks to get here thanks to COVID.
User avatar
Smonson
Posts: 717
Joined: 28 Oct 2017 10:21
Location: Canberra, Australia

Re: Smonson's untitled simple harddisk project

Post by Smonson »

Been trying to finish some projects recently. I got the last prototype of this drive working pretty well - but still occasionally some data corruption happens. With just 2 LEDs for debugging, it was pretty hard to work out what was going on, so I've got a bigger "hero" prototype design ready here which has a serial port on it. This will be just to work out where the issue is and see if I can solve it.
FB_IMG_1708131242016.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Smonson
Posts: 717
Joined: 28 Oct 2017 10:21
Location: Canberra, Australia

Re: Smonson's untitled simple harddisk project

Post by Smonson »

And now exactly the same thing again only in TQFP-100. Why? Because I still have 4 of them. There is no way to buy any 5M40Z, 5M80Z, 5M160Z or 5M240Z in any QFP-64 or QFP-100 from Mouser, they just have a few -144s left.
hd5.jpg
And I just saw that in July Intel are going to stop producing MAX II, MAX V, MAX 10, Cyclone II, Cyclone III and Cyclone IV in any non-lead-free QFP packages due to their outsourced manufacturer decommissioning that equipment. It's possible they might continue making these products in a RoHS version but it's bound to put the boot into supply even more than it already is. They're already double the price they were when I started this idea, and ice40s are going through the roof as well.
First Bitcoin, then COVID, and now generative AI... we're never gonna have any FPGAs again :dizzy:
You do not have the required permissions to view the files attached to this post.
User avatar
Smonson
Posts: 717
Joined: 28 Oct 2017 10:21
Location: Canberra, Australia

Re: Smonson's untitled simple harddisk project

Post by Smonson »

Yo. So time passed, and I've got this one all made up now. It works perfectly apart from the same issues that the last one had :D
The serial console is something I should have included from the start... you live and learn!
r5.jpg
serial-console.jpg
Although there is one new thing, and it's a mystery to me. I'm using the ICD driver, and right after bootup it displays this "<MSense: $FD>" message in the corner and then hangs.

There are no errors on the hard drive side, and under inspection with a logic analyser the last data transfer worked fine and put the bus back into a ready state.
msense.jpg
The docs refer to an MSense: $fe error code, but I can't find anything about what $fd is trying to tell me. Anyone know?

I think it only happens if I have "retries" switched on in the driver, but no data transfers fail, and it makes no attempt to retry anything. Totally weird.
You do not have the required permissions to view the files attached to this post.
User avatar
Smonson
Posts: 717
Joined: 28 Oct 2017 10:21
Location: Canberra, Australia

Re: Smonson's untitled simple harddisk project

Post by Smonson »

I'm not sure what the go was with that MSense thing, but it went away after a bit of refactoring and hasn't come back.

Actually I've had this running for a few nights playing Monkey Island, Civilization, and Quest for Glory 1, and just copying files around, without any data errors. So I think this thing is nice and stable now.

I'm at a point where I'm tidying up the codebase and making sure any error conditions are handled before I call it done. I've found a nice case that it should fit nicely into and I've started laying out what could be the final version of the PCB.

I'll put an internal microsd slot in it as well as the front-facing full-size SD card to facilitate backups and copying files around. The next version needs a faster MCU because the atmega324p that I used this time is a little slow at 3.3v - next one will be an avr128da running at 20MHz which will give a 10MHz SPI connection to the cards. I'm getting 244KB/s at the moment at 3.125MHz so it will hopefully be about triple the speed. 244KB/s still feels rather fast compared to the ST's "thinking time" so I'm not too hung-up on those numbers.

I guess I'd better chuck a real-time clock in there somewhere as well.

It's a great feeling when projects sometimes actually progress!
hdd-case.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Smonson
Posts: 717
Joined: 28 Oct 2017 10:21
Location: Canberra, Australia

Re: Smonson's untitled simple harddisk project

Post by Smonson »

Has it really only been less than a month since I updated this thread? It feels like so long.

So I've got the new boards, which I'm calling v1 as this revision has everything on it that I wanted to put on it, hence it's not really a research prototype anymore, it'll hopefully be a reliable unit. Fits into the box pretty nicely. This was my first 4-layer board and it worked out great. So much easier routing all the power pins.

pcb-v1.jpg

I bought the wrong LEDs (too big) and forgot to get SOT-223 5v regulators so I did a couple of hacks on this first board. No showstoppers.

built-v1.jpg

I squeezed everything in that I wanted to include
  • The faster and better AVR128DA MCU
  • Two SD cards instead of one: an internal microSD one, and a removable full-size SD card
  • Battery-backed real-time clock
  • A jumper which will disable the ability to change the settings
The new post-Microchip-acquisition AVRs are a LOT better to program on than the old classic ATMEGA328P lineage was. There was a lot of massaging code over to the new way of doing things. But that seems to be mostly working now. Enough to get it to boot, anyway. I still have things that need to be investigated.

Speed's good with a fast enough SD card - this one (card #1) happened to be a cheap old no-name brand one. 1.25MB/s is the theoretical maximum for the SPI clock speed I've used, which is 10MHz (the most you can get from an AVR). Most of the delay for reading an SD card is waiting for the card to be ready.

speedtest.jpg

I'll be focusing on improving the software side before anything else. I did a little experiment recently where I wrote a TOS program to send an ACSI command to the drive - it wasn't too much work. I think a little Atari-side test suite is in my future.
You do not have the required permissions to view the files attached to this post.
User avatar
chronicthehedgehog
Site sponsor
Site sponsor
Posts: 383
Joined: 08 May 2022 18:11
Location: The Midlands

Re: Smonson's untitled simple harddisk project

Post by chronicthehedgehog »

Excellent job and that's a decent speed
User avatar
Smonson
Posts: 717
Joined: 28 Oct 2017 10:21
Location: Canberra, Australia

Re: Smonson's untitled simple harddisk project

Post by Smonson »

Forgot to mention that I'll open-source this project eventually.
User avatar
kodak80
Posts: 536
Joined: 21 Oct 2017 01:14
Location: Brisbane, QLD, Australia

Re: Smonson's untitled simple harddisk project

Post by kodak80 »

Nice board and great work to get it to this stage. It always feels good to get things finished.

Looking forward to the open-source release and getting to build it when you are done.
Creator of the Atari ST Review and ST Action magazine archives: https://www.chillichai.com/

Return to “HARDWARE DISCUSSIONS”

Who is online

Users browsing this forum: ClaudeBot, Google [Bot] and 10 guests