Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

FAT32 Reading/Writing with 8051: how?

Status
Not open for further replies.

cbsirio

Member level 3
Joined
Jan 5, 2003
Messages
64
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
721
Hi all,
I have to read/write files to an harddisk connected to a 8051 uP.

The hard disk is formatted in FAT32.

I was searching for "C" source (no asm) to read/WRITE files in this device...

Can someone help me ?

Many thanks in advance.

Sirio.
 

year

Member level 3
Joined
Feb 21, 2002
Messages
62
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
441
FAT32 ....
8051 has to compute 4 bytes arithmetic.
U may check cpu power that can be or not....
 

cbsirio

Member level 3
Joined
Jan 5, 2003
Messages
64
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
721
Klug: Thank you, but the link you posted have only "asm" reference... :oops:
I was searching for "C" source library or piece of code to extract them.


Year: I have no to hurry up... :) I have enough time to make the necessary calculations: I need about 10 kb/s of speed ...

Thanks again, Sirio.
 

year

Member level 3
Joined
Feb 21, 2002
Messages
62
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
441
And One More...

And also needs lots of SRAM to handle file read and write because of FAT size, as far as I know.

Please check MS home page and DDK...
 

binnyr

Junior Member level 3
Joined
Apr 26, 2002
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
217
HI:
Check out this site. Its based on AVR microcontrollers. Again this will prove to be a good starting point.

http://www.myplace.nu/mp3/index2.htm

You can go thru the C code in the download sections...

Binny
 

year

Member level 3
Joined
Feb 21, 2002
Messages
62
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
441
I saw the web...
Very good sample to learn. I agree.

But writing function is not easy at HDD.
Anyway, you will know after you do...

These are points
- MBR
- PBS
- ROOT DIRECTORY ENTRY
- FAT1, FAT2 area
- LONG FILE NAME
- SUB DIRECORY(FOLDER)
- SUB DIECORY ENTRY

WINHEX is good tool to know FAT file system.
 

year

Member level 3
Joined
Feb 21, 2002
Messages
62
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
441
Hi cbsirio,

Now you seems like finding right way.

OK, that is not easy but can not be impossible...

Be success.
 

Dspnut

Full Member level 2
Joined
Jul 18, 2002
Messages
141
Helped
10
Reputation
18
Reaction score
5
Trophy points
1,298
Activity points
1,267
Hi all,

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.

Hope this helps.
 

cbsirio

Member level 3
Joined
Jan 5, 2003
Messages
64
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
721
Hello Dspnut,

Excuse me for my question ... but what is Circuit Cellar ? :(

I know Electronic Express, but I have no idea on what is this... Is a periodic?
How can I find it ?

It seems to be very interesting, so, can you be more specific, please? :sm7:

Thank you!!

Again ... thanks all! :sm9:
 

Dspnut

Full Member level 2
Joined
Jul 18, 2002
Messages
141
Helped
10
Reputation
18
Reaction score
5
Trophy points
1,298
Activity points
1,267
Hi..cbsirio :)

Circuit Cellar is a (IMHO) very popular electronic and embedded system magazine. You can read some online articles here at

http://www.circuitcellar.com

Also look around in the MCU fileman.... :wink:
 

Dspnut

Full Member level 2
Joined
Jul 18, 2002
Messages
141
Helped
10
Reputation
18
Reaction score
5
Trophy points
1,298
Activity points
1,267
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 :cry: ). 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. :D
 

dainis

Advanced Member level 4
Joined
May 15, 2001
Messages
1,126
Helped
53
Reputation
106
Reaction score
9
Trophy points
1,318
Activity points
9,271
Look Ethernu project:
h**p://w*w.ethernut.de/en/index.html

Added: Cool IDE diskdrive and Compact Flash interface done by Michael Fischer. Supports FAT32 with long filenames
 

tcsa35

Full Member level 3
Joined
Mar 19, 2002
Messages
171
Helped
10
Reputation
20
Reaction score
8
Trophy points
1,298
Activity points
1,507
Hi,

Look this, may be work:)

h**p://www.ucos-ii.com/contents/products/file_system.html
 

dainis

Advanced Member level 4
Joined
May 15, 2001
Messages
1,126
Helped
53
Reputation
106
Reaction score
9
Trophy points
1,318
Activity points
9,271
tcsa35 said:
Hi,

Look this, may be work:)

h**p://www.ucos-ii.com/contents/products/file_system.html
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"
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top