Re: compact flash

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Quoted text here. Click to load it

I'm using it in memory mode, but while searching the web I found an
audio player project which did use CF in IDE mode. If you google for
"Compact Flash" IDE you should find it.
Tim Mitchell

Re: compact flash

here's what I wrote. It's been able to read a sector from the CF card.

Note it's :

 1/ directly ported from a very useful SanDisk AN that can be downloaded here :

 2/ ugly code


void wait_ready(void) {
    while((cf[STATUS_REG] & 0xF0) != 0x50);

void wait_drq(void) {
    while((cf[STATUS_REG] & 0xF8) != 0x58);

void read_sect(const unsigned long num) {
    cf[SEC_COUNT_REG] = 0x01;
    cf[LBA_LOW] = num;  // No need for a cast...
    cf[LBA_MID] = (num >> 8) & 0x000000FF;
    cf[LBA_HI] = num >> 16;
    cf[DRV_HD_REG] = 0xE0;
    cf[COMMAND_REG] = 0x20;

void get_data(void) {
    uint i;
    xdata char * data b;

    b = IDE_BUF;
    for(i=0;i<512;i++) {
        *(b + i) = cf[DATA_REG];
} (Timothy Wen) wrote in message
Quoted text here. Click to load it
Quoted text here. Click to load it

Site Timeline