Xmega EBI and SRAM

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

I'm trying to design a board with an ATxmega128A1U and I want to add more SRAM via the EBI.
In the XMEGA AU data sheet, which was released 4/2013, it says you can do a non-multiplexed SRAM connection.
When I look through the data sheet, I don't see how it's possible.
I've found some other posts on here that make is sound like it's not possible, but why would Atmel continue to put this in their data sheet?

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

I had a similar question a while ago - https://www.avrfreaks.net/index.p... . The documentation is rather confusing. But, yes, this is possible.

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

Thanks for the info.
Is there any official documentation that shows the port mapping to do this?

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

Do you consider the xmegaAU datasheet an "official documentation"? If yes, then search for EBIOUT. I just did that myself. Just 3 entries. The last one points to a mapping table. The first one points to a sections that describes how to map port3.

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

Thanks again. Looks like Atmel needs to clean up their data sheets.

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

Hallo avrfreaks :)

I have problem with ebi interface on my ATxmega128A1 (see pic). I use an 512KB SRAM with EBI Mode. The higher address bits A16-18 on Port H are not working right in EBI Mode. Adressbits A0-A15 working fine and i can save and read 64KByte datas to sram. Above 64KB address space the address line A16-A18 (PortH CS0-CS2) always have high level.

My ebi circuit on Xmega128A1

EBI Port configuration

My Ebi init code:

//----------------------------------------------------
// init extern 512KB SRAM
// ---------------------------------------------------
void init_sram(void)
{
	// Set signals which are active-low to high value
	PORTH.OUT = 0xFF;
	
	// Configure bus pins as outputs(except for data lines). */
	PORTH.DIR = 0xFF;
	PORTK.DIR = 0xFF;
	
	// init EBI 3PORT/AL1/CS3 (A16-19)
	EBI.CTRL |= EBI_SRMODE_ALE1_gc;
	EBI.CTRL |= EBI_IFMODE_3PORT_gc;

	EBI.CS3.CTRLA |= EBI_CS_MODE_SRAM_gc;
	EBI.CS3.CTRLA |= EBI_CS_ASIZE_16M_gc;
	EBI.CS3.BASEADDR = 0x00;
	EBI.CS3.CTRLB |= EBI_CS_SRWS_2CLK_gc; // EBI time
}

//----------------------------------------------------
// write sram
// ---------------------------------------------------
void wr_sram(void)
{
	uint32_t start_adr = 0x4000; // init Startadr. over 16KB SRAM space in Xmega128A1
	uint8_t data = 0;
	for (uint32_t i = 0; i < 0x80000; i++)
	{
		hugemem_write8(start_adr + i, data);
		data++;
	}
}

Thanks for your help. AVRFreaks is a nice forum :) Greetings from Germany. Rolf

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

Hallo avrfreaks,

i have testing a lot of ebi combinations on my ATmega128A1 MCU without success.

The compiler in my Atmel Studio (6.1.2730 SP2) shows me a warning message: " expected 'hugemem_ptr_t' but argument is of type 'uint32_t' "

How init the hugemem driver in C-Project?

I have load the "Huge Memory Interface" with the ASF Wizard in Atmel Studio. Is that enough or I have to do something else ?

Thanks for your help.

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

Hallo avrfreaks :)

I have solved my problem with Support Team from ATMEL. The EBI Mode: "3PORT/SRAM/AL1/CS3" does not work on my ATXmega128A1 AU Rev. H. But only this EBI Mode: "3PORT/SRAM/AL12/CS" is working with my Xmega and 512KB SRAM.

For testing 512KB SRAM i have load an example from ATMEL Studio (EBI SRAM Example - STK600 ATxmega1281A):

My c-code for init EBI and testing SRAM:


/*
 * Include header files for all drivers that have been imported from
 * Atmel Software Framework (ASF).
 */
#include 
#include 
#include 

static struct ebi_cs_config     cs_config;

//-------------------------
// init EBI for 512KB SRAM
//-------------------------
void init_sram(void)
{
	// Set signals which are active-low to high value
	PORTH.OUT = 0xFF;
	
	// Configure bus pins as outputs(except for data lines). */
	PORTH.DIR = 0xFF;
	PORTK.DIR = 0xFF;
	
	ebi_setup_port(18, 2, 0, EBI_PORT_SRAM | EBI_PORT_3PORT
	| EBI_PORT_CS0);
	ebi_cs_set_mode(&cs_config, EBI_CS_MODE_SRAM_gc);
	ebi_cs_set_address_size(&cs_config, EBI_CS_ASPACE_512KB_gc);
	ebi_cs_set_base_address(&cs_config, BOARD_EBI_SRAM_BASE);
	ebi_cs_set_sram_wait_states(&cs_config, EBI_CS_SRWS_1CLK_gc);
	ebi_cs_write_config(3, &cs_config);
	ebi_enable_cs(3, &cs_config);
}

