本帖最后由 lllaaa 于 2011-10-8 19:39 编辑
我测试出来第一条指令到了20周期了。不知道香水版主能不能帮忙科普一下。
别的不说先上测试代码
void ccc(uint32_t r0, uint32_t r1, uint32_t r2, uint32_t r3)
{
/* 此处由于ABI,寄存器已经被我赋值*/
while(r0);
}
int main(void)
{
/* System clocks configuration ---------------------------------------------*/
RCC_Configuration();
/* GPIO configuration ------------------------------------------------------*/
GPIO_Configuration();
TIM_Configuration();
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource12);
/* Configure EXTI0 line */
EXTI_InitStructure.EXTI_Line = EXTI_Line12;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure);
/* 让r0 r1 r2 r3变成我想要的值,死循环 */
ccc(0x40010808,1<<7,0x40010808,1<<7);
}
然后中断处理程序里第一条指令就是给GPIO置位
ALIGN
EXTI15_10_IRQHandler PROC
EXPORT EXTI15_10_IRQHandler
STR R3, [R2, #8] ;给PA7置1.
但是我量到PA12的上升沿和PA7的上升沿相差了20个周期如图
|