Ich bin grade dabei mir den Yampp-Mp3 Player zu bauen (http://www.yampp.com

Mit nem CD-Laufwerk läuft der auch soweit, nur mit ner Festplatte macht er Probleme.

Zu aller erst schreib ich 0x06 ins Command-Register, warte dann 40ms und schreibe anschließend 0x00 hinein (so wie's in den ATA-3 Spezifikationen steht).
Wenn ich nun das Error-Register auslese erhalte ich immer 0x04, was bedeutet, das der Befehl ungültig ist oder ein anderer Fehler aufgetreten ist.

Code:
//----------------------------------------------------------------------------
// ATAPI Reset device
//----------------------------------------------------------------------------
void ATA_SW_Reset2(void)
{
u08 i=10;

	
	WriteBYTE(0x17, 0x04);	// ATAPI Soft Reset command
	delayms(40);
	WriteBYTE(0x17,0x02);
	delayms(500);
	while(CheckBusy() && i)
		i--;
		
}

//----------------------------------------------------------------------------
// Init ATA
//----------------------------------------------------------------------------

u08 set_drive(u08 drive)
{
  	WriteBYTE(CMD_A | CMD_DEV_HEAD, drive);	// Set Drive/Head register
	delayms(10);
	ATA_SW_Reset2();						// Reset drive



	DiskErr();
	/*
	if( ReadBYTE(CMD_A | CMD_SECT_CNT) == 1 && ReadBYTE(CMD_A | CMD_SECT_NUM) == 1 &&		// check ATAPI signature
	    ReadBYTE(CMD_A | CMD_CYL_LOW) == 0x14 && ReadBYTE(CMD_A | CMD_CYL_HIGH) == 0xEB )
			return(1);
	else
	{
		printf("\nWrong ATAPI Signature\nCMD_SECT_CNT: \t %x\nCMD_SECT_NUM: \t %x\nCMD_CYL_LOW: \t %x\nCMD_CYL_HIGH: \t %x\n",ReadBYTE(CMD_A | CMD_SECT_CNT),ReadBYTE(CMD_A | CMD_SECT_NUM),ReadBYTE(CMD_A | CMD_CYL_LOW),ReadBYTE(CMD_A | CMD_CYL_HIGH));
		return(0);
	}*/
	return 0;
			
}


u08 ATA_Init(void)
{
/*
	if( set_drive(DH_CHS0) )	// try Drive 0 (MASTER)
	{
		printf("\nMaster Drive\n");
		return(0);
	}
	*/
	if( set_drive(DH_CHS1) )	// try Drive 1 (SLAVE)
	{
		printf("\nSlave Drive\n");
		return(0);
	}
	return(1);
}
Und wie gesagt, wenn ich n CD-Laufwerk anschließ läuft das ohne Probleme (mit der Ausnahme, das ich beim Reset 0x06 auf 0x08 ändern muss).

Hatte irgendwer schon mal n ähnliches Problem oder weiß eine Lösung?


Achja die Platte ist eine Maxtor Diamond Max Plus 8 40GB formatiert mit FAT32 4kb-Cluster.
Läuft am PC ohne Probleme.