FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-07-2006, 05:27 AM
sachink321@gmail.com
Guest
 
Posts: n/a
Default Accessing compact flash?????????

Environment in which system works:

Microblaze softcore processor on spartan 3 fpga board
compact flash, acting as a mass storage.

How to access the compact flash in embedded applications
write to and read from the compact flash? how to access the FAT table?
to which sector i need to write, which address?

which mode of addressing is easy way out
CHS or LBA??

I got no clue how to access, it would be great help if i could
understand in and out of doing tht becoz i need to write a code in C

Thanks in advance

Reply With Quote
  #2 (permalink)  
Old 04-07-2006, 01:41 PM
Ray Andraka
Guest
 
Posts: n/a
Default Re: Accessing compact flash?????????

sachink321@gmail.com wrote:

> Environment in which system works:
>
> Microblaze softcore processor on spartan 3 fpga board
> compact flash, acting as a mass storage.
>
> How to access the compact flash in embedded applications
> write to and read from the compact flash? how to access the FAT table?
> to which sector i need to write, which address?
>
> which mode of addressing is easy way out
> CHS or LBA??
>
> I got no clue how to access, it would be great help if i could
> understand in and out of doing tht becoz i need to write a code in C
>
> Thanks in advance
>


http://www.compactflash.org/faqs/faq.htm You can register for free and
download the CF3 spec from there.
If you are just using the CF for mass storage that does not have to be
read by a PC, then you needn't format it with a PC file structure. In
that case it is simply a matter of converting your address to a sector
and offset into the sector. There is a bit less bookkeeping if you use
LBA, but either one is relatively easy.
Reply With Quote
  #3 (permalink)  
Old 04-07-2006, 11:58 PM
sachink321@gmail.com
Guest
 
Posts: n/a
Default Re: Accessing compact flash?????????


Ray Andraka wrote:
> sachink321@gmail.com wrote:
>
> > Environment in which system works:
> >
> > Microblaze softcore processor on spartan 3 fpga board
> > compact flash, acting as a mass storage.
> >
> > How to access the compact flash in embedded applications
> > write to and read from the compact flash? how to access the FAT table?
> > to which sector i need to write, which address?
> >
> > which mode of addressing is easy way out
> > CHS or LBA??
> >
> > I got no clue how to access, it would be great help if i could
> > understand in and out of doing tht becoz i need to write a code in C
> >
> > Thanks in advance
> >

>
> http://www.compactflash.org/faqs/faq.htm You can register for free and
> download the CF3 spec from there.
> If you are just using the CF for mass storage that does not have to be
> read by a PC, then you needn't format it with a PC file structure. In
> that case it is simply a matter of converting your address to a sector
> and offset into the sector. There is a bit less bookkeeping if you use
> LBA, but either one is relatively easy.



Hi Ray
im using CF for only Mass storage
it does not have to be read by PC
the problem is to address a particular sector
will LBA make it easier to address?
how do i do this addressing?
how does this thing work?

Reply With Quote
  #4 (permalink)  
Old 04-08-2006, 04:31 PM
Ray Andraka
Guest
 
Posts: n/a
Default Re: Accessing compact flash?????????

sachink321@gmail.com wrote:

> Hi Ray
> im using CF for only Mass storage
> it does not have to be read by PC
> the problem is to address a particular sector
> will LBA make it easier to address?
> how do i do this addressing?
> how does this thing work?
>


LBA makes it easier. Basically you give it a sector number, which is an
address to one of the sectors. It will access one sector at at time,
each sector is 512 bytes, presented two bytes at a time. In order to be
successful accessing it you really have to pick up the Compact Flash
specification and study that. I can't adequately describe the interface
in a post. You'll need either a state machine or a small
microcontroller to sequence the commands to it. For basic access,
you'll need at least the identify, read sector and write sector commands.
Reply With Quote
  #5 (permalink)  
Old 04-08-2006, 11:08 PM
sachink321@gmail.com
Guest
 
Posts: n/a
Default Re: Accessing compact flash?????????


Ray Andraka wrote:
> sachink321@gmail.com wrote:
>
> > Hi Ray
> > im using CF for only Mass storage
> > it does not have to be read by PC
> > the problem is to address a particular sector
> > will LBA make it easier to address?
> > how do i do this addressing?
> > how does this thing work?
> >

>
> LBA makes it easier. Basically you give it a sector number, which is an
> address to one of the sectors. It will access one sector at at time,
> each sector is 512 bytes, presented two bytes at a time. In order to be
> successful accessing it you really have to pick up the Compact Flash
> specification and study that. I can't adequately describe the interface
> in a post. You'll need either a state machine or a small
> microcontroller to sequence the commands to it. For basic access,
> you'll need at least the identify, read sector and write sector commands.



Thanks, that helps

i have already gone through CF spec
but one thing tht troubles me is this

lets suppose there are some files already in a compact flash
im trying to read those files
how will i know at which adresss or at which sector number or LBA is
tht particular file???
once i know tht particular LBA
i can acceess using read sector commmand
But how will i knw which Sector is tht particular file????

Reply With Quote
  #6 (permalink)  
Old 04-10-2006, 12:33 AM
Ray Andraka
Guest
 
Posts: n/a
Default Re: Accessing compact flash?????????

sachink321@gmail.com wrote:

> Thanks, that helps
>
> i have already gone through CF spec
> but one thing tht troubles me is this
>
> lets suppose there are some files already in a compact flash
> im trying to read those files
> how will i know at which adresss or at which sector number or LBA is
> tht particular file???
> once i know tht particular LBA
> i can acceess using read sector commmand
> But how will i knw which Sector is tht particular file????
>


That's what a file system does for you. You need to store a table
somewhere that has the file information. Normally, this is done with a
file allocation table or similar in a known place on the storage device.
It could also be stored off the device somewhere in the host. If you
are doing a data recorder, which was the impression I had, you wouldn't
need separate files and could assume the data jsut starts at the
beginning of the device. If you are going to be reading existing files,
then you need to know how the CF is formatted so that you can find and
interpret the file tables.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing compact flash????????? sachink321@gmail.com FPGA 3 04-07-2006 03:21 PM
Accessing compact flash????????? sachink321@gmail.com FPGA 0 04-07-2006 05:27 AM
WIFI Compact Flash eziggurat@gmail.com FPGA 2 02-17-2006 02:09 AM
Interfacing Compact Flash with Spartan 3 George Mercury FPGA 3 03-11-2005 10:00 PM


All times are GMT +1. The time now is 06:49 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved