Compact Flash Card Pinout

Shown looking into card

Function       Function
Mem I/O True IDE
Mode 4
  Pin   Mem I/O True IDE
Mode 4
GND --- 1 26 --> !CD1
D03 <-> 2 27 <-> D11
D04 <-> 3 28 <-> D12
D05 <-> 4 29 <-> D13
D06 <-> 5 30 <-> D14
D07 <-> 6 31 <-> D15
!CE1 !CS0 --> 7 32 <-- !CE2 !CS1
A10 L --> 8 33 --> !VS1
!OE !ATA SEL --> 9 34 <-- NU !IORD
A09 L --> 10 35 <-- NU !IOWR
A08 L --> 11 36 <-- !WE
A07 L --> 12 37 --> RDY/BSY IREQ INTRQ
VCC --- 13 38 --- VCC
A06 L --> 14 39 <-- !CSEL
A05 L --> 15 40 --> !VS2
A04 L --> 16 41 <-- RESET !RESET
A03 L --> 17 42 --> !WAIT IORDY
A02 --> 18 43 --> NU !INPACK NC
A01 --> 19 44 <-- !REG H
A00 --> 20 45 <-> BVD2(H) !SPKR !DASP
D00 <-> 21 46 <-> BVD1(H) !STSCHG !PDIAG
D01 <-> 22 47 <-> D08
D02 <-> 23 48 <-> D09
WP !IOIS16 !IOCS16 --> 24 49 <-> D10
!CD2 <-- 25 50 --- GND
Essential for
minimal
8-bit interface.
Essential for
16-bit interface.

Connector

Pin pitch is 0.05". So it is best suited to surface mount. It is more convenient to lay out PCB tracks so that they approach from both edges instead of interleaving them as is usually done for ATA/IDE connectors.

In the UK, CPC sell CF headers, part ref CN5037.

See http://www.compactflash.org/ for the definitive specification.


Notes

CF combines features from ISA bus, 16-bit PCMCIA, and ATA/IDE buses. It can appear as I/O mapped, memory mapped, or as an IDE device. The IDE mode is always 16-bit, but I/O and memory modes can present data as 8 or 16-bits. These features make it the most flexible choice, allowing it to be used by devices other than the PC - such as 8-bit processors in consumer electronics.

The memory-mapped mode occupies 1K of address space, the top half containing the selected page of data.

1. Devices should allow for 3-state signals not to consume current.
2. Should be grounded by the host.
3. Should be tied to VCC by the host.
4. Optional for CF+ Cards, required for CompactFlash Storage Cards.

* indicates active low signal

   
GND Ground reference voltage.
VCC Power rail, usually 3V3, but can be 5V. The Compact Flash FAQ says:

"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"

This seems to give permission to wire CF cards into 5V systems. This would also be a wise design choice in the CF spec, because consumers avoid the hassle of making sure they have the "right voltage" card.

D0...15 Data bus.
A0...10 Address bus.
RESET System Reset.

Source Code

Sandisk's design page has a freeware ATA Driver / FAT File System, and a circuit diagram for an IDE to CF adapter. The latter has no buffers, so it might be wise to avoid loading it with long drive cables.