1# anji85
#define EXT_SRAM_BASE 0x68000000
#define EXT_FLASH_BASE 0x64000000
#define EXT_RAM_SIZE 0x80000
#define EXT_FLASH_SIZE 0x200000
int main(void)
{
int i;
volatile uint32 *pextram = (uint32 *)EXT_SRAM_BASE;
/* 设置时钟80MHZ */
ROM_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
/*外设配置*/
Peripheral_Init();
while(1){
/*死循环一直写RAM*/
for(i = 0;i < EXT_RAM_SIZE;i++){
*pextram++ = i;
if(i == EXT_RAM_SIZE - 1){
pextram = (uint32 *)EXT_SRAM_BASE;
}
}
}
}
//EPI配置
void EPI_Config(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_EPI0);
GPIOPinConfigure(GPIO_PH3_EPI0S0);
GPIOPinConfigure(GPIO_PH2_EPI0S1);
GPIOPinConfigure(GPIO_PC4_EPI0S2);
GPIOPinConfigure(GPIO_PC5_EPI0S3);
GPIOPinConfigure(GPIO_PC6_EPI0S4);
GPIOPinConfigure(GPIO_PC7_EPI0S5);
GPIOPinConfigure(GPIO_PH0_EPI0S6);
GPIOPinConfigure(GPIO_PH1_EPI0S7);
GPIOPinConfigure(GPIO_PE0_EPI0S8);
GPIOPinConfigure(GPIO_PE1_EPI0S9);
GPIOPinConfigure(GPIO_PH4_EPI0S10);
GPIOPinConfigure(GPIO_PH5_EPI0S11);
GPIOPinConfigure(GPIO_PF4_EPI0S12);
GPIOPinConfigure(GPIO_PG0_EPI0S13);
GPIOPinConfigure(GPIO_PG1_EPI0S14);
GPIOPinConfigure(GPIO_PF5_EPI0S15);
GPIOPinConfigure(GPIO_PJ0_EPI0S16);
GPIOPinConfigure(GPIO_PJ1_EPI0S17);
GPIOPinConfigure(GPIO_PJ2_EPI0S18);
GPIOPinConfigure(GPIO_PJ3_EPI0S19);
GPIOPinConfigure(GPIO_PD2_EPI0S20);
GPIOPinConfigure(GPIO_PD3_EPI0S21);
GPIOPinConfigure(GPIO_PH6_EPI0S26);
GPIOPinConfigure(GPIO_PH7_EPI0S27);
GPIOPinConfigure(GPIO_PJ4_EPI0S28);
GPIOPinConfigure(GPIO_PJ5_EPI0S29);
GPIOPinConfigure(GPIO_PJ6_EPI0S30);
GPIOPinTypeEPI(GPIO_PORTC_BASE, EPI_PORTC_PINS);
GPIOPinTypeEPI(GPIO_PORTD_BASE, EPI_PORTD_PINS);
GPIOPinTypeEPI(GPIO_PORTE_BASE, EPI_PORTE_PINS);
GPIOPinTypeEPI(GPIO_PORTF_BASE, EPI_PORTF_PINS);
GPIOPinTypeEPI(GPIO_PORTG_BASE, EPI_PORTG_PINS);
GPIOPinTypeEPI(GPIO_PORTH_BASE, EPI_PORTH_PINS);
GPIOPinTypeEPI(GPIO_PORTJ_BASE, EPI_PORTJ_PINS);
/*波特率*/
HWREG(EPI0_BASE + EPI_O_BAUD) = 6; /*5MHZ==14*/
/*设置为16位总线模式并启动*/
HWREG(EPI0_BASE + EPI_O_CFG) = EPI_MODE_HB16;
/*配置16位总线工作方式和延时周期*/
HWREG(EPI0_BASE + EPI_O_HB16CFG) = 0x0030FFF0;
HWREG(EPI0_BASE + EPI_O_HB16CFG2) = 0x80000000;
/*外设地址和长度配置*/
HWREG(EPI0_BASE + EPI_O_ADDRMAP) = 0x0000000D;
} |