Page 89 of 285

Re: General Stuff(tm)

Posted: 14 Jan 2023 15:55
by stephen_usher
Can I stop hitting my head against a brick wall now?!

I'm trying to set the state of GPIO pin 28. According to the get output level function call the pin voltage is going up and down. However, the real-world voltage isn't changing. This worked in micropython so that must be doing something magical.

If I use the default setting for the pin then it's always low. If I set the pin function to "NULL", i.e. doesn't use a special hardware function such as SPI etc., then the pin is always high. Also, if I don't turn the pull-ups on then the output floats, even though Pico GPIO pins set to output should always be driven and are never tri-stated. (Another function confirms that the data direction is "out".)

Re: General Stuff(tm)

Posted: 14 Jan 2023 17:46
by stephen_usher
Erm... it mysteriously fixed itself and started working without me doing anything.

I don't trust things which do that as it probably means that it'll mysteriously stop working again at some point.

However, I have discovered that I need more pull-ups. Goodness knows how the python version worked fine but the C version has low voltages on the 5V data lines (as in 2V!).

Re: General Stuff(tm)

Posted: 14 Jan 2023 21:43
by stephen_usher
The pull-ups did their thing. The data lines are at a reasonable voltage now.

However, things aren't working. The Pico isn't able to write to the data bus, but it can read. I've tried re-initialising the data bus pins after changing direction but nothing. Still everything else is reliable. ;-)

I've got a decent set up and worked out a workflow for compilation and debugging.

IMG_2882.jpeg

Taking out all of the debugging text does speed things up a bit. Here's a trace of the Apricot testing to see if the hard disk interface is there by writing 2049 bytes to the data buffer (one byte at a time to the same address) and then trying to read back the first byte. It fails only because the Pico isn't outputting the data onto the bus.

IMG_2884.jpeg

As you can see the data burst takes about 16ms, so that's about 125KB/s without using PIO etc. or any real optimisation. Probably not far off the original 10MB hard drive speed actually. :-)

Now, if only I could write data to the host! (It must be possible as the micropython program could do it.)

Re: General Stuff(tm)

Posted: 15 Jan 2023 15:07
by stephen_usher
I've resorted to asking a question on the Rapsberry Pi forums as GPIO0-GPIO6 are not outputting anything but GPIO7 is working correctly.

Re: General Stuff(tm)

Posted: 15 Jan 2023 18:10
by stephen_usher
Oh, it's working now! :WTF:

Anyway, now starting on the rest of the state machines. The machine now thinks that it has a hard drive and the first couple of commands, which are simple (ScanID and Restore) have been written and seem to work as the machine expects.

I think next will be Seek before the more complex ones, such as Read and especially Write and Format.

Re: General Stuff(tm)

Posted: 15 Jan 2023 22:35
by stephen_usher
Just as I thought that I was getting somewhere the last of my microSD cards walked out. That's three which have died this weekend and they've not all been connected to the same devices and I've been careful not to touch the contacts.

That's rather brought me to a crashing halt on the project as I now have no storage for the disk images and the system can't work without one.

Well, I won't get one until Tuesday now it seems.

Re: General Stuff(tm)

Posted: 15 Jan 2023 23:13
by rubber_jonnie
stephen_usher wrote: 15 Jan 2023 22:35 Just as I thought that I was getting somewhere the last of my microSD cards walked out. That's three which have died this weekend and they've not all been connected to the same devices and I've been careful not to touch the contacts.

That's rather brought me to a crashing halt on the project as I now have no storage for the disk images and the system can't work without one.

Well, I won't get one until Tuesday now it seems.
All the same make? Bit rubbish for them all to go over the same weekend.

Re: General Stuff(tm)

Posted: 15 Jan 2023 23:18
by stephen_usher
rubber_jonnie wrote: 15 Jan 2023 23:13
stephen_usher wrote: 15 Jan 2023 22:35 Just as I thought that I was getting somewhere the last of my microSD cards walked out. That's three which have died this weekend and they've not all been connected to the same devices and I've been careful not to touch the contacts.

That's rather brought me to a crashing halt on the project as I now have no storage for the disk images and the system can't work without one.

Well, I won't get one until Tuesday now it seems.
All the same make? Bit rubbish for them all to go over the same weekend.
Yes, I think they're all from the same Raspberry Pi branded 8GB cards I bought about 4 years ago.

Re: General Stuff(tm)

Posted: 15 Jan 2023 23:23
by rubber_jonnie
stephen_usher wrote: 15 Jan 2023 23:18
rubber_jonnie wrote: 15 Jan 2023 23:13

All the same make? Bit rubbish for them all to go over the same weekend.
Yes, I think they're all from the same Raspberry Pi branded 8GB cards I bought about 4 years ago.
Thats rather peculiar, dodgy batch maybe? I think over all the years I've been using SD cards (All types) I've had just one die on me, and that was a microSD in an RPi. It died after a power cut, went read only on me.

These days I just back up regularly with Win32 Disk Imager, but for all 3 to die, that sucks :(

Re: General Stuff(tm)

Posted: 16 Jan 2023 17:39
by stephen_usher
As I've got the day off due to building works for my out building starting I popped down to Sainsbury's to get a microSD card from Argos.

Starting to make more progress.

The hosts is requesting disk reads now but I must have the signalling incorrect as the host never actually tries to read from the buffer. This is strange as I've followed the WD1010 data sheet to the letter using their flow chart.