I'm trying to use the EBI (SRAM LPC) feature on my XMEGA A1U Xplained Pro board (relevant datasheets attached).
I followed the instructions/guidelines on the AU Manual and EBI AppNote and was able to access addresses 0x4000 to 0xFFFE (approx 50Kilobytes). Given that the SRAM chip used on the Xplained Board has 512KBytes of space, I should be able to access at least 512 or 256Kbytes (based on whether or not I use the A18 pin).
Here's the initialization code I've written:
PORTJ.DIRCLR = 0xFF;//kk //Setting all of Port J to Input Mode (data bus) (from AU manual) PORTH.DIRSET = 0xFF;//kk //Setting all of Port H to Output Mode (AU manual) PORTK.DIRSET |= (1<<7); //Setting K7 to Output Mode PORTH.OUT = 0xFF; //"Set signals which are active-low to high value" - https://www.avrfreaks.net/forum/setting-external-sram-project PORTH.PIN6CTRL |= (0b11<<3); //Pulling up H6, because it is the chip-select wire/pin (according to EBI section in AU manual) EBI.CTRL |= (1<<5); //SRAM LPC mode: ALE 1 & 2 enabled EBI.CTRL |= (1<<1)|(1<<0); //Configure it in 2-port interface mode (according to A1U-XPRO Manual) EBI.CS2.CTRLA |= (1<<1); //Set the CS2 to (SRAM)LPC mode EBI.CS2.CTRLA |= (EBI_CS_ASIZE_512KB_gc); //Set size of address space to 512kB, because that's how big the external SRAM is. EBI.CS2.BASEADDR = (0x0); EBI.CS2.CTRLB |= (0b111<<0); //Set longest possible wait length (7 CLK(PER2) cycles per wait state)
Here's what I see on the "Memory" view of Atmel Studio 7 after running the above initialization code. I'm not able to write to the addresses labelled with "??", leading me to believe that those addressed haven't been "activated" (not sure if that's the right word).
Are there any details regarding either the A1U's EBI feature or the Xplained Board that I haven't taken into account? What can I do to be able to write to the entire (512kByte or 256kByte) address range of the attached external SRAM?
Thanks for your time!