I have got an ATXmega128A1 and a 32kByte-SRAM connected at EBI (3-Port-Mode).
I configure the system like this:
PORTH_OUT=(1<<PIN0_bp) | (1<<PIN1_bp) | (1<<PIN2_bp) |(1<<PIN4_bp); PORTH_DIR=0xFF; PORTK_DIR=0xFF; EBI.CTRL=EBI_SDDATAW_8BIT_gc|EBI_LPCMODE_ALE1_gc|EBI_SRMODE_ALE1_gc|EBI_IFMODE_3PORT_gc; EBI.CS0.CTRLB=(1<<EBI_CS_SRWS2_bp); // 4 wait states EBI.CS0.BASEADDR=0x0000; EBI.CS0.CTRLA=EBI_CS_ASPACE_32KB_gc|EBI_CS_MODE_SRAM_gc;
But in this case I can only address 16kByte (0x4000-0x7FFF) instead of 32kByte (0x4000-0xBFFF). The highest address line (A14) is always high (logical '1').
If I use EBI_CS_ASPACE_64KB_gc instead of EBI_CS_ASPACE_32KB_gc then I can write the full 32kByte RAM. But in the first 16kByte A14 is set and in the last 16kByte the A14 is cleared.
I have got the suspicion that I cannot access the lower 16k address space. But why? I played a bit with the EBI.CS0.BASEADDR register. But it does not help. To be honest: I do not really understand the description of this register...
Thanks in advance for any help or comments!