There is an on-going project described in an article (Circuit Cellar, Issue 150). The title is " Construct an ATA Hard Drive Controller". I believe that the author (Fred Eady) mentioned about FAT16, FAT32 read/write in his article. This article may be a good starting point for your project. Unfortunately, the microcontroller used in this project is ATmega128 (not your favorite 8051s ). However, the source code is written in C-language. I think that it should be easy to port this code to 8051 MCUs.
Hi..all,
In case that someone may want to take a look at the souce-code of the "Construct an ATA Hard Drive Controller" project. Here is the attached code (sorry no schematics ). Please keep in mind that this is an on-going project. So you will find that this source code is not yet completed. Let's wait for Mr. Fred Eady to publish his new article.
There is only available trial library without source code for:
"From this page you will be able to download a Visual C++ compiled library and sample code for the Windows environment"