Forum Discussion
Altera_Forum
Honored Contributor
14 years agoAs I said above, you don't need a0 and a1 if you only perform 32bit accesses.
So it doesn't matter if you connect them or leave them unconnected (in this case you hardwire to 0 the 2 ssram pins). I suggest you connect them, so you would be able to perform 8 or 16bit accesses, should you need in the future. In program code you don't need to bother about address conversion. If you defined an alt_u32 pointer like in the code you posted, the compiler itself will take care of generating the correct addresses at 4 steps. You can verify this using the debugger with your code: buffer will automatically access addresses spaced by 4. While a alt_u8 pointer would increment by one. I'm concerned about the A19 A20 lines connected to sram_a6 and ssram_a7. I don't know your dev kit, nor your ssram device, so I ignore the reason of such a connection. However this explains the behaviour you observed: accesses at addresses A, A+0x10, A+0x20 and A+0x30 drive ssram pins exactly the same, so you definitely always access (and overwrite) the same memory location.