Micrium

µC/FS Compact Flash & True IDE device driver

Supported hardware

µC/FS’s CompactFlash & IDE device driver can be used to access most ATA HD drives or CompactFlash storage cards also known as CF using true IDE or Memory card mode.

Theory of operation

CompactFlash

CompactFlash is a small, removable mass storage device. The CompactFlash Storage Card contains a single chip controller and flash memory module(s) in a matchbook-sized package with a 50-pin connector consisting of two rows of 25 female contacts each on 50 mil (1.27 mm) centers. The controller interfaces with a host system allowing data to be written to and read from the flash memory module(s).

There are two different Compact Flash Types, namely CF Type I and CF Type II. The only difference between CF Type I and CF Type II cards is the card thickness. CF Type I is 3.3 mm thick and CF Type II cards are 5mm thick. A CF Type I card will operate in a CF Type I or CF Type II slot. A CF Type II card will only fit in a CF Type II slot. The electrical interfaces are identical. CompactFlash is available in both CF Type I and CF Type II cards, though predominantly in CF Type I cards. The Microdrive is a CF Type II card. Most CF I/O cards are CF Type I, but there are some CF Type II I/O cards.

CompactFlash cards are designed with flash technology, a nonvolatile storage solution that does not require a battery to retain data indefinitely.

The CompactFlash card specification version 2.0 supports data rates up to 16MB/sec and capacities up to 137GB.
CF cards consume only five percent of the power required by small disk drives.

CompactFlash cards support both 3.3V and 5V operation and can be interchanged between 3.3V and 5V systems. This means that any CF card can operate at either voltage. Other small form factor flash cards may be available to operate at 3.3V or 5V, but any single card can operate at only one of the voltages.

CF+ data storage cards are also available using magnetic disk (IBM Microdrive).

Modes of operation (interface modes)
Compact Flash cards can operate in three modes:

  • Memory card mode
  • I/O Card mode
  • True IDE mode

Supported modes of operation (interface modes)
Currently, TRUE IDE and MEMORY CARD mode are supported.

Fail-safe operation

Unexpected Reset
The data will be preserved.

Power failure
Power failure can be critical: If the card does not have sufficient time to complete a write operation, data may be lost. Countermeasures: make sure the power supply for the card drops slowly.

Wear leveling

CompactFlash card are controlled by an internal controller, this controller also handles wear leveling. Therefore, the driver does not need to handle wear leveling.

True IDE mode


Pin functions:

Signal Name Dir Pin Description
A2 - A0 I 18,19,20 Only A[2:0] are used to select one of eight registers in the Task File, the remaining address lines should be grounded by the host.

-PDIAG

I/O

46

This input / output is the Pass Diagnostic signal in the Master / Slave handshake protocol.

-DASP

I/O

45

This input/output is the Disk Active/Slave Present signal in the Master/Slave handshake protocol.

-CD1, -CD2

O

26,25

These Card Detect pins are connected to ground on the CompactFlash Storage Card or CF+ Card. They are used by the host to determine that the CompactFlash Storage Card or CF+ Card is fully inserted into its socket.

-CS0, -CS1

I

7,32

CS0 is the chip select for the task file registers while CS1 is used to select the Alternate Status Register and the Device Control Register.

-CSEL

I

39

This internally pulled up signal is used to configure this device as a Master or a Slave when configured in True IDE Mode. When this pin is grounded, the device is configured as a Master. When the pin is open, the device is configured as a Slave.

D15 – D00

I/O

27 – 31 47 – 49, 2 - 6,

21- 23

All Task File operations occur in byte mode on the low order bus D00-D07 while all data transfers are 16 bit using D00-D15.

GND

--

1,5

Ground.

-IORD

I

34

This is an I/O Read strobe generated by the host. This signal gates I/O data onto the bus from the CompactFlash Storage Card or CF+ Card when the card is configured to use the I/O interface.

-IOWR

I

35

I/O Write strobe pulse is used to clock I/O data on the Card Data bus into the CompactFlash Storage Card or CF+ Card controller registers when the CompactFlash Storage Card or CF+ Card is configured to use the I/O interface. The clocking will occur on negative to positive edge of the signal (trailing edge).

-OE (ATA SEL)

I

9

To enable True IDE Mode this input should be grounded by the host.

-INTRQ

O

37

Signal is the active high interrupt request to the host.

-REG

I

44

This input signal is not used and should be connected to VCC by the host.

-RESET

I

41

This input pin is the active low hardware reset from the host.

VCC

--

13,38

+5 V, +3.3 V power.

-VS1 -VS2

O

33,4

