stm32中空闲io口应用外部中断的问题 5
FSMC口接TFT屏后PE4/FSMC_A20、PE5/FSMC_A20、PE6/FSMC_A20这三个io口没有用到,在FSMC端口初始化中也未对这三个口进行操作,现在...
FSMC口接TFT屏后PE4/FSMC_A20、 PE5/FSMC_A20、 PE6/FSMC_A20这三个io口没有用到,在FSMC端口初始化中也未对这三个口进行操作,现在用这三个口用作浮点输入口实现外部中断开关量采集功能,发现在对PE5和PE6的外部中断 EXTI9_5_IRQn 使能后TFT屏就死了,点不动了,而只对PE4的中断使能就没事,程序如下:
NVIC_InitStructure.NVIC_IRQChannel = EXTI4_IRQn; //使能按键所在的外部中断通道
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01; //抢占优先级1
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x02; //子优先级2
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //使能外部中断通道
NVIC_Init(&NVIC_InitStructure); //根据NVIC_InitStruct中指定的参数初始化外设NVIC寄存器
NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQn ; //使能按键所在的外部中断通道
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01; //抢占优先级1,
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x02; //子优先级2
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //使能外部中断通道
NVIC_Init(&NVIC_InitStructure);
多次测试 EXTI9_5_IRQn一ENABLE就不正常,Disable就正常,为何PE4可以开外部中断,PE5和PE6就不行呢? 展开
NVIC_InitStructure.NVIC_IRQChannel = EXTI4_IRQn; //使能按键所在的外部中断通道
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01; //抢占优先级1
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x02; //子优先级2
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //使能外部中断通道
NVIC_Init(&NVIC_InitStructure); //根据NVIC_InitStruct中指定的参数初始化外设NVIC寄存器
NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQn ; //使能按键所在的外部中断通道
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01; //抢占优先级1,
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x02; //子优先级2
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //使能外部中断通道
NVIC_Init(&NVIC_InitStructure);
多次测试 EXTI9_5_IRQn一ENABLE就不正常,Disable就正常,为何PE4可以开外部中断,PE5和PE6就不行呢? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询