Forum Discussion

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

i am confused by the flash address

hi all

i use am29lv160db as the flash of nios system, i set it to work under the mode of 16 bit, and the address is 20 bit!

the address that the flash is assigned to by the sopc is from 0x00000000 to 0x001fffff, but i think the address should be from 0x00000000 to 0x000fffff!why????

9 Replies

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

    With a 16-bit data bus you'll probably find the A0 line doesn't do anything; you'll need to connect the SOPC A1 to flash A0, A2 to A1 etc.

    If you want to write single bytes, you must use the "byteenable" signals.

    This is similar to how a 68000 processor works.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    i understand u ,

    if i use sst39lv160,16Mbit flash,i think its address should be from 00000000 to 000fffff, but it ends in 001fffff!

    it has 2M X 16bit space?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    1ffff means 2M Bytes, not 2M*16-bit. The address space is of Byte unit, not 16-bit or 32-bit.

    Avalon bus can deal with different data width by dynamic align no matter what data width is.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    i see

    but sst29lf160 only has 16bits mode,and its end 001fffff! why?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    There is no capacity difference between 39vf160 and 29lv160. The FLASH is named according to their capacity by bit unit, 160 means 16M bits.

    In SOPC the address is of Byte unit, so 16M bits=2M Bytes and the address is range from 0 to 1fffff!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    do u mean in 16 bit mode, the a0 of flash is connected to the a1 of data bus?

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

    --- Quote Start ---

    originally posted by jasondiplomat@Jun 28 2005, 10:06 AM

    with a 16-bit data bus you'll probably find the a0 line doesn't do anything; you'll need to connect the sopc a1 to flash a0, a2 to a1 etc.

    if you want to write single bytes, you must use the "byteenable" signals.

    this is similar to how a 68000 processor works.

    --- Quote End ---

    Yes - as I said a few posts back.....
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    From master side, the address is byte alignment,

    From your 16-bit flash(slave), it is word alignment.

    How do you solve this problem?

    Yeah,JasonDiplomat and sybase2008 gave your right answer.