打印
[STM8]

tim1总是进不了中断,查不出问题???

[复制链接]
1684|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
tim1总是进不了中断,我用LED检测能不能进入中断,1MS进一次中断,但是LED总是不亮????

微信截图_20171215211547.png (11.87 KB )

微信截图_20171215211547.png

微信截图_20171215211648.png (14.53 KB )

微信截图_20171215211648.png
沙发
香水城| | 2017-12-18 16:39 | 只看该作者
注意中断矢量表里对应位置别错位了,就下面这个表,否则中断发生时就不知跳到哪里去了。

struct interrupt_vector const _vectab[] = {
  {0x82, (interrupt_handler_t)_stext}, /* RESET */
  {0x82, (interrupt_handler_t)TRAP_IRQHandler}, /* TRAP - Software interrupt */
        {0x82, (interrupt_handler_t)TLI_IRQHandler}, /* irq0 - External Top Level interrupt (TLI) */
        {0x82, (interrupt_handler_t)AWU_IRQHandler}, /* irq1 - Auto Wake Up from Halt interrupt */
。。。。。。
#if defined(STM8S208) || defined(STM8AF52Ax)
        {0x82, (interrupt_handler_t)CAN_RX_IRQHandler}, /* irq8 - CAN Rx interrupt */
        {0x82, (interrupt_handler_t)CAN_TX_IRQHandler}, /* irq9 - CAN Tx/ER/SC interrupt */
#elif defined(STM8S903) || defined(STM8AF622x)
        {0x82, (interrupt_handler_t)EXTI_PORTF_IRQHandler}, /* irq8 - External interrupt 5 (GPIOF) */
        {0x82, (interrupt_handler_t)NonHandledInterrupt}, /* irq9 - Reserved */
#else /*STM8S207, STM8S105 or STM8AF62Ax or STM8AF626x*/
        {0x82, (interrupt_handler_t)NonHandledInterrupt}, /* irq8 - Reserved */
        {0x82, (interrupt_handler_t)NonHandledInterrupt}, /* irq9 - Reserved */
#endif /* STM8S208 or STM8AF52Ax */
        {0x82, (interrupt_handler_t)SPI_IRQHandler}, /* irq10 - SPI End of transfer interrupt */
        {0x82, (interrupt_handler_t)TIM1_UPD_OVF_TRG_BRK_IRQHandler}, /* irq11 - TIM1 Update/Overflow/Trigger/Break interrupt */
        {0x82, (interrupt_handler_t)TIM1_CAP_COM_IRQHandler}, /* irq12 - TIM1 Capture/Compare interrupt */
  。。。。。。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

37

主题

65

帖子

0

粉丝