AN2417 Freescale Semiconductor / Motorola, AN2417 Datasheet - Page 24

no-image

AN2417

Manufacturer Part Number
AN2417
Description
PCMCIA and Compact Flash Interface for the MC9328MX1 and MC9328MXL Application Processors Application Note
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Programming Example
}
printf("Finish Reading\n");
3.6.4 Identify Drive Command
The procedure for issuing identify drive command in I/O mode is the same as in memory mode. The only
different is that correct address space should be used.
Example Program to issue identify drive command:
U8 tempU8;
U16 i, U16data[256];
//Issue identify drive command
*(P_U8) (CS5_BASE_ADDR+0x800007) = 0xEC; // issue EC command for Identify Drive
//Poll for busy bit
tempU8 = *(P_U8) (CS5_BASE_ADDR+0x800007);
while ( tempU8&0x80) { //poll for busy bit (bit 7 of register), quit loop when busy bit =0
}
//Read data from buffer into U16data[] until DRQ is clear
for (i=0;(tempU8&0x08)==0x08;i++) {
}
printf("Finish Reading\n");
24
U16data[i]=*(P_U16) (CS5_BASE_ADDR+0x800008);// read 2 byte of data from buffer
tempU8=*(P_U8) (CS5_BASE_ADDR+0x800007);// poll for DRQ (bit 3 of register)
tempU8 = *(P_U8) (CS5_BASE_ADDR+0x800007);
U16data[i]=*(P_U16) (CS5_BASE_ADDR+0x800008);// read 2 byte of data from buffer
tempU8=*(P_U8) (CS5_BASE_ADDR+0x800007);// poll for DRQ (bit 3 of register)
Freescale Semiconductor, Inc.
For More Information On This Product,
MC9328MX1/MXL Application Note
Engineering Draft / Preliminary
Go to: www.freescale.com
MOTOROLA

Related parts for AN2417