[comp.sys.atari.st] Floppy drive 1.44 meg woes!

WSCART01@ULKYVX.BITNET (02/03/90)

  I'm haveing a few problems hooking up my 1.44 meg teac. I was wondering
if anyone could check some things for me. My problem is that i cant access
the HD mode of the drive but the DD is ok. (My setup is a mega, useing the
teac as drive B and a simple manual switch for changing HZ.)

What i've done so far:
1)Moved jumper on teac, setup is now jumpers at D0,and OP.
2)Took line 19, CLK, off the WD 1772 and the 8hz from the same.
3)Took line 39 off the shifter (right 40 pin chip?) for the 16hz.
4)Put a manual swith so that CLK and be choosen as 8 or 16hz.
Thats it....

Symptoms: Drive will not work in HD mode but will in DD mode.
          When formating, -8, or -6 is returned. (sector not found/ or
          seek error)

I'm lost as to what to do now. Every thing seems to check out. Since
some are using the same TEAC drive, i was wondering if anyone could double
check my settings.


Any help would be apreciated.


PS: Bitnet sometimes goes out at my location. If posting a message, please
    send a duplicate copy to my mail box.



Stuart Carter
University Of Louisville
Physics Dept

clf3678@ultb.isc.rit.edu (C.L. Freemesser) (02/05/90)

>
>  I'm haveing a few problems hooking up my 1.44 meg teac. I was wondering

[Stuff deleted]

 From what I know, you can't use HD on the ST.  The controller chip
can't handle it.  Just be glad it works in 720k mode.  :^)



Chris Freemesser, Rochester Institute of Technology :BITNET:%clf3678@RITVAX
    |||        ____________                         :GEnie: C.FREEMESSER
    |||       /___    /          (and 8-bit too!)   :USENET: clf3678@rit.isc
   / | \   ______/   /                              :        .edu
Call the A.C.O.R.N BBS (716)436-3078, 300/1200 baud :<-or my BBS

swimmer@fbihh.UUCP (Morton Swimmer) (02/05/90)

WSCART01@ULKYVX.BITNET writes:



>What i've done so far:
>1)Moved jumper on teac, setup is now jumpers at D0,and OP.
>2)Took line 19, CLK, off the WD 1772 and the 8hz from the same.
Are you sure it was the line 19? That is the read data line, I
think you want the line 18!

In a German computer magazine, "ST Computer" Jan 1990, there is a full
plan for building such an automatic interface.

Cheers, Ralf (using Morton Swimmer's account)

hase@hase_1.UUCP (Hartmut Semken) (02/11/90)

clf3678@ultb.isc.rit.edu (C.L. Freemesser) writes:

>>  I'm haveing a few problems hooking up my 1.44 meg teac. I was wondering
> From what I know, you can't use HD on the ST.  The controller chip
>can't handle it.  Just be glad it works in 720k mode.  :^)

Well, you can, if you hack the hardware.

Here we go again:

The trick is to double the clock frequency of the controller chip, so it
will talk twice as fast to the drive: the bit stream has "high-density"
format.
A clock of 16 MHz is well behind specification (the WD1772 is rated to
run at up to 10 MHz), but it will work most of the time.

The hack consists of two parts: hardware and software and works with
high density drives only!
Now: the hardware.

The clock pin of the WD1772 is pin 18. It is normally hooked to the 8
MHz clock.
Cut this pin and connect it to the output of a simple circurit. feed the
two inputs of this simple circurit with 8 MHz and 16 MHz clocks (16 MHz
can be get at SHIFTER pin 39).
The "simple circurit" mentioned above could be a simple, manual switch.
Now You are able to select two clock frequencies and therfore two
"modes" for the controller chip: double density and high density.

The simple circurit could also be a multiplexer (74LS157, I think)
controlled by the "I detected a HD-disk in me"-output of the floppy
drive (the TEAC FD 235 HFN provides this outout on pin 2 if a jumper is
set; the 235 HFN has a second jumper that enables internal detection of
HD disks: this must be set, too).
With the MUX, a disk inserted will select the appropriate mode of
operation automatically.

Do not worry about two drives in different modes: when copying from one
drive to the other, the clock rate will be switched once to twice a
second. This will not trouble the controller (remember the clock to be
in the range of Megahertz...).
If you want to connect one HD drive and one DD drive, you'll need two
more TTL gates (one 74LS00 will do) to make sure, the controller is in
DD mode for the DD only drive: invert the HD-detected-output (it is LOW
for DD before, HIGH for DD behind the inverter) and feed it into a NAND
together with drive select for the DD drive. Let a HIGH output of the
NAND select DD-clock (8 MHz). Now "not-HD-detected OR DD-drive-select"
will select DD mode, right?

With two HD drives, there is no problem at all :-)

