News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Accesing the FDC765

Started by pacomix, 20:06, 13 June 13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pacomix

Hi!


   As some of you know I have problems with the rotational speed of one of my 3" drives and I still do not have proper equipment to measure volts and so I started programming a tool that runs natively in the CPC in order measuring the RPMs of the disk drive.
  What I was planning to do is measuring the amounts of times the index hole is detected by the controller and then do a simple calculation after 300*X interruptions have happened.
  The thing is that after checking the existent documentation in the wiki about the FDC765 controller I couldn't find any reference to the index hole or how to detect it!
  Could some master of the FDC765 point me out on how can I do it or even if it is possible?
  Right at the moment I am turning the fdc on and off but I have no idea what I have to write/read in the FDC ports to detect the index hole.
  Hope you can help me.


Regards!


Paco

TotO

Hello,

I sent you a private message.
Cheers,

  TotO.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Bryce

Quote from: TotO on 20:17, 13 June 13
Hello,

I sent you a private message.
Cheers,

  TotO.

Why? Is it a secret how to do it? :D

Bryce.

TotO

"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

arnoldemu

You can't detect it directly.

To detect it you need to have a disc inserted and the motor needs to be on.

now, i'm not sure exactly how to detect it.

* the fdd may not ever say it's ready
* another time, is that some operations wait for the index pulse before doing some work: format
* another time, is that some operations may hang if there is no index pulse. e.g. try to read a sector that doesn't exist. fdc waits for 2 index pulses before declaring it not found, but if there are no index pulses it will probably hang.

These are the ways I can think of to indirectly detect the index pulse is being received by the fdc.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

I found another way to measure the rpm.

You need a specially formatted disc, made on another machine that is accurate.

Write 10 sectors (I think) with the correct gap so that 1 sector should come every 50th of a second. It's one of the basis of one form of musical loader ;)
The sectors should be size 512. Can't remember the gap size, I'll look it up.

Then when you read the sectors change the border colour so that the border shows the time for reading the sector's data.

Now, when you watch it on your monitor, assuming that's adjusted to 50Hz, the bar should stay almost stationary on the screen.

If it's under or over it'll move.

This was one of the tests I made when I programmed my musical loader, I was trying to determine how close to 300rpm the 3.5" and 3" drives are.

Generally 3.5" drives are much closer to 300rpm.
3" drives have quite a lot of deviation and some always run a bit slow and others always run a bit fast.
There is some tolerance in the PLL to allow this. Of course too much and you get read errors.

Did you try my other fdc tests?

Unofficial Amstrad WWW Resource

In the download section.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

TotO

OK... In fact, a program already exist and work fine, but it's currently in Beta testing.
So, don't waste time with that and wait some weeks.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

ralferoo

I'd suggest using the Read ID command, which reads the first DAM after the index hole (so obviously you'll need a formatted disk). It's the the index hole directly, but it should be constant.

Alternatively, you can do a sector read of a sector that is known not to exist. This aborts on the 2nd index pulse after the request, so one request on it's own will give you a random time between 1 and 2 rotations, but if you time from this command failing, repeat and time until the next one fails, that should be exactly 2 index holes later.

arnoldemu

Quote from: ralferoo on 13:59, 14 June 13
I'd suggest using the Read ID command, which reads the first DAM after the index hole (so obviously you'll need a formatted disk). It's the the index hole directly, but it should be constant.

Alternatively, you can do a sector read of a sector that is known not to exist. This aborts on the 2nd index pulse after the request, so one request on it's own will give you a random time between 1 and 2 rotations, but if you time from this command failing, repeat and time until the next one fails, that should be exactly 2 index holes later.
read id reads the next id, not the first one after the index hole.
but it will give an error if no ids are seen when it sees the index hole 2 times in a row.

true with the sector read.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

ralferoo

#9
Quoteread id reads the next id, not the first one after the index hole.
Nice, I'd missed that...

pacomix

QuoteDid you try my other fdc tests?

Unofficial Amstrad WWW Resource

In the download section.
Hi! Yep. I tried. But you can make the drive suffer a lot when seeking for a track higher than 42. Also... couldn't use the ESC key to go back hehehe.


Quote from: arnoldemu on 14:05, 14 June 13
read id reads the next id, not the first one after the index hole.
but it will give an error if no ids are seen when it sees the index hole 2 times in a row.

true with the sector read.
Thank you very much for that suggestions! I have it working reliably I think.


Thank you very much to everybody that helped! :)

Powered by SMFPacks Menu Editor Mod