Application Note
June 2003
©2003 Silicon Storage Technology, Inc.
S72032-02-000 6/03
1
The SST logo and SuperFlash are registered trademarks of Silicon Storage Technology, Inc.
These specifications are subject to change without notice.
1.0 INTRODUCTION
The CompactFlash (CF) card SST48CFxxx supports three
operational modes: (1) PC card ATA using I/O mode, (2)
PC card ATA using Memory mode, and (3) TrueIDE mode.
Individual application notes have been generated that pro-
vide reference designs for an SST FlashFlex51 MCU to
control a CF card operating in each of its three operational
modes. This application note introduces the hardware and
firmware reference design for the SST89C54/58
1
(8051-
compatible microcontroller) to control the CompactFlash
card SST48CFxxx
2
in TrueIDE mode. For the other two
modes, please reference two additional application notes at
www.sst.com, namely
FlashFlex51 Microcontroller Control
of CompactFlash Card in Memory Mode
and
FlashFlex51
Microcontroller Control of CompactFlash Card in I/O Mode
.
2.0 HARDWARE DESIGN
The following hardware design description refers to the
detailed schematic diagram provided in Appendix A.
To enter TrueIDE mode, it is mandatory that /OE (pin 9,
also called /ATASEL) be low during power-up. If /OE is high
during power-up, the CF card will enter into Memory mode.
/DASP (pin 45) is connected to an LED through a resistor
to V
DD,
which provides user visibility of CF card internal
operation. When the CF card is busy, the LED will be on.
In TrueIDE mode, the CF card supports two-card operation.
One card can be set as master (/CSEL=low) and the other
as slave (/CSEL=high). This reference design implements
only one CF card which can be set as either master or
slave. The firmware checks pin P3.5 to determine whether
the CF card is master or slave, but the firmware CANNOT
change the setting on the fly. Any change on the /CSEL pin
will take effect after the next
reset.
One address latch 74HC373 (or 74HC573) is eliminated by
connecting the address bits A
0
, A
1
, A
2
of the CF card
directly to 8051 MCU address pins A
8
(P2.0), A
9
(P2.1),
and A
10
(P2.2), instead of connecting them to A
0
, A
1
, A
2
outputs of an address latch device. The same firmware
code will work for either hardware connection scheme.
Connecting P1.1 to /RESET (pin 41) provides the capability
to reset the CF card at any time, whether due to a system
requirement or a system bug.
3.0 FIRMWARE DESIGN
It is important to understand that the ATA/IDE standard
does not permit access to media such as HDD or CF card
of one byte at a time. The firmware must read or write data
one or more sectors at a time, where one sector equals
512 bytes of data. The system design engineer must incor-
porate a data buffer to support random access to CF card.
This reference design uses the secondary block (4 KByte x
8 bit) of on-chip flash memory of the SST89C54/58 as a
data buffer.
In TrueIDE mode, memory or attribute registers are not
accessible to the host. The default CF card operation is 16-
bit. The firmware must explicitly run the Set-Features com-
mand to enable 8-bit operation before 8-bit data transfers
commence.
After power-up, a reset at pin 41, or a software reset, the
SST48CFxxx CF card will be ready to perform any opera-
tion after waiting 50 ms (typical) or 400 ms (maximum)
3
.
Thus, the firmware needs either to add a 400 ms delay or
poll the Busy and RDY bits of the status register until the
CF card is ready. Additionally, software reset provides the
host MCU another choice to reset the CF card, even if the
CF card is busy on an internal operation.
The complete 8051 source code for this application is pro-
vided in Appendix B.
4.0 CONCLUSION
8051 control of the CF card in TrueIDE mode is straightfor-
ward, and it is easy to modify this reference design to sup-
port any other embedded controller as long as the designer
follows the guidelines provided in this application note.
1. SST89C54/58 data sheet, www.sst.com
2. CompactFlash card SST48CFxxx data sheet, www.sst.com
3. See “Start Up Time” under Features on page 1 of the CF card
data sheet.
FlashFlex51 MCU: Control of CompactFlash Card in TrueIDE Mode
FlashFlex51 Microcontroller
Control of CompactFlash Card in TrueIDE Mode