本文介绍了CF(Compact Flash)卡的基本结构和工作原理。在此基础上详细的给出了在C8051F34x-DK开发平台上,通过串口发送ATA命令和非ATA命令来控制C8051F340单片机,对CF卡等PC卡的各项特征信息(如:扇区总数、柱面数、磁头数、每磁道扇区数、序列号等)和功能(在三种模式下的CF卡8位/16位的读,写,连续读,连续写等)进行一系列测试的一个通用测试系统的设计方案。文中详细介绍了True IDE模式下写CF卡一个扇区的具体实现过程,并给出了相应的程序以及系统的运行结果。 关键字:CF卡;C8051;串口;ATA命令;测试系统 Abstract: First of all, the working principle theory and operating method of CF card is introduced in this paper. On the basis of this, a generic storage test system is designed, which is intend to provide a means to functionally test a CF card,PC Card ,IDE drives or other similar storage subsystems. The test setup is based on Silicon Lab’s C8051F34x-DK development kit. And the testing will be performed using ATA commands and non- ATA commands via the C8051F340 microcontroller. We also give the details of writing a sector of CF card in the True IDE mode. The relevant program and result is also put forward. Key words: CF card; C8051; serial port; ATA command; test system