打印
[PSoC™]

PSoC4100S Plus WatchdogTimer

[复制链接]
131|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
以PSoC4100S Plus 为例的Watchdog Timer:
特点:1:Watchdog的时钟是由ILO生成的LFCLK提供
         2: Free Running(16bit计数器)
         3: 可以周期性的reset芯片
         4:在active,sleep,deepsleep状态下都可以运行
模块框图如下:

1:
上电以后,watchdog的timer counter会一直计数,这个不需要特别的配置,如果需要stop counter计数,那就需要disable ILO,否则counter会一直计数,
但是code可以设置是否会reset芯片。相关寄存器见下面截图:



2:
如果需要使能reset的功能,那就需要在main.c里面调用:
    /* Start the WDT */
    CySysWdtEnable();
如果需要forward这个中断到cpu,需要在main.c里面调用:
    /* Make sure that interrupt is forwarded to the CPU */
            CySysWdtUnmaskInterrupt();
配置寄存器为:

WDT 在counter 匹配(match)到预先设置值得时候,不会清零,所以需要通过递加的方式设置match值:
/* WDT match value is updated in order to obtain periodic interrupts */
           CySysWdtWriteMatch(CySysWdtReadMatch() + iloMatchCounts);
需要及时的处理掉中断标志:
/* Clear the watchdog interrupt */
           CySysWdtClearInterrupt();
        


这些API都可以在对应的工程里面看底层的寄存器配置。

这款芯片除了提供只能由ILO提供时钟的Watchdog Timer,还提供了三个Additional Timer,这个Additional的timer 可以由WCO或者ILO提供时钟。
Additonal的Timer可以配置成free running或者clear on match(configurable period),可以级联成bit位更高的timer,可以生成中断,但是不能复位芯片。



使用特权

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

本版积分规则

认证:
简介:关于英飞凌——我们致力于打造一个更加便利、安全和环保的世界,在赢得自身成功发展的同时,积极践行企业社会责任。

62

主题

140

帖子

3

粉丝