AN2417 Freescale Semiconductor / Motorola, AN2417 Datasheet - Page 21

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
3.5.4 Identify Drive Command
The identify drive command will put information about the compact flash memory card into card buffer.
The host can get this information in the same way as read command:
1, Issue 0xEC command
When this command is accepted, the Compact Flash Memory Card set BSY, then sets DRQ, put the
information data in buffer and clear BSY, then wait for the host to read the information data from buffer.
DRQ will be clear when 512 bytes of data is read.
Example Program to issue identify drive command:
U8 tempU8;
U16 i, U16data[256];
//Issue identify drive command
*(P_U8) (CS5_BASE_ADDR+0x400007) = 0xEC; // issue EC command for Identify Drive
//Poll for busy bit
tempU8 = *(P_U8) (CS5_BASE_ADDR+0x400007);
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");
For information read back from identify drive command, Word Address 27-46 is the model number in
ASCII (Left Justified) Big Endian Byte Order in Word (32 bit). The following example code will print the
model on screen.
for (i=27; i<47; i++) { //Print the CF Model string from Drive Identify Data
}
The following model name is found on the testing Sandisk Compact Flash by identify drive command:
Sandisk SDCFB-32
The definition of the information get from identify drive command is listed in Sandisk Compact Flash
Memory Card Product Manual.
MOTOROLA
tempU8 = *(P_U8) (CS5_BASE_ADDR+0x400007);
U16data[i]=*(P_U16) (CS5_BASE_ADDR+0x400008);// read 2 byte of data from buffer
tempU8=*(P_U8) (CS5_BASE_ADDR+0x400007);// poll for DRQ (bit 3 of register)
printf("%c%c", U16data[i*2+1], U16data[i*2] );
printf("\n");
Freescale Semiconductor, Inc.
For More Information On This Product,
MC9328MX1/MXL Application Note
Engineering Draft / Preliminary
Go to: www.freescale.com
Programming Example
21

Related parts for AN2417