Voltage Sense Signals. -VS1 is grounded so that the CompactFlash Storage Card or CF+ Card CIS can be read at 3.3 volts and -VS2 is reserved by PCMCIA for a secondary voltage.

IORDY

O

42

This output signal may be used as IORDY.

-WE

I

36

This input signal is not used and should be connected to VCC by the host.

-IOIS16 O 24 This output signal is asserted low when the device is expecting a word data transfer cycle.

Sample block diagramn

Memory CARD mode


Pin functions:

Signal Name Dir Pin Description
A10 - A0 I 8,10,11,12,14,15,16,17,18,19,20 These address lines along with the -REG signal are used to select the following: the I/O port address registers within the CompactFlash Storage Card or CF+ Card, the memory mapped port address registers within the CompactFlash Storage Card or CF+ Card, a byte in the card's information structure and its configuration control and status registers.

BVD1

I/O

46

This signal is asserted high, as BVD1 is not supported.

BVD2

I/O

45

This signal is asserted high, as BVD2 is not supported.

-CD1, -CD2

O

26,25

These Card Detect pins are connected to ground on the CompactFlash Storage Card or CF+ Card. They are used by the host to determine that the CompactFlash Storage Card or CF+ Card is fully inserted into its socket.

-CE1, -CE2

I

7,32

These input signals are used both to select the card and to indicate to the card whether a byte or a word operation is being performed. -CE2 always accesses the odd byte of the word. We recommend connecting these pins together.

-CSEL

I

39

This signal is not used for this mode, but should be grounded by the host.

D15 – D00

I/O

27 – 31 47 – 49, 2 - 6, 21- 23

These lines carry the Data, Commands and Status information between the host and the controller. D00 is the LSB of the Even Byte of the Word. D08 is the LSB of the Odd Byte of the Word.

GND

--

1,5

Ground.

-INPACK

O

43

This signal is not used in this mode.

-IORD

I

34

This signal is not used in this mode.

-IOWR

I

35

This signal is not used in this mode.

-OE (ATA SEL)

I

9

This is an Output Enable strobe generated by the host interface. It is used to read data from the CompactFlash Storage Card or CF+ Card in Memory Mode and to read the CIS and configuration registers.

-READY

O

37

In Memory Mode, this signal is set high when the CompactFlash Storage Card or CF+ Card is ready to accept a new data transfer operation and is held low when the card is busy. At power up and at Reset, the READY signal is held low (busy) until the CompactFlash Storage Card or CF+ Card has completed its power up or reset function. No access of any type should be made to the CompactFlash Storage Card or CF+ Card during this time.

Note, however, that when a card is powered up and used with +RESET continuously disconnected or asserted, the reset function of this pin is disabled and consequently the continuous assertion of +RESET will not cause the READY signal to remain continuously in the busy state.

-REG

I

44

This signal is used during Memory Cycles to distinguish between Common Memory and Register (Attribute) Memory accesses. High for Common Memory, Low for Attribute Memory. To use it with µC/FS , this signal should be high.

-RESET

I

41

When the pin is high, this signal Resets the CompactFlash Storage Card or CF+ Card. The CompactFlash Storage Card or CF+ Card is reset only at power up if this pin is left high or open from power-up.

VCC

--

13,38

+5 V, +3.3 V power.

-VS1 -VS2

O

33,4

Voltage Sense Signals. -VS1 is grounded so that the CompactFlash Storage Card or CF+ Card CIS can be read at 3.3 volts and -VS2 is reserved by PCMCIA for a secondary voltage.

-WAIT

O

42

The -WAIT signal is driven low by the CompactFlash Storage Card or CF+ Card to signal the host to delay completion of a memory or I/O cycle that is in progress.

-WE

I

36

This is a signal driven by the host and used for strobing memory write data to the registers of the CompactFlash Storage Card or CF+ Card when the card is configured in the memory interface mode.

-WP

O

24

The CompactFlash Storage Card or CF+ Card does not have a write protect switch. This signal is held low after the completion of the reset initialization sequence.

Sample block diagramn

IDE (ATA) Drives

Just like Compact Flash cards, ATA drives have a built-in controller to drive and control the mechanical hardware in a drive. Actually there are two types of connecting ATA drives. 5.25 and 3.5 inch drives are using a 40 pin male interface to connect to an IDE controller. 2.5 and 1.8 inch drives, mostly used in Notebooks and embedded systems, have a 50 pin male interface.

ATA drives can operate in a variety of different modes:

  • PIO (Programmed I/O)
  • Multiword DMA
  • Ultra DMA
Currently, only PIO mode through TRUE IDE is supported.

True IDE mode

Pin functions:

Please refer to Compact Flash pin functions for information.

Hardware Interfaces