A3010 hard disc interface

Arc/RPCs, peripherals, RISCOS operating system & ARM kit eg GP2x, BeagleBoard
munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Tue Aug 26, 2014 10:33 am

It's a bit messy I'm afraid. The ribbon cables going to the CPU and the C&T IO chip are superglued to the PCB to stop movement. I guess I was feeling sadistic or something (stupid, probably) because in the end I didn't bother with kynar and just used the normal ribbon cables directly.

I had a couple of accidents, first I removed a pad from one of the C&T pins while trying to repair a short, however this didn't matter because it isn't normally connected to anything. Second, I removed a leg from IC8 (a set of inverters). The I!3* signal has to go through an inverter before going to the CPU, and I decided to forego using my own IC because IC8 has some spare gates on it. However to use them you have to lift the legs, and on the first attempt I broke one off. Fortunately there was another spare gate on the IC. In hindsight I probably should have just used a transistor or something on my own board.

I haven't taken pictures of the back because it's a pain lifting the PCB in and out. It is less interesting anyway, just the other 28 signals going directly to the ROM ICs and the mini-podule connector.

Hopefully tonight I'll get time to install the CF adapter and test it. It needs power, IIRC it's just a standard floppy power connector, so I could possibly use the connector for the floppy for initial testing, but ultimately I'll need to make a cable.
Last edited by munchausen on Tue Aug 26, 2014 2:27 pm, edited 1 time in total.

Zarchos
Posts: 2355
Joined: Sun May 19, 2013 8:19 am
Location: FRANCE

Re: A3010 hard disc interface

Post by Zarchos » Tue Aug 26, 2014 2:01 pm

Absolutely brilliant !
I've very excited and looking forward to reading here it works !

User avatar
danielj
Posts: 6285
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: A3010 hard disc interface

Post by danielj » Tue Aug 26, 2014 2:04 pm

munchausen wrote:It's a bit messy I'm afraid. The ribbon cables going to the CPU and the C&T IO chip are superglued to the PCB to stop movement. I guess I was feeling sadistic or something (stupid, probably) because in the end I didn't bother with kynar and just used the normal ribbon cables directly.
Go with "intrepid" :D

d.

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Tue Aug 26, 2014 2:16 pm

danielj wrote: Go with "intrepid" :D

d.
Why didn't I think of that!?

I've just done a bit more. Here's the CF card fitted (I really need to get a shorter IDE cable!):
IMAG0101.jpg
The 5V problem is really getting to me now because it seems that the machine will only boot 1 in 20 times or something like that. While looking at the issue I took a picture of the bottom as well:
IMAG0100.jpg
I really have to do some actual real life work now...

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Tue Aug 26, 2014 3:31 pm

Ok, so I've just tried formatting it and am having some problems. BUT, it looks like the interface is (at least partly) working.

I'm trying to use the A3010 to partition, with the version of HForm that danielj posted. I load it up from the RAM disc and get the following:

HARD DISC FORMATTER (V 2.19 24 Apr 92)
Format which drive (4 - 7) ?4
Drive 4 is and IDE drive

IDE drive ADFS:4 identifies itself as :
Description : SanDisk SDCFB-512
Firmware version : HDX 3.13
Configuration : 993 cylinders, 16 heads and 63 sectors/track

HFORM failed: Disc error 08 at :4/00000000 at line 2055
Press Return to continue

The question is, is this a problem with my interface or a software issue? I'm encouraged by the fact that it is detecting the drive correctly at least.

Error code 8 means "drive not ready" according to this: http://www.riscos.com/support/developers/prm/adfs.html

The ready pin on the IDE interface (pin 27) is not connected on the A3020 schematics, so I have not connected it either. I wonder if I should check the A4000 schematics, but first I will try another compact flash card.

pkersey
Posts: 205
Joined: Wed Feb 06, 2013 11:22 pm
Contact:

Re: A3010 hard disc interface

Post by pkersey » Tue Aug 26, 2014 4:01 pm

Very exciting progress!

By the looks it could be really some wiring missing. Another CF card will rule that out, for sure.

Zarchos
Posts: 2355
Joined: Sun May 19, 2013 8:19 am
Location: FRANCE

Re: A3010 hard disc interface

Post by Zarchos » Tue Aug 26, 2014 4:08 pm

Wooowww.

If you've got the identification OK, it's very promising.

It's a pity you don't have an A3020 or an A4000 with an up and running hard drive or CF/SD card, you could have simply removed it and plugged it in your modified A3010.

