IDE & CompactFlash card device driver

The emFile IDE and CompactFlash device driver can be used to access data stored to IDE hard disk drives and CompactFlash (CF) memory cards.

Supported Devices: The IDE and CompactFlash device driver supports most ATA compatible hard disk drives and CompactFlash (CF) memory cards. The access to the storage device is performed using using true IDE or memory card mode.


How embedded devices work

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).

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 16 MB/second and capacities up to 137 GBytes. 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)

Supported modes of operation (interface modes)

Compact Flash cards can operate in three modes:

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

Currently, TRUE IDE and MEMORY CARD mode are supported.

IDE (ATA) drives

Just like CompactFlash 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.

Modes of operation (interface modes)

Supported modes of operation (interface modes)

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.

Fail-safe operation

Unexpected reset

Power failure

The data will be preserved.

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.

Sample usage – IDE/CF device driver

The following sample shows how to configure an instance of the IDE/CF device driver. To add the driver, FS_AddDevice() is called with the driver type set to FS_IDE_Driver.

IDE CF Device Driver Sample Usage