Forum Discussion

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

Problem with the Compact Flash Controller

Hi, I've got a Nios system compiling just fine with several peripherals, but I've got some output pins stuck at VCC and GND. They're all from the Compact Flash controller in sopcbuilder.

I looked at the file that sopcbuilder generated and saw that these pins were being hardcoded to 1 or 0. Why would this happen? Here's the part that's doing it:

assign atasel_n = 1'b0;
  assign we_n = 1'b1;
  assign rfu = 1'b1;
  assign addr = 8'h00;
  assign addr = av_ide_address;

So some of the pins are just simply hardcoded and also only two bits of the 10 bit address "addr" are being used.

Does anyone have any ideas?

Thanks,

Jon

3 Replies

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

    --- Quote Start ---

    only two bits of the 10 bit address "addr" are being used

    --- Quote End ---

    Actually three address bits, sufficient for true IDE mode.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ha, I noticed that error about two seconds after I hit "Post."

    Regardless, so if I'm understanding you correctly, would that mean that there are only 2^3 = 8 relevant addresses in an entire Compact Flash card of any size?

    Surely I'm missing something here. Anyway, if the hardcoded pins are in fact correct, they will not need to be connected to Cyclone III device pins then, correct?

    Thanks a million,

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

    There are 8 control registers. You can learn the ATA/IDE programming details from ATA specifications www.t13.org or manufacturer documents, e.g. from Sandisk.