[comp.sys.amiga] low level drive access

steelie@pro-charlotte.cts.com (Jim Howard) (11/21/88)

Everyone, please refrain from flaming me!  I know direct
hardware "hacks" tend to get frowned upon...
 
Im attempting to simply move the disk head 1 track toward
the center of the spindle.. Here's how Im doing it..
 
    bclr  #1,$bfd100
**  ^^specify direction
 
    bclr  #7,$bfd100          ;turn on the motor
    bclr  #0,$bfd100          ;first half of step pulse
    bset  #0,$bfd100          ;second half of step pulse
 
 
Now, why doesnt this do anything?  Im not exactly sure whether
I am supposed to set up all the bits, and turn on the disk DMA,
or what.. The hardware reference manual is VERY ambiguous. 
 
Remember, Im not trying to read data from the disk, Im just
trying to move the head.  I have to figure out how to move
the head before I can read data anyway..

Thanks


   UUCP:  ....!crash!pro-charlotte!steelie    | Pro-Charlotte - (704) 567-0029
   ARPA:  crash!pro-charlotte!steelie@nosc.mil| 300/1200/2400 baud  24 hrs/day
   INET:  steelie@pro-charlotte.cts.com       | Log in as "register"

ditto@cbmvax.UUCP (Michael "Ford" Ditto) (11/22/88)

In article <3593@crash.cts.com> steelie@pro-charlotte.cts.com (Jim Howard) writes:
>Everyone, please refrain from flaming me!  I know direct
>hardware "hacks" tend to get frowned upon...

Ok, flame withheld, but you'd better have a darn good reason...  :-)

>Im attempting to simply move the disk head 1 track toward
>the center of the spindle.. Here's how Im doing it..
> 
>    bclr  #1,$bfd100
>**  ^^specify direction
> 
>    bclr  #7,$bfd100          ;turn on the motor
>    bclr  #0,$bfd100          ;first half of step pulse
>    bset  #0,$bfd100          ;second half of step pulse

Did you select a drive?  Something like (pardon my C):
	ACIAB->prb |= 0x78;		/* Unselect all drives */
	ACIAB->prb &= ~0x80;		/* Turn on the motor (if desired) */
	ACIAB->prb &= (0x08<<drivenum);	/* Select the one we want */
	ACIAB->prb &= ~0x02;		/* Specify direction */
	ACIAB->prb &= ~0x01;		/* First half of step pulse */
	ACIAB->prb |= 0x01;		/* Second half of step pulse */

I think I have the order correct, but I'm sure someone will correct
me if I don't.

>Now, why doesnt this do anything?  Im not exactly sure whether
>I am supposed to set up all the bits, and turn on the disk DMA,

Ouch!  (DMA is for the actual transfer of bits to/from memory, and
you'd better tell it where to start reading and writing before you
activate DMA).
-- 
					-=] Ford [=-

"The number of Unix installations	(In Real Life:  Mike Ditto)
has grown to 10, with more expected."	ford@kenobi.cts.com
- The Unix Programmer's Manual,		...!sdcsvax!crash!elgar!ford
  2nd Edition, June, 1972.		ditto@cbmvax.commodore.com