Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

CF interface problem

Hi,

I used CF interface with Jesse's software on Cyclone 1C20 devkit. With Alteras CF and SanDisk 256M all works fine, but with new Kingston (1G 50X elite pro) during Automated sector write/readback test prints:

ATesting compact flash device. 201489 sectors will be tested. Progress:

|----|----|----|----|----|

awaitDRQ; error: timeout awaiting DRQ=1

error register: 0x7700

writeSectorsGuts(): timeout awaiting DRQ for multi-sector write.

writeSectorsCHS(): writeSectorsGuts failed.

writeSectorsCHS() failed.

[cf_test] writeLogicalSector attempt failed.

[cf_test] --> starting sector=64, num sectors=32

awaitDRQ; error: timeout awaiting DRQ=1

error register: 0x7700

writeSectorsGuts(): timeout awaiting DRQ for multi-sector write.

writeSectorsCHS(): writeSectorsGuts failed.

writeSectorsCHS() failed.

[cf_test] writeLogicalSector attempt failed.

[cf_test] --> starting sector=64, num sectors=32

*

......

I connect ATASEL_N to ground, but error still occurs.

Can you help me?

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Leszekd,

    You may need to change the hardware bus timings for the faster cards. We connect to the CF card via some user logic and have used the following timings for about the past two years:

    setup=70nS, wait=150nS, hold=20nS.

    These timings, although slow, were used to allow us the best chance of working with any card.

    Recently we started having problems with some of the newer and faster cards and, by trial and error, the following timings were found to work with almost all cards (including some very old ones):

    setup=15nS, wait=60nS, hold=30nS.

    By coincidence, I've got a Kingston 512Mb x50 and it works ok now but it wouldn't on the old timings.

    The CFA specification contains the timings for different types of cards but unless you have dynamic bus timings on your system you'll need to find some kind of compromise.

    Banx.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Banx, it was exactly it !!!

    Very thank you for help me.

    We previously had Setup Time=60ns, Hold=60 and Wait=180, but new CFs didn't work good. Next I started with Jesse's project, with Hold = 30ns, Setup= 70 and Wait=500/530ns and new CFs didn't work too. With your times all CF I have (ALTERA 16MB, SandDisk, Kingston x50, Transcend x80) succesfully tested bu Jesse's Nios application program.

    Best regards