Microchip® Advanced Software Framework

ebi_sram_example.c File Reference

AVR XMEGA External Bus Interface (EBI) example.

Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries.

#include <stdint.h>
#include <conf_board.h>
#include <asf.h>

Functions

static status_code_t ebi_test_addr_bus (hugemem_ptr_t base, uint32_t size)
 Test the EBI address bus wired to the SRAM. More...
 
static status_code_t ebi_test_data_bus (hugemem_ptr_t base)
 Test the EBI data bus wired to the SRAM. More...
 
static status_code_t ebi_test_data_integrity (hugemem_ptr_t base, uint32_t size)
 Perform a SRAM data integrity test. More...
 
int main (void)
 Main function. More...
 

Variables

static struct ebi_cs_config cs_config
 EBI chip select configuration. More...
 

static status_code_t ebi_test_addr_bus ( hugemem_ptr_t  base,
uint32_t  size 
)
static

Test the EBI address bus wired to the SRAM.

This function will perform an address bus test to locate any shorts or open leads to the SRAM device.

Parameters
baseBase address of the external memory device
sizeSize of the external memory device
Return values
STATUS_OKon success, and status_code_t error code on failure

References ERR_IO_ERROR, hugemem_read8(), hugemem_write8(), and STATUS_OK.

Referenced by main().

static status_code_t ebi_test_data_bus ( hugemem_ptr_t  base)
static

Test the EBI data bus wired to the SRAM.

This function will perform a walking 1s to locate any shorts or open leads to the SRAM device.

Parameters
baseBase address of the external memory device
Return values
STATUS_OKon success, and status_code_t error code on failure

References ERR_IO_ERROR, hugemem_read32(), hugemem_write32(), and STATUS_OK.

Referenced by main().

static status_code_t ebi_test_data_integrity ( hugemem_ptr_t  base,
uint32_t  size 
)
static

Perform a SRAM data integrity test.

This function will perform a SRAM data integrity test by writing 0s and 1s to the entire external device.

Parameters
baseBase address of the external memory device
sizeSize of the external memory device
Return values
STATUS_OKon success, and status_code_t error code on failure

References ERR_IO_ERROR, hugemem_read32(), hugemem_write32(), and STATUS_OK.

Referenced by main().

struct ebi_cs_config cs_config
static

EBI chip select configuration.

This struct holds the configuration for the chip select used to set up the SRAM. The example code will use the EBI helper function to setup the contents before writing the configuration using ebi_cs_write_config().

Referenced by main().