I don't know if it can help, but can you enter different values than the ones suggested by HFom ?
I'm thinking about trying to format with less cylinders for example.

I had some issues with some SD or CF card and I solved them by reducing the number of cylinders, in the 970 area, instead of the suggested 990 or so.

BTW I advise people who format cards and think it's ok because HForm reported no errors to do a 'Verify' from RISC OS, they'll see it's in fact quite often necessary to reformat with less cylinders, since the RISC OS verify signals errors on the drive.

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Tue Aug 26, 2014 4:23 pm

Haha, ok I've just looked at the A4000 schematics and it has pin 27 connected to +5V via a 5K resistor!

I don't have time to fix this now but it looks like that is almost certainly the issue.

User avatar
danielj
Posts: 6285
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: A3010 hard disc interface

Post by danielj » Tue Aug 26, 2014 4:39 pm

Well done! That could just be an incompatible CF card. Same error I got. If no joy, go for the SD to IDE option. That's pretty much guaranteed to work.

d.

steve3000
Posts: 1852
Joined: Sun Nov 25, 2012 12:43 am
Contact:

Re: A3010 hard disc interface

Post by steve3000 » Tue Aug 26, 2014 6:15 pm

munchausen wrote:IDE drive ADFS:4 identifies itself as :
Description : SanDisk SDCFB-512
Firmware version : HDX 3.13
Configuration : 993 cylinders, 16 heads and 63 sectors/track

HFORM failed: Disc error 08 at :4/00000000 at line 2055
Press Return to continue
Hey, that's great progress, well done!

The fact you've read the CF card ID is a really good sign and I suspect you may be ok with all wiring if you're getting that. Like the others (above), I've never had much luck with modern CF cards in the A3020 or A4000. I find they usually read the ID ok but fail when formatting - just like you've seen. There's an article on the APDL website which suggests that older CF cards from pre-2009(?) are more likely to work, but something changed in the IDE spec the main CF manufacturers use since then and this conflicts with Acorn's IDE implementation.

However, the SD to IDE adapters (£6-£7 off certain auction sites and amazon) I find work very reliably on the A3020 and A4000.

Do you have an old IDE drive? This would be the best test, to rule out card and adaptor issues?

P.S. Love the wiring on the mainboard, very DIY project!

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Wed Aug 27, 2014 9:04 am

I added the missing resistor and checked all the wiring, used a shorter IDE cable, and have scratched my head for a while. After thoroughly checking the schematics I've now figured out the problem - I misread a pin number on the schematic. I read 155 but it is actually 156, which means that I've soldered a wire to the wrong pin on the CPU. I have to fix this and hopefully it will then be working...

EDIT: back to stumped again. Clearly the incorrect pin must have been a problem, but it hasn't fixed anything - I still get the same error when trying to partition.

EDIT2: I managed to connect up a real 2.5" IDE drive. However, I now get error 21, which is apparently "drive busy when commanded", and it wont even identify the disc at all. Really unsure what is going on now...

User avatar
danielj
Posts: 6285
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: A3010 hard disc interface

Post by danielj » Wed Aug 27, 2014 1:04 pm

How old's the HDD? The Acorn IDE interface basically doesn't get on with anything more recent than about 1998... :D

d.

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Wed Aug 27, 2014 1:19 pm

I've tried various from about 500MB to about 800MB, as well as the conner driver that came with the IDE mini-podule, which is about 20MB I think. That one gives error 22. I've no idea if any of the drives work, they've been in a box for years and have moved house with me several times...

Aside from going around resoldering all the connections I'm all out of ideas for the moment, I've checked my board and tested all the connections, checked the schematics and my drawings for something I've missed and looked for shorts, and I can't find anything wrong. :cry:

Wondering whether to just buy an A3020 now. Don't suppose anyone's got one they wouldn't mind parting with?

User avatar
danielj
Posts: 6285
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: A3010 hard disc interface

Post by danielj » Wed Aug 27, 2014 1:28 pm

Try the SD card to IDE first. That's something we know works with the A3020 interface?

d.

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Wed Aug 27, 2014 2:35 pm

Maybe I will buy an SD adapter, but I'm not convinced that is the issue.

I don't really understand what is going wrong, because communication is clearly working in both directions as the CF cards all respond correctly to the identify command and send back their identity correctly.

I have a couple of ideas what could be wrong:

