Content originally posted in LPCWare by arion2001 on Thu Feb 05 00:17:26 MST 2015
Hi Mike,
Thanks for the knock on the head and thanks for having the patience....how careless of me for not noticing the P2[24] pin where it is supposed to be P4[24]..yet again :p . I really appreciate it for pointing it out on me.
As for the address, I noticed something really interesting as my base address is 0x80000000 when offset by 0x555 I get 0x80001554. It shows the 0x555 is left shifted twice which is multiples of 4. So my question is when the data sheet says "*( base_addr + 0x555 ) = 0x00AA; " in the C code does it actually mean do this instead : *( base_addr + 0x154 ) = 0x00AA; ? Since this is 0x555 right shifted twice, we get 0x154.
I tried playing around with EMCSC bit but it does not seem to change it because the address still get shifted left twice so if I use 0x555 I will still get 0x1554. Does this have anything to do with the /BYTE line being pulled high?
In my System Controls and Status register (reference to chapter 3.3.20) EMCSC value it is initialized as:
BIT 0 = 1
Static memory addresses are always output as byte addresses regardless
of the data bus width. For example, when word data is accessed on a
32-bit bus, address bits 1 and 0 will always be 0. In this mode, one or both
lower address bits may not be connected to memories that are part of a
bus that is wider than 8 bits. This mode matches the operation of LPC23xx
and LPC24xx devices.
Should I set it to
BIT_0 = 0 instead? Since the A1 of the CPU is connected to the A0 of the memory, I am thinking EMCSC bit 0 should be set to 1 instead. However if that is the case, how exactly do we translate the base address of 0x8000 0000 to match the shifted address? I am stumped here.
Static memory addresses are shifted to match the data bus width. For
example, when accessing a 32-bit wide data bus, the address is shifted
right 2 places such that bit 2 is the LSB. In this mode, address bit 0 for the
this device is connected to address bit 0 of the memory device, thus
simplifying memory connections. This also makes a larger memory
address range possible, because additional upper address bits can appear
on the higher address pins due to the shift.