Now for the software:

The controller uses its clock as base for all timings.
The pulse width and time between pulses for the step line are controller
controlled.
To make it short: with the doubled clock the controller will try to make
the head step twice as fast: he will send a step pulse every 1.5
milliseconds if set to 3 milliseconds (which is TOS standard).
Just set the step rate to 6 milliseconds to make the controller step 3
milliseconds in HD mode (well, the 6 milliseconds steps in DD mode will
slow down floppy operation a bit, but not that much. Not stepping,
reading and writing takes the time!).

How to set the step rate?
Well, there is a documented TOS variable for the step rate at 0x440
called seekrate.
The step rate in this variable will be used by the BIOS after a call of
the routine, pointed to by "hdv_init" (the hdv_init routine seems to
initialize the BIOS parameter blocks for the floppies). The pointer to
hdv_init can be found at 0x46A (this is a supported TOS variable, too).
Look at the MWC-Assembler source below.

The second thing is to get a formatter that will format 18 sectors per
track. HYPERFORMAT by Claus Brodt is such a thing, but a simple
formatter hacked from the example in the Mark Williams C Lexicon did the
same. It's included below.


For help try to write to hase@hase_1.mbx.sub.org, but it'll probably
bounce; our mail service is fading fast...
I'll try to reply to anything, I finally get.

hase

------- cut for seek6.s -----------
/	module name seek6

	.shri

	.globl main_
main_:
	clr.l	-(sp)
	move.w	$0x20,-(sp)
	trap	$1
	addq.l	$6,a7
	move.l	d0,_save_ssp
	move.w	$0,0x440	/ 0 => 6 ms
	lea	0x46a,a0
	move.l	(a0),d0
	movea.l	d0,a0
	jsr	(a0)
	move.l	_save_ssp,-(sp)
	move.w	$0x20,-(sp)
	trap	$1
	addq.l	$6,a7
	.even
_save_ssp:
	.blkl	1
/ seek rate codes are 0,1,2,3 for 6,12,2,3 milliseconds

------------ cut for formath.c -------------

/* formath.c Formatter fuer High Density Disketten */
/* nur fuer angepasste Hardware! Floppycontroller und Laufwerk */
/* muessen High-Density tauglich sein! */
/* Hartmut Semken, Lupsteiner Weg 67 1000 Berlin 37 */
/* hase@hase_1.mbx.sub.org or hase@netmbx.mbx.sub.org */
/* 03-SEP-89 */
#include <stdio.h>
#include <osbind.h>
#include <time.h>

#define SLEEPTIME 1	/* 1: Zeitschleife, 0: Taste */
#define BLANK (0xE5E5)
#define MAGIC (0x87654321L)
#define BUFSIZE (20*1024) /* Platz fuer mehr als 18 Sektoren... */

#define DEVICE 0	/* 0 = Floppy A, 1 = Floppy B	*/
#define SIDES 2		/* je  				*/
#define SECTORS 18	/* nach				*/
#define TRACKS 80	/*Belieben			*/

#define TOTSEC (TRACKS * SIDES * SECTORS)

extern int errno;

