今天使用了论坛中的最新IAP程序,见贴, 程序是烧进了芯片,但发现定时器0的中断无法响应?不知何故?
应用程序作了如下修改: [1]linkarm_flash.xcl中 DROMSTART = 0x40000000 改为 0x40004000 [2]71x_init.s中注释了EIC_INIT; [3]在应用程序的初始化程序中加入了如下代码? extern u32 T0TIMI_Addr; u32 * p = (u32 *)& T0TIMI_Addr; u8 bCounter; u32 offset; EIC->ICR = 0x00000000; EIC->IER = 0x00000000; EIC->IPR = 0xFFFFFFFF; EIC->FIR = 0x0000000C; EIC->CIPR = 0x00000000; EIC->IVR = 0xEA000000; for(bCounter = 0; bCounter < 32; bCounter++) { offset = (((*p)&0xffff) + 0x7E0) >> 2; p++; EIC->SIR[bCounter] = offset << 16; } [4]IDE中的设置,生成raw-binary
由于应用程序中参考了AN1799_使用STR71x的通用IO驱动一个4X4的矩阵键盘中的如下代码,是否有影响?
// EIC configuration // Initialize the interrupt controller EIC_Init(); // Set the Timer 0 interrupt channel priority level to 1 EIC_IRQChannelPriorityConfig(T0TIMI_IRQChannel, 1); // Enable the Timer 0 IRQ channel interrupts EIC_IRQChannelConfig(T0TIMI_IRQChannel, ENABLE); // Set the XTI interrupt channel priority level to 2 EIC_IRQChannelPriorityConfig(XTI_IRQChannel, 2); // Enable the XTI IRQ channel interrupts EIC_IRQChannelConfig(XTI_IRQChannel, ENABLE); // Enable IRQ interrupts EIC_IRQConfig(ENABLE);
// Configure the External Interrupt Unit // Initialize the XTI XTI_Init(); // Configure the line 2, 3, 4 and 5 edge. XTI_LineModeConfig(XTI_Line2|XTI_Line3|XTI_Line4|XTI_Line5, XTI_RisingEdge); // Enable the line 2, 3, 4 and 5 interrupt. XTI_LineConfig(XTI_Line2|XTI_Line3|XTI_Line4|XTI_Line5, ENABLE); // Enable Interrupt. XTI_ModeConfig(XTI_Interrupt, ENABLE); // TIM0 configuration // Configure the Prescaler to 0x04 to get an Overflow interrupt every 5.120 ms // This will gives an update rate of 48.8 Hz // Inisialize the Timer 0 TIM_Init( TIM0 ); // Configure the Timer 0 prescaler TIM_PrescalerConfig(TIM0, 0x02); // Enable the Overflow Interrupt TIM_ITConfig(TIM0, TIM_TO_IT, ENABLE); // Start the TIM0 Counter TIM_CounterConfig(TIM0, TIM_START);
|