lf@lri.lri.fr (Lionel Fournigault) (02/18/88)
I tried to use the write-sector command of the FDC 1772 on atari 1040
without the DMA and I have had some problems: After the write_sector command
has been issued, the status register always contains 0xff and so the data
request condition cannot tested.
My question is : Is it possible to put the DMA in transparent mode
during a write operation.
Please answered by E-mail. Many thanx.
Lionel Fournigault
Laboratoire de recherche en informatique
Universite Paris Sud. Orsay
France
lf@sun8.lri.fr
lf@lri.uucp
...
c_function ()
{
write_fdc_track_register ( no_track ); /* No problem */
write_fdc_sector_register ( no_sect ); /* No problem */
asm {
MOVEM.L A0-A1/D1-D7,-(A7)
LEA.L 00ff8606,A0 /* DMA */
LEA.L 00ff8604,A1 /* FDC access */
MOVE.W #0x0a,D4 /* Write-sector command */
MOVE.W #0x80,D5 /* Status Register */
MOVE.W #0x180,D6 /* Command Register */
MOVE.W #0x186,D2 /* Data Register (write)*/
MOVE.W #0xd0,D3 /* Force command */
MOVE.W #25,D7 /* Copy 25 bytes */
MOVE.W D6,(A0) /* Command access */
MOVE.W D4,(A1) /* Write-sector running */
cnt: SUBI #1,D7
/* Problem begin here */
r_st: MOVE.W D5,(A0) /* Status Register access */
MOVE.W (A1),D1 /* read 0xffff ???? */
BTST #1,D1 /* Data Request ? */
BNE.S r_st
MOVE.W D2,(A0) /* Data Register access */
MOVE.W #0xaa,(A1) /* Copy 0xaa */
CMP.W #0,D7
BNE.S cnt
MOVE.W D6,(A0) /* Command access */
MOVE.W D3,(A1) /* Stop command */
MOVEM.L +(A7),A0-A1/D1-D7
}
}