Continue to Site

Welcome to EDAboard.com

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.

Compact Flash in Memory Mode and AVR

Status
Not open for further replies.

NikZetaJones

Member level 2
Member level 2
Joined
Mar 31, 2002
Messages
46
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Visit site
Activity points
299
compact flash avr

Hello

I'm programming in CV AVR (with a mega128) and would like to use a 16MB Compact Flash in memory mode. I downloaded the SanDisk Datasheet but only talks about True IDE Mode. Does anybody has a C code for using this device with an AVR? Or the information about how to communicate with it? I tried the Yampp proyect wich uses a CF but didn't found information about how to use the CF in Memory Mode (yes in True IDE Mode). Thanks
Ezequiel
 

compact flash avr

Maybe this can help you:
**broken link removed**

best regards
 

avr cf

I think this is good one

/ Warning #1 - File deleted, search google before upload!
**broken link removed**
 

lba avr ata 48

woody28 said:
I think this is good one

or download it here:

CIRCUIT CELLAR ONLINE
February 2001
PIC a CompactFlash Card
**broken link removed**


Mik
 

flash database

woody28 said:
I think this is good one
**broken link removed**
Have anyone tested it? I after reading CF specification I know that code seems be OK, but on my testboard it is not working :cry: (CF is connected identical to my PIC16F877) .Does anyone personally have tried to use CF card in Memory Mode and success?
 

pic a compactflash card

I have built a Compact Flash Data acquisition system with ATMega128 and FAT16 support.
I can't give you any sources...sorry...

The problem is that you have to meet the timing of the CF Specification.
With my 16MHz system i had to do this by adding 2 wait states.

It will probably work on most cards without the wait states, but don't come complaining when it doesn't.

The Read/Write sector protocol is relatively simple.
Try to allways use the LBA mode, this is so much simpler and doesn't require Translation.

First set the LBA sector you want to access by writing the Cylinder High, Cylinder Low, Sector and Head Register. Write the number of Sectors you wish to read to the Sector Count register. Write the "Read Sector" or the "Write Sector" Command to the Command Register.

Then wait at least 400us and start checking the Status Register.
The CF Card will be busy for some time (Only test for the Busy bit!, the others are not valid if the busy bit is set!!!)
When the busy bit is 0, then check if there was an error.
If there was no error check if the Card is ready and there is a Data Request (RDY and DRQ bits in the Status register (Check for 0x58))
Then start reading the Data register.
In 8 bit mode, just keep reading from the data register for 512 times.
I think the MSB comes first and the LSB is second.

When you are done, you can start another transfer.


Be carefull with your print layout.
I had some trouble with some cards with my wire wrap board.
Fixed the problems by adding Capacitors over the databus and RD and WR on the CF Card side.

I can't give you any details on the FAT16 implementation because that is a kind of confidential ;-)

I'm a little dissappointed with the access times and the transferspeed of the Cards.
When i read a sector it takes up to 2ms to access a sector and then i have to read the buffer...

Does anyone have some experiance with the access timing of the CF Cards???

Greetz, Venz..
 

avr compact flash code

This might be a help:
**broken link removed**
**broken link removed**

I found these links in the MP3 projects database: http://www.mp3projects.com


I know there is a big speed difference from CF card to CF card, it depends on the manufacturer and model.
 

cf memory avr

venz said:
The problem is that you have to meet the timing of the CF Specification.
With my 16MHz system i had to do this by adding 2 wait states.

It will probably work on most cards without the wait states, but don't come complaining when it doesn't.
I haven`t think about this.
venz said:
The Read/Write sector protocol is relatively simple.
Try to allways use the LBA mode, this is so much simpler and doesn't require Translation.
Yeah, sure, when I catch idea, it is easy. Easiest way to undestand how CF card is working is to think about it like a 8byte memory when, one cell is FIFO.
venz said:
Then wait at least 400us and start checking the Status Register.
The CF Card will be busy for some time (Only test for the Busy bit!, the others are not valid if the busy bit is set!!!)
When the busy bit is 0, then check if there was an error.
If there was no error check if the Card is ready and there is a Data Request (RDY and DRQ bits in the Status register (Check for 0x58))
Then start reading the Data register.
In 8 bit mode, just keep reading from the data register for 512 times.
I think the MSB comes first and the LSB is second.
I was testing BSY line, but cards those I was testing (3 models diffrent manufactures) were responding 0x58 too(or maybe 0x50 in non interrupt mode, it was 3 months ago). I was trying to execute Indentify or Read Sector comands without any success, card was still ready after 'execution' but there was no data and status bit showing 'data ready to read' wasn`t set. I hade checked wiring, and signal level at apropriate CF input few times without any mistake found.
PS Those card that I am using are 100% good and working in TrueIDE mode.
 

cf card avr

venz said:
The problem is that you have to meet the timing of the CF Specification.
With my 16MHz system i had to do this by adding 2 wait states.
You can get special High Speed (52xSpeed) CompactFlash cards like theese:
http://www.performance-memory.com/compactflash.asp
CF128-PM-50.jpg

Dual Voltage 5V/3V
128MB to 1024MB
Full ATA Compatible
True IDE Mode
Type I PC Card
Write:8Mbit/per second
Read:9Mbit/per second
10 years warranty
 

compact flash reading memory mode

Hi, i'm trying to use the identify command, after i send it in the status register appears 0x58 (Ready, Data Request and Card ready are set), when i read address 0 (data register) i receive a lot of characters, the same character always, and if i read the status register i always receive 0x58 (DRQ = 1 ??????). I need help, i don't understand anything.

I'm working in true ide mode and i use 8 bit transfers for all (feature 0x01).

sorry for my horrible english.


thanks.
 

compactflash avr

ok, finally i'm reading from a compactflash.

thanks.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top