PIC to CompactFlash interface programming

Hi everybody!!!!

At this moment, I'm working on a PIC to CompactFlash interface an I have decided to configure de media in True IDE Mode. I have already looked at CompactFlash specifications and the next step would involve the card acces programming. Is there anyone with experience in this field?. Have you got any code examples?.

I thanks your help in advance.

DAVE

Reply to
David Fernandez
Loading thread data ...

Hi Dave

How about entering "PIC IDE interface" into google and look at the various pages about this very topic?

HTH

Markus

Reply to
Markus Zingg

Reply to
g9u5dd43_nospam

Ok, I have seen it yet. But in this article, CompactFlash card is configured in Common Memory Mode, not in True IDE Mode. In addition to this, I'm trying to acces Data Register in 8bit mode (not well documented in CF specifications). Thank you anyway!.

Reply to
David Fernandez

Well, David, if you would have run the Google search I told you in my first answer to you, you would have found (first hit!) what you are asking for...

Markus

Reply to
Markus Zingg

Since you are not replacing an existing HD, I would not bother with True IDE mode. In that mode your CF card is not really removable. That is, you will have to power cycle the CF card if you remove and reinstall the card in its slot. In Common Memory Mode, you don't have to worry about that.

As you may have already discovered, to read data 8bits at a time, simply read the data from offset 0 of the card register file, and repeat for as many bytes as you are suppose to read. Typically 512.

Below is a sample of code I used long ago. I make no promise that it actually works, but it worked for me.

Rich

------------------------------------------------------ for (i=0; i < DEVICE_WORDS_PER_SECTOR; i++) { Status = CFWaitReady(); if(Status & ERROR_MASK) { return Status; } if(!(Status & CF_STAT_DRQ)) //check drive for errors after Read command was issued { return CF_SHORT_READ; } *buffer++ = CFReadReg(DATA_REG); *buffer++ = CFReadReg(DATA_REG); } return Status;

------------------------------------------------------

Reply to
Rich

formatting link

Reply to
Alex Gibson

HI David.

You speak spanish right?

Bueno, te comento que yo TENGO DESARROLLADO la interfaz entre un PIC

16f877 y una compact flash. Ademas todo esto basado en estandar ATA12 y ATA16.

Lo tengo hecho para mi tesis, y funcionando a 8 bits, que es lo mejor. Ademas, lo hago andar con comandos ATA de disco duro, pero se usa de una manera especial. Debo comentarte que las especificaciones dadas por los fabricantes, son bien malas, en particular si eres nuevo en todo esto. A mi me costo 6 meses hacer partir el sistema porque hay muchas explicaciones que se contradicen.

Mi mail es: snipped-for-privacy@hotmail.com y contactame via messenger, con mucho Gusto te ayudo.

Ademas, hay que reconocer que los gringos no ayudan mucho en estos foros porque sienten que se rompe la propiedad intelectual de ellos, o secretos profesionales. A mi me da lo mismo, lo regalo al mundo.

Saludos desde chile.

Rich wrote:

Reply to
gugo

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.