AVR XMEGA External Bus Interface (EBI) example.
Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | BOARD_EBI_SDRAM_INITDLY (100 * 2 * sysclk_get_per2_hz() / 1000000) |
SDRAM initialization delay in number of CLKper2 cycles (100 us) More... | |
#define | BOARD_EBI_SDRAM_REFRESH (16 * 2 * sysclk_get_per2_hz() / 1000000) |
SDRAM refresh interval in number of CLKper2 cycles (16 us) More... | |
Functions | |
static status_code_t | ebi_test_addr_bus (hugemem_ptr_t base, uint32_t size) |
Test the EBI address bus wired to the SDRAM. More... | |
static status_code_t | ebi_test_data_bus (hugemem_ptr_t base) |
Test the EBI data bus wired to the SDRAM. More... | |
static status_code_t | ebi_test_data_integrity (hugemem_ptr_t base, uint32_t size) |
Perform a SDRAM data integrity test. More... | |
int | main (void) |
Main function. More... | |
Variables | |
static struct ebi_cs_config | cs_config |
EBI chip select configuration. More... | |
static struct ebi_sdram_config | sdram_config |
EBI SDRAM configuration. More... | |
#define BOARD_EBI_SDRAM_INITDLY (100 * 2 * sysclk_get_per2_hz() / 1000000) |
SDRAM initialization delay in number of CLKper2 cycles (100 us)
Referenced by main().
#define BOARD_EBI_SDRAM_REFRESH (16 * 2 * sysclk_get_per2_hz() / 1000000) |
SDRAM refresh interval in number of CLKper2 cycles (16 us)
Referenced by main().
|
static |
Test the EBI address bus wired to the SDRAM.
This function will perform an address bus test to locate any shorts or open leads to the SDRAM device.
base | Base address of the external memory device |
size | Size of the external memory device |
STATUS_OK | on success, and status_code_t error code on failure |
References ERR_IO_ERROR, hugemem_read8(), hugemem_write8(), and STATUS_OK.
Referenced by main().
|
static |
Test the EBI data bus wired to the SDRAM.
This function will perform a walking 1s to locate any shorts or open leads to the SDRAM device.
base | Base address of the external memory device |
STATUS_OK | on success, and status_code_t error code on failure |
References ERR_IO_ERROR, hugemem_read32(), hugemem_write32(), and STATUS_OK.
Referenced by main().
|
static |
Perform a SDRAM data integrity test.
This function will perform a SDRAM data integrity test by writing 0s and 1s to the entire external device.
base | Base address of the external memory device |
size | Size of the external memory device |
STATUS_OK | on success, and status_code_t error code on failure |
References ERR_IO_ERROR, hugemem_read32(), hugemem_write32(), and STATUS_OK.
Referenced by main().
int main | ( | void | ) |
Main function.
References BOARD_EBI_SDRAM_INITDLY, BOARD_EBI_SDRAM_REFRESH, board_init(), cs_config, EBI_CS_ASPACE_8MB_gc, ebi_cs_set_address_size(), ebi_cs_set_base_address(), ebi_cs_set_mode(), ebi_cs_write_config(), ebi_enable_cs(), EBI_PORT_3PORT, EBI_PORT_SDRAM, EBI_SDRAM_CS, ebi_sdram_is_ready(), ebi_sdram_set_cas_latency(), ebi_sdram_set_col_bits(), ebi_sdram_set_initialization_delay(), ebi_sdram_set_mode(), ebi_sdram_set_mode_delay(), ebi_sdram_set_refresh_period(), ebi_sdram_set_row_bits(), ebi_sdram_set_row_cycle_delay(), ebi_sdram_set_row_to_col_delay(), ebi_sdram_set_row_to_precharge_delay(), ebi_sdram_set_self_refresh_to_active_delay(), ebi_sdram_set_write_recovery_delay(), ebi_sdram_write_config(), ebi_setup_port(), ebi_test_addr_bus(), ebi_test_data_bus(), ebi_test_data_integrity(), gpio_set_pin_low, sdram_config, sleepmgr_enter_sleep(), sleepmgr_init(), and sysclk_init().
|
static |
EBI chip select configuration.
This struct holds the configuration for the chip select used to set up the SDRAM. 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().
|
static |
EBI SDRAM configuration.
This struct holds the configuration for the SDRAM. The example code will use the EBI helper function to setup the contents before writing the configuration using ebi_sdram_write_config().
Referenced by main().