Another EBI external Sram post

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hello, 

 

I am trying to interface an ATXMEGA128A1U with a 32Kbyte external ram( IS61LV256AL-10TLI ). The circuit is the same as the xmega xplained board (atxmega128a1u version) and is printed in a pcb.I used the atmel EBI library from the AVR1312 application note.

For testing I used the two read and write functions that came with the library. 

 

I am a bit clueless with the whole ordeal, I know that there are older posts conserning external ram but I can't find a complete example of how the ram is properly used. The most efficient way I found was creating a section attribute and using it only with global variables.  I've also modified the memory section of the  project properties .

 

#define XRAM __attribute__ ((section (".xram")))

uint8_t variable XRAM;

 

I am sure that I got the addresses wrong on both .xram and EBI base address. 

Testing with both XRAM variables and the SRAM read/write fucntions didn't produce any results. Could you please check if there is some way too obvious mistake?

 

Thank you for your time!

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

try replacing line

//EBI_EnableSRAM(&external_sram,EBI_CS_ASPACE_32KB_gc,0x804000,0);
EBI_EnableSRAM(&external_sram,EBI_CS_ASPACE_32KB_gc,0x8000,0);

and lines

//_far_mem_enter_ISR();
//_far_mem_write(0x804000 +i, i);
volatile uint8_t * ptr    = (uint8_t *) 0x8000 + i;
 ptr[0] = i;
//result=__far_mem_read(0x804000+i);
result = ptr[0];
//__far_mem_exit_ISR();
fprintf(&Serial_print,"res:%u\n\r",result);

 

 

Last Edited: Mon. Sep 13, 2021 - 03:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the help!

 

I've changed the lines, sadly I didn't get anything from the ram. 

 

I've changed the ram base to 0x0000, also insstead of "external_ram" I've placed EBI.CS0

 

EBI_EnableSRAM(&EBI.CS0,EBI_CS_ASPACE_32KB_gc,0x0000,0);

I've simplified the test loop to:

       

__far_mem_enter_ISR();
__far_mem_write(0x004014, 0x12); 
result=__far_mem_read(0x004014);
__far_mem_exit_ISR();

I've tried debbuging it with an atmel-ice, according to atmel studio, it filled all the memory slots from 0x4000 to 0x0FFFE (65534) with the number 12.

 

Attachment(s):