请教各位,可能是什么原因导致这种错误? 现在时钟是11.0592MHz,没有使用PLL
SMC接口初始化代码如下: void init_io(void) { AT91S_SMC2 *pSMC = AT91C_BASE_SMC;
//--------------------------------------------- // 禁止下列PIOA I/O功能 *AT91C_PIOA_PDR = AT91C_PA0_A0_NBS0 | AT91C_PA1_A1_NBS2 | AT91C_PA2_A2 | AT91C_PA3_A3 | AT91C_PA4_A4 | AT91C_PA5_A5 | AT91C_PA6_A6 | AT91C_PA7_A7 | AT91C_PA8_A8 | AT91C_PA9_A9 | AT91C_PA10_A10 | AT91C_PA11_A11 | AT91C_PA12_A12 | AT91C_PA13_A13 | AT91C_PA14_A14 | AT91C_PA15_A15 | AT91C_PA22_NCS5_CFCE1; // PIOA选择B外设功能 // PIOA0~PIOA15为外部总线地址线 *AT91C_PIOA_BSR = AT91C_PA0_A0_NBS0 | AT91C_PA1_A1_NBS2 | AT91C_PA2_A2 | AT91C_PA3_A3 | AT91C_PA4_A4 | AT91C_PA5_A5 | AT91C_PA6_A6 | AT91C_PA7_A7 | AT91C_PA8_A8 | AT91C_PA9_A9 | AT91C_PA10_A10 | AT91C_PA11_A11 | AT91C_PA12_A12 | AT91C_PA13_A13 | AT91C_PA14_A14 | AT91C_PA15_A15 | AT91C_PA22_NCS5_CFCE1;
// 禁止下列PIOB I/O功能 *AT91C_PIOB_PDR = AT91C_PB20_IRQ0;
// PIOB选择A外设功能 *AT91C_PIOB_BSR = AT91C_PB20_IRQ0;
// 禁止下列PIOC I/O功能 *AT91C_PIOC_PDR = AT91C_PC0_D0 | AT91C_PC1_D1 | AT91C_PC2_D2 | AT91C_PC3_D3 | AT91C_PC4_D4 | AT91C_PC5_D5 | AT91C_PC6_D6 | AT91C_PC7_D7 | AT91C_PC8_D8 | AT91C_PC9_D9 | AT91C_PC10_D10 | AT91C_PC11_D11 | AT91C_PC12_D12 | AT91C_PC13_D13 | AT91C_PC14_D14 | AT91C_PC15_D15 | AT91C_PC16_NWAIT | AT91C_PC21_NWR0_NWE_CFWE | AT91C_PC22_NRD_CFOE;
// PIOC选择A外设功能 // PIOC0~PIOC15为外部总线数据线 *AT91C_PIOC_ASR = AT91C_PC0_D0 | AT91C_PC1_D1 | AT91C_PC2_D2 | AT91C_PC3_D3 | AT91C_PC4_D4 | AT91C_PC5_D5 | AT91C_PC6_D6 | AT91C_PC7_D7 | AT91C_PC8_D8 | AT91C_PC9_D9 | AT91C_PC10_D10 | AT91C_PC11_D11 | AT91C_PC12_D12 | AT91C_PC13_D13 | AT91C_PC14_D14 | AT91C_PC15_D15;
// PIOC选择B外设功能 // PIOC21,PIOC22分别是外部总线写,读信号 *AT91C_PIOC_BSR = AT91C_PC16_NWAIT | AT91C_PC21_NWR0_NWE_CFWE | AT91C_PC22_NRD_CFOE;
pSMC->SMC2_CSR[5] = AT91C_SMC2_BAT;
}
程序中没有除了运行PIT中断没有执行其它功能。
|