main(){
	int track;
	int side;
	int status;
	short *bf;
	register char reply;
	short *middle;
	char buffer[512];
		
	printf("\033E\n");
	printf("Public Domain High Density Mini Formatter\n");
	printf("von H. Semken\nDer Autor garantiert in keiner Weise fr die Funktion\nDieses Programmes.\nBenutzung auf eigene Gefahr.\n");
	printf("\n\n\n");
	printf("\007\033pFormatiere Diskette in Drive %c\033q\n%d Seiten\n%d Sektoren pro Spur\n%d Spuren\n\n", (65+DEVICE), SIDES, SECTORS, TRACKS);
	printf("Wirklich formatieren? ");
	fflush(stdout);
	if ((reply = Crawcin()) != 'y' && reply != 'Y' && reply != 'j' && reply != 'J') {
		printf("Nein. Floppy nicht formatiert.\n");
		sleep(1);
		Pterm0();
	}
	printf("Ja.\n");
	printf("Diskette einlegen; Taste drcken...");
	fflush(stdout);
	Crawcin();
	printf("\n");
	bf = malloc(BUFSIZE);
	for (track = TRACKS-1; track >= 0; track--) {
		for (side = 0; side < SIDES; side++) {
			printf("Formatiere Spur %d, Seite %d", track, side);
			fflush(stdout);
			status = Flopfmt(bf, 0L, DEVICE, SECTORS, track, side, 1, MAGIC, BLANK);
			if (status) {
				middle = bf;
				printf("\t%d\n", status);
				while (*middle) {
					printf("\tDefekter Sektor %d\n", *middle++);
				}
			} else {
				printf("\tokay\r");
			}
		}
	}
	printf("\n\nAlle Spuren formatiert\n");
	printf("Initialisiere Directory\n");
	for (track = 0; track < (BUFSIZE>>1); bf[track++] = 0);
	for (track = 0; track < 2;track++) {
		for (side = 0; side < SIDES; side++){
		if (status = Flopwr(bf, 0L, DEVICE, 1, track, side, SECTORS)) {
			errno = -status;
			perror("Write Error");
		}
		}
	}
	Protobt(buffer, (long)Random(),3,0); /* Prototyp Bootsector fr 
	                                      * 80 * 2 * 9 Sektoren */
	/* Prototyp Bootsektor fr das neue Format anpassen */
	/* Bytes 19 und 20 enthalten die Sektoren pro Disk */

	/* unteres Byte von TOTSEC */
	buffer[19] = (char)(((TOTSEC>>8)<<8)^TOTSEC);
	/* oberes Byte von TOTSEC; es lebe das Intel int-Format */
	buffer[20] = (char)(TOTSEC>>8);
	buffer[24] = (char)SECTORS; /* Sektoren pro Spur */
	status = Flopwr(buffer, 0L, DEVICE, 1, 0, 0, 1);
	if (status) {
		errno = -status;
		perror("Write Error (Bootsector)");
	}
	status = Flopver(buffer, 0L, DEVICE, 1, 0, 0, 1);
	if (status) {
		errno = -status;
		perror("Verify Error (Bootsector)");
	}
	printf("Diskette in Laufwerk %c formatiert\n", (65+DEVICE));
	sleep(1);
	Pterm0();
}

sleep(seconds)
int seconds;
#if SLEEPTIME
{
	clock_t t;
	for(t = clock();clock() < (t + CLK_TCK*seconds););
}
#else
{
	printf("Taste druecken\n");
	fflush(stdout);
	Crawcin();
}
#endif
-- 
Hartmut Semken, Lupsteiner Weg 67, 1000 Berlin 37 hase@hase_1.UUCP
Dennis had stepped up into the top seat whet its founder had died of a
lethal overdose of brick wall, taken while under the influence of a
Ferrari and a bottle of tequila. (Douglas Adams; the long dark teatime...)

pegram@uvm-gen.UUCP (pegram r) (02/15/90)

From article <2103@ultb.isc.rit.edu>, by clf3678@ultb.isc.rit.edu (C.L. Freemesser):

>>  I'm haveing a few problems hooking up my 1.44 meg teac. I was wondering

>  From what I know, you can't use HD on the ST.  The controller chip
> can't handle it.  Just be glad it works in 720k mode.  :^)
> 
> Chris Freemesser, Rochester Institute of Technology :BITNET:%clf3678@RITVAX
>     |||        ____________                         :GEnie: C.FREEMESSER
>     |||       /___    /          (and 8-bit too!)   :USENET: clf3678@rit.isc
>    / | \   ______/   /                              :        .edu
> Call the A.C.O.R.N BBS (716)436-3078, 300/1200 baud :<-or my BBS

Not True, details of the modifications necessary were posted in this
group by the designer (I believe) in December 1989.

If I get enough requests (say 10 or more) I will repost the pertinent
bits (edited that is, to save BW, is that ok Hase?) Email requests (on
internet) to pegram@griffin.uvm-gen.uvm.edu

I make no guarantees, as I haven't had the time to do the mod myself
yet, but it does make sense.  The basic idea is to double the clock to
the 1772, then set your seek rate to "6msec" (= 3msec for a 16Mhz clock).
There are 1 or 2 gotchas that can come up (hey, it happens with 720K
drives too!) and you are clocking the WD1772 beyond its design limit
(10Mhz limit, 16Mhz actual).

Bob Pegram  (pegram@griffin.uvm.edu) Univ. of Vt., Burlington, Vt., U.S.A.

U.S. snail:
R.F.D. 2, Box 2843, Vergennes, Vt, O5491, U.S.A.