Hi!
I have connected an external memory interface through the EMIF module. Basically, its a DPRAM (4K x 16 bit). Unfortunately, I have missed the pins BA0, BA1 and A0 of controller and directly connected A1 of controller to A0 of DPRAM.
This hardware error cannot be corrected for now and I have planned to go ahead with this implementation for now.
Now, when I have to declare variables in DPRAM space, I use:
#pragma LOCATION(ui_dummy_variable, 0x64000000)
uint16 ui_dummy_variable;
to allocate the address 0x64000000 to the variable, "ui_dummy_variable" right?
Because of the above hardware error, if I have to increment by next address in DPRAM memory space, then I will have to multiply the address by 8 to generate next sequential address.
#pragma LOCATION(ui_next_dummy_variable, ((0x64000000 + 1) * 8))
uint16 ui_next_dummy_variable;
Therefore, both the variables "ui_dummy_variable" and "ui_next_dummy_variable" are assigned one after the other in the DPRAM space.
The question is, what if I need an array of a particular size?
For instance, if I declare like this:
#pragma LOCATION(ui_dummy_array, ((0x64000000 + 2) * 8))
uint16 ui_dummy_array[4];
Does this allocate memory in the following way in DPRAM:
ui_dummy_array[0] = ((0x64000000 + 2) * 8)) <-- address of ui_dummy_array[0]
ui_dummy_array[0] = ((0x64000000 + 3) * 8))
ui_dummy_array[0] = ((0x64000000 + 4) * 8))
ui_dummy_array[0] = ((0x64000000 + 5) * 8))
If not, then it what way is memory allocated to "ui_dummy_array[4]" in DPRAM?
Please provide some help.
Thanks!
Regards,
Chetan.