Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
The Hoarder (SAK) board should give you some idea about how to interface the compact flash card and to program a file system (I am not sure whether it's FAT or FAT16). The MCU used in this project is PIC16F877 not the MCS51 ... https://vadim.www.media.mit.edu/Hoarder/Hoarder.htm
FAT16/32 File System Interface
This FAT16/32 interface allows you to detect and mount FAT16/32 partitions, browse directories and files, and read file data. The interface is design to operate with the avrlib IDE/ATA driver. Reading FAT efficiently requires at least 512+ bytes of RAM so this interface may not be suitable for processors with less than 1K of RAM. This interface will properly follow a file's cluster chain so files need not be defragmented.
IDE/ATA Interface Driver (for IDE/ATA hard disks)
This library provides an interface from AVR processors to IDE/ATA hard disks. The library supports automatic drive identification and sector-level reading and writing. Some minimal address decoding hardware is required to use this interface. A schematic of the interface is coming. Future revisions may include a direct hardware-less option.