Smonson's untitled simple harddisk project

General discussions or ideas about hardware.
User avatar
exxos
Site Admin
Site Admin
Posts: 23762
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Smonson's untitled simple harddisk project

Post by exxos »

Bodge wires :excited: :excited: :excited:
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
Smonson
Posts: 710
Joined: Sat Oct 28, 2017 10:21 am
Location: Canberra, Australia
Contact:

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: 710
Joined: Sat Oct 28, 2017 10:21 am
Location: Canberra, Australia
Contact:

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
FB_IMG_1708131242016.jpg (61.4 KiB) Viewed 604 times
User avatar
Smonson
Posts: 710
Joined: Sat Oct 28, 2017 10:21 am
Location: Canberra, Australia
Contact:

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
hd5.jpg (151.68 KiB) Viewed 559 times
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:
User avatar
Smonson
Posts: 710
Joined: Sat Oct 28, 2017 10:21 am
Location: Canberra, Australia
Contact:

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
r5.jpg (217.85 KiB) Viewed 444 times
serial-console.jpg
serial-console.jpg (108.03 KiB) Viewed 444 times
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
msense.jpg (197.98 KiB) Viewed 444 times
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.
User avatar
Smonson
Posts: 710
Joined: Sat Oct 28, 2017 10:21 am
Location: Canberra, Australia
Contact:

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
hdd-case.jpg (93.07 KiB) Viewed 391 times
User avatar
Smonson
Posts: 710
Joined: Sat Oct 28, 2017 10:21 am
Location: Canberra, Australia
Contact:

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
pcb-v1.jpg (215.57 KiB) Viewed 217 times

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
built-v1.jpg (275.54 KiB) Viewed 217 times

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
speedtest.jpg (217.04 KiB) Viewed 217 times

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.
User avatar
chronicthehedgehog
Posts: 224
Joined: Sun May 08, 2022 6:11 pm
Location: The Midlands
Contact:

Re: Smonson's untitled simple harddisk project

Post by chronicthehedgehog »

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

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: 371
Joined: Sat Oct 21, 2017 1:14 am
Location: Brisbane,QLD Australia
Contact:

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.
Atari Falcon 030 | Atari 1040 STE | Atari 1040 STFM | Atari 1040 STF | Kryoflux & Supercard Pro Flux boards
Creator of the Atari ST Review magazine archive: https://www.chillichai.com/atari-st-review
Post Reply

Return to “HARDWARE DISCUSSIONS”