A Message Board, Guestbook, or Poll hosted for your website.
4D SYSTEMS FORUM

Register Login New Posts Chat
4D Systems > Forums > micro-DRIVE > Mixing FAT and RAW accesses
 
Username:
Password:
 

Thread Tools  | Search This Thread 
Reply
 
Author Comment
 
marcwolf
Registered: 02/11/09
Posts: 1

    03/11/09 at 11:20 AM
Reply with quote#1

Hi
I am working on part of a project and I need a little help.
I have created a series of animatronic sequences which will be read and passed to a servo controller. These sequences have a build in command  structure that will allow  Loop X times, Jump back to X etc.

I need an easy way to write this large file onto a 64mb SD card. I can do that using FAT16 with no problems.

However I need to then read this file in a PicAXE environment. I can open the file in FAT mode and read in X bytes at a time, however I cannot then jump back X bytes.

If I use RAW mode then I have more control over the pointer and can skip back 300 bytes if necessary. However it them makes it much more difficult to initially write this file from the PC.

However.... If I know the starting point of the file on the SD drive then I can save it using FAT, and then jump to the starting point using RAW mode and read it that way.

So.. Can anyone tell me a quick way to find the first byte of a file (or data area as there will only be 1 file) on a SD ram card.
If really worst comes to worst I can save the file and then use a disk editor to look for its start and get the byte count - but an eaier way would be great.

Dave
ESPsupport
Moderator
Registered: 27/01/09
Posts: 100

    03/11/09 at 11:31 AM
Reply with quote#2

Unfortunately knowing where a FAT file starts, doesn't necessarily help you as it may not be contiguous, even if it is the only file on the card.

Your best bet is to write the file to the card in RAW mode using FAT controller and 'RAW SD', 'Write Sectors'. You should be able to place a PC file contiguously at any location on the SD card using that.
Previous Thread | Next Thread
Reply

 
Bookmarks
 
Digg Diggdel.icio.us del.icio.usStumbleUpon StumbleUponGoogle Google