//----------------------------------------------------
// write sram
// ---------------------------------------------------
void wr_sram(void)
{
	hugemem_ptr_t   p;
	uint32_t base = BOARD_EBI_SRAM_BASE;
	uint_fast8_t    data = 0;
	uint32_t offset = 0x00;
	p=(hugemem_ptr_t)((uint32_t)base + offset);
	
	for (uint32_t i = 0; i < 0x80000; i++)
	{
		if (i== 0x12345)
		{
			hugemem_write8(p+i, 0x55);
		}
		else
		{
			hugemem_write8(p+i, data);
			
		}
		data++;
	}
}

//----------------------------------------------------
// write sram
// ---------------------------------------------------
void rd_sram(void)
{
	hugemem_ptr_t   p;
	uint32_t base = BOARD_EBI_SRAM_BASE;
	uint_fast8_t   data1 = 0;
	uint_fast8_t   data2 = 0;
	uint32_t offset = 0x00;
	p=(hugemem_ptr_t)((uint32_t)base + offset);
		
	for (uint32_t i = 0; i < 0x80000; i++)
	{
		data1 = hugemem_read8(p+i);
		if (i==0x12345)
		{
			if (data1 != 0x55)
			{
				Led1_on;
			}
		}
		
		else
		{
			if (data1 != data2)
			{
				Led1_on;
			}
			
		}
		data2++;
		
	}
}

conf_board.h

/**
 * \file
 *
 * \brief User board configuration template
 *
 */

#ifndef CONF_BOARD_H
#define CONF_BOARD_H


//! State that huge memory access (beyond 64k RAM) should be enabled
#define CONFIG_HAVE_HUGEMEM

//! Base address of SRAM on board
#define BOARD_EBI_SRAM_BASE    0x800000UL

//! Size of SRAM on board, given in bytes: 1 Mb / 128 kB
#define BOARD_EBI_SRAM_SIZE    0x80000UL

#endif // CONF_BOARD_H

EBI-Mode

EBI-Timing

Greetings from Germany Rolf

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

rolfdegen wrote:
does not work on my ATXmega128A1 AU Rev. H
Lots of things don't work on your xmega. Also, your "AU" is a bit confusing in this context. When I see "AU", I think of the U-versions of xmega. Which your's is not.

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

Hallo ezharkov

I have read cpu version from ATMEL Studio 6.1:

Detected device
Device names ATxmega128A1, ATxmega128A1U
Device signature 0x1E974C
Revision H

Datasheet information
ATXMEGA128A1-AU ATXMEGA128A1-CU
CPU AVR8_XMEGA
Flash size 136 Kbytes
EEPROM size 2 Kbytes
SRAM size 8 Kbytes
VCC range 1,6 - 3,6 V 1,6 - 3,6 V
Maximum speed 32 MHz 32 MHz

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

What I was trying to say was:
- ATXMEGA128A1-AU - that AU rarely has any relevance (well, for me, a software guy, anyway)
- ATXMEGA128A1U - that U signifies a MAJOR revision of the microcontroller. I believe that U stands for USB, but apart from USB, this revision also includes lots of bugs fixes.

The generic manual for AxU chips is called XMEGA AU. Therefore, whevever I see AU mentioned in the context of XMEGA, my first responce is, Ah, OK, that is a new USB version. I think others may have a similar reaction to seeing AU. That is why I thought it might be worth pointing out that your mentioning of AU is something that might mislead people.

Quote:
Detected device
Device names ATxmega128A1, ATxmega128A1U
Device signature 0x1E974C
Revision H
For me, and many others, I presume, ATxmega128A1 and ATxmega128A1U are two very different microcontrollers. Yes, they have the same signature. But if ATMEL Studio shows revision H, i.e., Atmel cared to read the revision, I wish Atmel would go a little further and say exactly which one it is (H is ATxmega128A1).

Eugene

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

Yes.. the designations in ATMEL Studio are little confused. The official name for the XMEGA without usb is ATxmega128A1 and with USB is ATxmega128A1U (see ATMEL Produkt Xmega family: http://www.atmel.com/products/microcontrollers/avr/AVR_XMEGA.aspx.

The letters on my xmega chip is ATXMEGA128A1-AU. This is the old version without usb.

Greetings Rolf

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

Hallo avrfreaks..

This is my Hardware with 512KB SRAM (512x16) on ATxmega128A1. The SRAM has 16Bit databus and i have use addressline A19 for switching Lower-Byte and Upper-Byte.So i have 1MByte Ram space on my ATxmega128A1 :)

512KB-SRAM on Xmega

You can buy sram from company WaveShape ore ebay. The prise is 8,- $ plus shipping. http://www.wvshare.com/product/I...

Greetings Rolf

Attachment(s): 

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

All the possible LPC and ALE combinations for 2-3-4-port modes are described in

AVR1312: Using the XMEGA External Bus Interface > 2.1 Connecting Memories and Peripherals

 

And of course see the errata in your device datasheet (not the manual :)

 

Here is a similar discussion: https://www.avrfreaks.net/forum/xmega-au-four-port-ebi