AN2417 Freescale Semiconductor / Motorola, AN2417 Datasheet
AN2417
Related parts for AN2417
AN2417 Summary of contents
Page 1
... Freescale Semiconductor, Inc. Application Note AN2417/D Rev. 0, 04/2003 MC9328MX1/MXL PCMCIA and Compact Flash Interface By Angus Lai 1 Introduction 1 Introduction . . . . . . . . . . 1 This document describes the implementation of PCMCIA / Compact Flash interface on 2 Compact Flash Timing Characteristics MC9328MX1 Application Development System (ADS). PCMCIA / Compact Flash interface 3 Programming is connected to Chip Select 5 of External Interface Module (EIM) ...
Page 2
Freescale Semiconductor, Inc. Introduction 1.2 Compact Flash Overview Compact Flash is a PCMCIA compatible small removable 16 bit storage device introduced in 1994 by SanDisk Corporation. Compact Flash cards are designed with flash technology, a non-volatile storage solution that does ...
Page 3
Freescale Semiconductor, Inc. 1.4 Compact Flash Interface Block Diagram Motorola DragonBall MX GPIO PA20 A[10:0] A22 CS[5] RW D[15:0] GPIO PA18 GPIO PB17 DTACK EB3 EB2 A23 OE GND This diagram only show the logic level block diagram. Timing consideration ...
Page 4
Freescale Semiconductor, Inc. Introduction 1.5 PCMCIA Interface Block Diagram Motorola DragonBall MX GPIO PA20 A[21:0] GPIO PB19 GPIO PA19 GPIO PB16 GPIO PB14 A22 CS[5] RW D[15:0] GPIO PA18 GPIO PB17 DTACK EB3 EB2 A23 OE GND This diagram only ...
Page 5
Freescale Semiconductor, Inc. 1.6 Signal Description (Compact Flash) 1.6.1 Power Signal The voltage supply circuit is implemented by a PMOS FET transistor. VS1# is connected to the gate of the PMOS FET with pull up resistor. If the Card support ...
Page 6
Freescale Semiconductor, Inc. Introduction 1.6.4 Control Signal OE# WE# IORD# IOWR# Output Enable signal OE# is generated by host to indicate the access cycle is a read cycle, and this signal is used in memory mode. In I/O mode, separate ...
Page 7
Freescale Semiconductor, Inc. The duration of the access cycle is controlled by either the wait signal or the setting of programmable wait state. If wait signal is used to control the access cycle length, DTACK should be enabled and select ...
Page 8
Freescale Semiconductor, Inc. Compact Flash Timing Characteristics Total Number Signal Name of Pin CD1#, CD2# 2 1.6.6 Signals Not Implemented BVD1 BVD2 These signals are used as battery detect in PCMCIA in memory mode, and are not necessary and supported ...
Page 9
Freescale Semiconductor, Inc. 1 Address CE# OE# WAIT# Timing Item Symbol Item 1 Address tsu(A) Setup Time 2 Address Hold th(A) Time 3 CE Setup tsu(CE) before Hold th(CE) following OE 5 IORD Width tw(IORD) Time 6 ...
Page 10
Freescale Semiconductor, Inc. Compact Flash Timing Characteristics Address CE# WE# WAIT# Timing Item Symbol Item 1 Address Setup tsu(A) Time 2 Address Hold th(A) Time 3 CE Setup tsu(CE) before Hold th(CE) following WE 5 IOWR Width ...
Page 11
Freescale Semiconductor, Inc. MX1 Signal MC74HC14 EB3 S S CS5 S MC74HC00 MC74HC14 MC74HC14 EB2 S S CS5 S MC74HC00 MC74HC14 CS5 D [15:0] A23 RW OE delay 1 path delay 2 path delay 3 path short delay logic gate ...
Page 12
Freescale Semiconductor, Inc. Compact Flash Timing Characteristics 2.4 Glue Logic Output Timing Diagram - Read Cycle signal input to/output from DragonBall MX Processor signal input to/output from CF after glue logic Address CS5 EB programmable min 0ns OE max 35ns ...
Page 13
Freescale Semiconductor, Inc. Setup / hold time requirement Address setup time delay 1+2+3 + OE/EB programmable setup time (by OEA bit in CS5L) - address buffer delay 2.5 Glue Logic Output Timing Diagram - Write Cycle signal input to/output from ...
Page 14
Freescale Semiconductor, Inc. Programming Example Setup / hold time requirement CE setup before WE CE hold following WE Address setup time 3 Programming Example Compact Flash Memory Card use ATA command to perform the read write operation on memory block. ...
Page 15
Freescale Semiconductor, Inc. Address 0x 00 0XXX 0x 40 0XXX 0x 80 0XXX The lower 11 bit address is the address of the compact flash address bus. 3.2 EIM Configuration Chip Select 5 of External Interface Module will be connected ...
Page 16
Freescale Semiconductor, Inc. Programming Example If i < 16, set bits [2*i +1] and [2*i] of Output Configuration Register1 (OCR1) as b11 If i >=16, set bits [2*i-32 +1] and [2*i-32] of Output Configuration Register2 (OCR2) as b11 The procedures ...
Page 17
Freescale Semiconductor, Inc. After card insertion, a reset pulse should be sent to the card. with a minimum duration of 10us. delay(1500); //delay 1ms after Card Inserted *(P_U32) PTB_DR |= 0x1<<17; // Set Reset Pin High delay(15); ...
Page 18
Freescale Semiconductor, Inc. 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 located in even address of attribute memory address 000H - 168H. ...
Page 19
Freescale Semiconductor, Inc. Example Program to write 512 byte of data to a memory block at LBA Address 0x0000001 U8 tempU8; U16 i; //***Set sector count*** *(P_U8) (CS5_BASE_ADDR+0x400002) = 0x1;//sector count =1 //***Set the LBA address of memory block to ...
Page 20
Freescale Semiconductor, Inc. Programming Example *(P_U8) (CS5_BASE_ADDR+0x400002) = 0x1;//sector count =1 //Set the LBA address of memory block to be read *(P_U8) (CS5_BASE_ADDR+0x400003) = 0x1; //LBA [7:0] =1 *(P_U8) (CS5_BASE_ADDR+0x400004) = 0x0; //LBA [15:8] =0 *(P_U8) (CS5_BASE_ADDR+0x400005) = 0x0; //LBA ...
Page 21
Freescale Semiconductor, Inc. 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 ...
Page 22
Freescale Semiconductor, Inc. Programming Example 3.6 I/O Mode Test Program 3.6.1 Configure the Card to Work in I/O Mode Compact Flash memory card can be configure as I/O mode in the configuration option register.The configuration option register ...
Page 23
Freescale Semiconductor, Inc. for (i=0;(tempU8&0x08)==0x08;i++) { *(P_U16) (CS5_BASE_ADDR+0x800008)=(0xAA00+i);// write 2 byte of data to data buffer tempU8=*(P_U8) (CS5_BASE_ADDR+0x800007);// poll for DRQ (bit 3 of register) } printf("Finish Writing\n"); 3.6.3 Read from Memory Block The procedure for reading a block of ...
Page 24
Freescale Semiconductor, Inc. Programming Example 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) } printf("Finish Reading\n"); 3.6.4 Identify Drive Command The procedure for issuing identify drive command in I/O mode ...
Page 25
Freescale Semiconductor, Inc. MOTOROLA MC9328MX1/MXL Application Note For More Information On This Product, NOTES Engineering Draft / Preliminary Go to: www.freescale.com 25 ...
Page 26
... ARM and the ARM POWERED logo are the registered trademarks of ARM Limited. ARM Developer Suite is the trademarks of ARM Limited. Motorola, Inc Equal Opportunity/Affirmative Action Employer. © Motorola, Inc. 2003 AN2417/D Engineering Draft / Preliminary For More Information On This Product, Go to: www.freescale.com ...