1. Something is wrong with 16 bit mode but 8 bit mode works (unlikely?.. I don't think it has got to 16 bit mode yet, which is for bulk read/write).
2. The interrupt request is not connected properly (not sure about this either, as it is probably using it to get the drive ID).
3. There is a dodgy data line somewhere that doesnt always work (data 6 or 7)... this causes one of the status flags to look wrong and gives the error. This also seems unlikely because the status register is checked all the time during read/write and it worked during ID check and the same lines are used to transfer data, the error is consistent (always 8) and not random (at least with CF cards).

In short, I don't really have much of a clue what is wrong!

I have a logic analyser, which could potentially help debug this. However, that will take quite a lot of time, and I had hoped to be done by now.

I'm away for the rest of the week and busy on the weekend, so this will have to go on the back burner again. I may come back to it, but I'll also be on the look out for an A3020.

Zarchos
Posts: 2355
Joined: Sun May 19, 2013 8:19 am
Location: FRANCE

Re: A3010 hard disc interface

Post by Zarchos » Wed Aug 27, 2014 3:16 pm

I can send you a working hard drive pulled out from one of my A3020s.

User avatar
danielj
Posts: 6285
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: A3010 hard disc interface

Post by danielj » Wed Aug 27, 2014 6:37 pm

So, I never bothered with CF on my A3020, mainly on the advice of APDL. I did try with my RiscPC and would get the card recognised then errors 21/22 or sometimes 8 when I actually tried to do something with it. Sometimes I'd manage to get it formatted, then it'd start playing up. Plopped in an SD/IDE converter and it worked straight away.

I didn't, however, have any HDDs to play with (actually, I have one which should have, but it refused to play ball, and I've subsequently discovered it is completely dead).

Don't write it off until you've tried a known working drive :D (just rooting for you here!)

d.

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Thu Aug 28, 2014 8:03 am

danielj wrote:So, I never bothered with CF on my A3020, mainly on the advice of APDL. I did try with my RiscPC and would get the card recognised then errors 21/22 or sometimes 8 when I actually tried to do something with it. Sometimes I'd manage to get it formatted, then it'd start playing up. Plopped in an SD/IDE converter and it worked straight away.

I didn't, however, have any HDDs to play with (actually, I have one which should have, but it refused to play ball, and I've subsequently discovered it is completely dead).

Don't write it off until you've tried a known working drive :D (just rooting for you here!)

d.
You're right, of course, I was just frustrated yesterday. Is there a particular SD->IDE adapter I should try or will any do?

I still think I may need to use the logic analyser, I just hope that this doesn't turn into too lengthy a process.

User avatar
danielj
Posts: 6285
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: A3010 hard disc interface

Post by danielj » Thu Aug 28, 2014 9:35 am

I'm using one of these in a RiscPC:
http://www.amazon.co.uk/gp/product/B001AH5AIE/ (seems to have gone up in price)

But the key thing is the interface chip, something with a FC1306T so far as I can tell?

I've attached another version of HForm for you to try too, apparently this knows more drive geometries.

d.
Attachments
hform256.zip
(27.11 KiB) Downloaded 63 times

steve3000
Posts: 1852
Joined: Sun Nov 25, 2012 12:43 am
Contact:

Re: A3010 hard disc interface

Post by steve3000 » Thu Aug 28, 2014 12:27 pm

I ordered one of these (at £4.41) earlier this month and it should be arriving any day (20 day delivery): http://www.ebay.co.uk/itm/390897767275? ... EBIDX%3AIT

In the pics, it looks like a different chip to the FC1306T (which my previous SD->IDE adaptors all have) so when it turns up, I'll see if it works and report back.

pkersey
Posts: 205
Joined: Wed Feb 06, 2013 11:22 pm
Contact:

Re: A3010 hard disc interface

Post by pkersey » Thu Aug 28, 2014 7:46 pm

