收藏1 举报
void EXTI3_IRQHandler(void) { if(GPIOB->IDR & GPIO_Pin_3) { //高启动定时器,清标准字 PPM_star[1]=TIM_GetCounter(TIM2); } else { PPM_end[1]=TIM_GetCounter(TIM2)-PPM_star[1]; if(PPM_end[1]>900 && PPM_end[1]<2100) {PPMINF[1]=PPM_end[1]-INF_DAT[PPM_mid1];} } EXTI_ClearITPendingBit(EXTI_Line3); } void EXTI4_IRQHandler(void) { if(GPIOB->IDR & GPIO_Pin_4) { //高启动定时器,清标准字 PPM_star[2]=TIM_GetCounter(TIM2); } else { PPM_end[2]=TIM_GetCounter(TIM2)-PPM_star[2]; if(PPM_end[2]>900 && PPM_end[2]<2100) {PPMINF[2]=PPM_end[2]-INF_DAT[PPM_mid2];} } EXTI_ClearITPendingBit(EXTI_Line4); } void EXTI9_5_IRQHandler(void) { if(EXTI_GetITStatus(EXTI_Line5) != RESET) { //高开始计时 //低停止计时 if(GPIOB->IDR & GPIO_Pin_5) { //高启动定时器,清标准字 PPM_star[3]=TIM_GetCounter(TIM2); } else { PPM_end[3]=TIM_GetCounter(TIM2)-PPM_star[3]; if(PPM_end[3]>900 && PPM_end[3]<2100) {PPMINF[3]=PPM_end[3]-INF_DAT[PPM_mid3];} } EXTI_ClearITPendingBit(EXTI_Line5); } if(EXTI_GetITStatus(EXTI_Line8) != RESET) { //高开始计时 //低停止计时 if(GPIOB->IDR & GPIO_Pin_8) { //高启动定时器,清标准字 PPM_star[4]=TIM_GetCounter(TIM2); } else { PPM_end[4]=TIM_GetCounter(TIM2)-PPM_star[4]; if(PPM_end[4]>900 && PPM_end[4]<2100) {PPMINF[4]=PPM_end[4]-INF_DAT[PPM_mid4];} } EXTI_ClearITPendingBit(EXTI_Line8); } if(EXTI_GetITStatus(EXTI_Line9) != RESET) { //高开始计时 //低停止计时 if(GPIOB->IDR & GPIO_Pin_9) { //高启动定时器,清标准字 PPM_star[5]=TIM_GetCounter(TIM2); } else { PPM_end[5]=TIM_GetCounter(TIM2)-PPM_star[5]; if(PPM_end[5]>900 && PPM_end[5]<2100) {PPMINF[5]=PPM_end[5]-INF_DAT[PPM_mid5];} } EXTI_ClearITPendingBit(EXTI_Line9); } } //外部中断 void EXTI15_10_IRQHandler(void) { if(EXTI_GetITStatus(EXTI_Line13) != RESET) { //高开始计时 //低停止计时 if(GPIOC->IDR & GPIO_Pin_13) { //高启动定时器,清标准字 PPM_star[6]=TIM_GetCounter(TIM2); } else { PPM_end[6]=TIM_GetCounter(TIM2)-PPM_star[6]; if(PPM_end[6]>900 && PPM_end[6]<2100) {PPMINF[6]=PPM_end[6]-INF_DAT[PPM_mid6];} } EXTI_ClearITPendingBit(EXTI_Line13); } } 给你个例程看看
yklstudent 发表于 2015-8-24 12:12 STM32F207上试过,调试测路数没有问题,不过频率不要太高
若相依 发表于 2015-8-28 08:55 给你个例程看看
e08610318 发表于 2015-8-24 09:38 1.读datasheet,看看芯片硬件功能是否可以实现 2.考虑软件实现的可能性
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
人才类勋章
发帖类勋章
时间类勋章
等级类勋章
12
139
0
扫码关注 21ic 官方微信
扫码关注嵌入式微处理器
扫码关注电源系统设计
扫码关注21ic项目外包
扫码浏览21ic手机版
本站介绍 | 申请友情链接 | 欢迎投稿 | 隐私声明 | 广告业务 | 网站地图 | 联系我们 | 诚聘英才
京公网安备 11010802024343号