完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
MCU:STM8S105C6
端口:GPIOB 位:2 GPIOB:2是唯一设置用于外部中断的引脚/位,但无论EXti_CR1中的任何边沿灵敏度设置如何,一旦调用了中断,它就会在输入引脚为低电平时连续调用。由于STM8S似乎没有清除中断标志的寄存器,我错过了什么机制? 其他帖子已经讨论过类似的经历,但在答案中尚无定论。 该项目直接操作寄存器而不是ST的FWLIB。 工作了很多 以上来自于谷歌翻译 以下为原文 MCU: STM8S105C6 Port: GPIOB Bit: 2 GPIOB:2 is the only pin/bit set up for external interrupt, yet regardless of any edge sensitivity setting in EXTI_CR1, once an interrupt is invoked it is continuously invoked while ever the input pin is low. As the STM8S appears to have has no register for clearing an interrupt flag, what mechanism am I missing? Other posts have discussed similar experiences but have not been conclusive in an answer. The project manipulates registers directly rather than through ST's FWLIB. Workalot |
|
相关推荐
6个回答
|
|
嗨,
因为你给我们的信息很少,我只能尝试。 在STM8S系列参考手册中,我在第89页找到了可屏蔽中断源这一章,特别是 外部中断 ..... 当选择连接到同一中断线的多个输入引脚时 同时,它们是逻辑ORed。 当外部电平触发的中断被锁存时,如果给定的电平仍然存在于 在中断程序结束时,中断保持激活状态,除非它已经被激活 在例行程序中失活。 你使用的是电平触发中断吗?如果没有,请提供更多信息。 问候, WoRo 以上来自于谷歌翻译 以下为原文 Hi, as you give us little information, I can only try. In the Reference Manual of the STM8S Family I found on page 89 the chapter maskable interrupt sources and there especially External interrupts ..... When several input pins connected to the same interrupt line are selected simultaneously, they are logically ORed. When external level-triggered interrupts are latched, if the given level is still present at the end of the interrupt routine, the interrupt remains activated except if it has been inactivated in the routine. Are you using level-triggered interrupt? If not, give us more information. Regards, WoRo |
|
|
|
您好WoRo - 感谢您的快速回复。这是回报,快速反应。我明天应该准备一个展示问题的最小项目并发布。
但现在... 虽然EXTI灵敏度是端口宽度(即该端口的所有位),但如果我们有...... GPIOB_CR2 = 0x04; //只有第2位门控通过ITC(图21,第100页) EXTI_CR1 = 0x08; // PBIS = b10 =下降沿 这是不够的,只有bit2可以导致EXTI中断,并且只能在hi到lo边缘执行此操作? 问候 - workalot 以上来自于谷歌翻译 以下为原文 Hello WoRo - thanks for your quick response. This is in return, a quick response. I should my tomorrow prepare a minimal project demonstrating the problem and post it. But for now... While EXTI sensitivity is port wide (that is across all bits of that port), if we have... GPIOB_CR2 = 0x04; // Only bit 2 gated through to the ITC (Fig 21, page 100) EXTI_CR1 = 0x08; // PBIS = b10 = falling edge Is this not enough that only bit2 can cause an EXTI interrupt, and only do so on a hi to lo edge? regards - workalot |
|
|
|
嗨,
您是否考虑过EXTI_CR1的通知? 比特3:2 端口B外部中断灵敏度位 这些位只能在写入时写入 CCR寄存器中的I1和I0都设置为1(级别3)。 否则,您可以保留默认值00:下降和低电平 问候, WoRo 以上来自于谷歌翻译 以下为原文 Hi, Did you consider the notice at EXTI_CR1? Bits 3:2 Port B external interrupt sensitivity bits These bits can only be written when I1 and I0 in the CCR register are both set to 1 (level 3). Otherwise you may keep the default value 00: falling and low level Regards, WoRo |
|
|
|
做了一个基于STVD + Cosmic的小项目,这表明与我之前的说法相矛盾。如果其他人需要确认EXTI正常工作,请包含这些文件。
工作了很多 以上来自于谷歌翻译 以下为原文 Have done a minimal project based on STVD + Cosmic which demonstrates a contradiction to my earlier claim. Have included the files should anyone else need confirmation that EXTI works appropriately. workalot |
|
|
|
|
|
|
|
谢谢,
你的帖子为我节省了很多时间。竖起大拇指! 以上来自于谷歌翻译 以下为原文 Thank You, Your post saved a lot of time to me. Thumbs up! |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2742 浏览 1 评论
3244 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1813 浏览 1 评论
3653 浏览 6 评论
6044 浏览 21 评论
1342浏览 4评论
203浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
356浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
446浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
275浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 12:21 , Processed in 1.425975 second(s), Total 86, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (威廉希尔官方网站 图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号