munchausen wrote: Maybe I will buy an SD adapter, but I'm not convinced that is the issue.
I have that feeling myself... not related to the adapter. Anyway just a guess.
munchausen wrote: 1. Something is wrong with 16 bit mode but 8 bit mode works (unlikely?.. I don't think it has got to 16 bit mode yet, which is for bulk read/write).
If you can get it to fully work only in plain 8-bit mode it would suffice, as the mini-podule IDE expansions we get for our Tens is actually 8-bit anyway!
munchausen wrote: In short, I don't really have much of a clue what is wrong!
Are all the errors you get of the "drive not ready" type? That could be a line of enquiry.

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Thu Aug 28, 2014 9:34 pm

danielj wrote: I've attached another version of HForm for you to try too, apparently this knows more drive geometries.
Thanks, I will give it a try.

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Thu Aug 28, 2014 10:40 pm

pkersey wrote:
munchausen wrote: 1. Something is wrong with 16 bit mode but 8 bit mode works (unlikely?.. I don't think it has got to 16 bit mode yet, which is for bulk read/write).
If you can get it to fully work only in plain 8-bit mode it would suffice, as the mini-podule IDE expansions we get for our Tens is actually 8-bit anyway!
Yeah, the mini-podule connector is only 8-bit so all mini-podules are 8-bit.

If I could somehow force an 8 bit mode I would, but as far as I know this isn't possible?

In fact I think I may have been wrong about only using 8 bit mode so far... but it's hard to be sure.

The strange thing is how 16-bit mode is implemented. The low 8-bits are read/written on bits 0-7 of the data bus as you would expect, but the high 8-bits are written to bits 24-31 and read from bits 8-15 of the data bus. Two latches are used for this, one for reading and one for writing, and these are latched using Wb! and B!, and output using Wbe! and Rbe!. Because Wb!, Wbe! and Rbe! are connected directly to CPU pins I suspect that something could be going wrong with this. (In fact, bit 7 is provided by the IDE controller with the IDED7 signal... I'm not sure why this).

It's also strange because using latches for the upper 8 bits makes sense on an 8 bit micro where you can only read/write 8 bits at a time because then when, e.g. doing a read you can read the lower 8 bits while latching the upper 8 to be read later. However, even in this case it doesn't really make sense to use separate parts of the bus for read and write. Perhaps the ARM instruction set can explain this decision (maybe someone here knows more?)
pkersey wrote:
munchausen wrote: In short, I don't really have much of a clue what is wrong!
Are all the errors you get of the "drive not ready" type? That could be a line of enquiry.
The errors are always 8 "drive not ready" with compact flash cards. I assume this means that the ready flag (bit 6) in the drive status register is not set to ready, but I could be wrong. With hard disks I've had error 21 "drive busy when commanded" and error 22 "drive busy on command completion" which I assume means a similar thing for bit 7 of the status register (the busy flag), but again I could be wrong. Note that the status register is only 8 bits, so bits 8-15 are not needed to read it.

I know that the identify command works on CF cards (it doesn't get that far with the hard drives I've tried), and though I haven't looked into the ATA spec in much depth yet I think that this should exercise almost every connection. I need to check this. I also need to look into the IDE controller and the ARM signals in more detail.

I'm becoming reluctant because to properly debug the controller I'll need to learn so much and could still ultimately fail (e.g. what if I've damaged an input/output on one of the ICs - I don't think I have, but it's possible). I was really hoping that after wiring it up it would just work. Anyway, I will probably keep prodding it, at least until I spot an A3020 for a reasonable price! Thanks for the interest and enthusiasm, it does keep me wanting to get it working!

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Fri Aug 29, 2014 9:29 am

I've just realised the above is slightly wrong, because the low 8 bits are connected to the IO data bus, while the high bits are on the standard memory bus...

User avatar
1024MAK
Posts: 7566
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: A3010 hard disc interface

Post by 1024MAK » Fri Aug 29, 2014 11:45 am

Is this apparently strange arrangement due to the bus cycle timing being too short / incompatible with the IDE timing?

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

theom
Posts: 2
Joined: Fri Sep 05, 2014 8:17 am
Contact:

Re: A3010 hard disc interface

Post by theom » Sun Oct 05, 2014 10:33 pm

I was pointed at this thread, but until now haven't had a chance to comment. So apologies if this is a little late.

If IDENTIFY is working for you, 90% of the interface is there.
I'm afraid your board layout is very awkward for me to reverse engineer (it's better to draw a schematic first so people can understand it, then a board layout second), but I'd suggest concentrating on the interrupt line. As far as I can see you have a pull-down to ground, and then have labelled the line as /I13* (do I read that right?). I don't have the A3010 docs to hand, but most podule etc interrupts are negative-going open-collector (/PIRQ), while the IDE interrupt INTRQ is positive-going. Are you sure you've wired this correctly into positive-edge logic, because that's not what you've labelled it as? Also the HDD interrupt isn't number 13 (that's the podule interrupt).

I haven't looked at your upper data bus latching in too much detail: it's not something I've seen before, but I trust that you've copied it appropriately from another machine that has a 16 bit podule bus (like the A3000).

It's probably safer to permanently ground /IOCS16 into the 82c711, because many modern drives don't assert this properly.
I wouldn't trust CF cards since many simply don't work, do you not have some old HDDs to try (<10GB)?

Finally, your cable is fairly long. You might try some series resistors (say 22 ohm) in series with /IOR and /IOW because ringing on these lines can cause bytes to be lost, especially if they have rapid edges, the signal integrity isn't good, and they aren't being buffered (something to consider).

Zarchos
Posts: 2355
Joined: Sun May 19, 2013 8:19 am
Location: FRANCE

Re: A3010 hard disc interface

Post by Zarchos » Wed Oct 08, 2014 12:06 pm

Theo, thanks a lot for all this.

I have the feeling this will end successfully =D>

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Tue Oct 14, 2014 6:56 pm

theom wrote:I was pointed at this thread, but until now haven't had a chance to comment. So apologies if this is a little late.
No problem - thanks a lot for the informative post! I've been a bit overwhelmed lately anyway.
theom wrote:If IDENTIFY is working for you, 90% of the interface is there.
That's encouraging :)
theom wrote:I'm afraid your board layout is very awkward for me to reverse engineer (it's better to draw a schematic first so people can understand it, then a board layout second), but I'd suggest concentrating on the interrupt line. As far as I can see you have a pull-down to ground, and then have labelled the line as /I13* (do I read that right?). I don't have the A3010 docs to hand, but most podule etc interrupts are negative-going open-collector (/PIRQ), while the IDE interrupt INTRQ is positive-going. Are you sure you've wired this correctly into positive-edge logic, because that's not what you've labelled it as? Also the HDD interrupt isn't number 13 (that's the podule interrupt).
I'll try to sort out a schematic. I've basically just copied the missing parts for the IDE interface from the A3020 schematics. (BTW those documents are available here: http://chrisacorns.computinghistory.org ... awings.zip).

As far as the interrupt line is concerned, on the A3020 schematic this signal runs through an inverter and the ARM250 pin it then connects to is marked I!3*. I have marked it /I!3* (double negative?) as it is subsequently run through a spare inverter on the A3010 PCB (you can see it to the bottom left of the ARM250 in my photos). This does result in a very long wire though, so maybe this is the problem.
theom wrote: I haven't looked at your upper data bus latching in too much detail: it's not something I've seen before, but I trust that you've copied it appropriately from another machine that has a 16 bit podule bus (like the A3000).
Well I just copied it from the A3020 schematic, but I think that is still ok.
theom wrote: It's probably safer to permanently ground /IOCS16 into the 82c711, because many modern drives don't assert this properly.
I wouldn't trust CF cards since many simply don't work, do you not have some old HDDs to try (<10GB)?

Finally, your cable is fairly long. You might try some series resistors (say 22 ohm) in series with /IOR and /IOW because ringing on these lines can cause bytes to be lost, especially if they have rapid edges, the signal integrity isn't good, and they aren't being buffered (something to consider).
I'll try grounding /IOCS16.

I have a lot of old hard discs and indeed have tried some - so far this has been less successful than with the CF cards though - with real IDE drives identify does not work.

I will also try resistors on /IOR and /IOW.

Again, thanks a lot for these useful suggestions. I'll be sure to post back here when I've had time to try them!

munchausen
Posts: 168
Joined: Fri May 30, 2014 8:53 am
Contact:

Re: A3010 hard disc interface

Post by munchausen » Wed Oct 15, 2014 5:03 pm

As well as grounding IOCS and adding in line resistors to IOR and IOW (and perhaps I!3) I've decided I need to add some capacitors (an oversight I should have corrected earlier). I'll put 100nF across the ICs, but I think I should also add something to the supply rails. A 100uF electrolytic seems sensible?

I'd like to play with this now but time is so short...

User avatar
1024MAK
Posts: 7566
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: A3010 hard disc interface

Post by 1024MAK » Thu Oct 16, 2014 11:08 am

Without seeing your layout, it is hard to say...
But yes, 100nF ceramic multilayer caps across the supply pins of each IC is good practice.
If there is any long-ish +V or 0V/GND feeds, yes add 47uF or 100uF low ESR capacitors.
All power feeds should be low impedance (large conductors) to reduce volt drop during current spikes.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

Post Reply