AN2417 Freescale Semiconductor / Motorola, AN2417 Datasheet - Page 18

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
3.5 Memory Mode Test Program
3.5.1 Read Card Information Structure
Card Information Structure (CIS) contains the information of the Compact Flash device. It is located in
even address of attribute memory address 000H - 168H. In address range 034H to 05AH the manufacturer
string is stored. The following program code will read the CIS, store it in a variable array and print the
manufacturer string to screen.
U8 CISdata[180];
for (i=0;i<180;i++){ //copy CIS to CISdata[]
}
printf("Manufacturer Information Stored in CIS :\n");
for (i=26; i<46 ; i++) {
}
The following string will be printed to screen.
SunDisk
SDP
5/3 0.6
Other data of CIS in the variable array can be compared with the information on SanDisk Compact Flash
Memory Card Product Manual to verify the CIS is read successfully.
3.5.2 Write to Memory Block
Compact Flash memory are NAND flash memory that need ATA Command to perform read write
operation. Block access is required for read write access to Compact Flash memory card. The memory
space used should be common memory space. The capacity of each block is 512 bytes. To write a 512
bytes of data to a block of memory, The following sequence is required.
When this command is accepted, the Compact Flash Memory Card set BSY, then sets DRQ and clear
BSY, then wait for the host to fill the sector buffer with the data to be written. DRQ will be clear when 512
bytes of data is written.
18
1. Write the number of block of data to be access to the sector count register
2. Write the LBA Address to the card
3. Issue 30H command
CISdata[i]=*(P_U8) (CS5_BASE_ADDR+i*2);// CIS can be access in even address only
if (CISdata[i]!='\0')
printf("%c", CISdata[i]);
else printf("\n");
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