* * @brief Sets IWDG rescaler value. * @param IWDG_Prescaler: specifies the IWDG rescaler value. * This parameter can be one of the following values: * @arg IWDG_Prescaler_4: IWDG prescaler set to 4 * @arg IWDG_Prescaler_8: IWDG prescaler set to 8 * @arg IWDG_Prescaler_16: IWDG prescaler set to 16 * @arg IWDG_Prescaler_32: IWDG prescaler set to 32 * @arg IWDG_Prescaler_64: IWDG prescaler set to 64 * @arg IWDG_Prescaler_128: IWDG prescaler set to 128 * @arg IWDG_Prescaler_256: IWDG prescaler set to 256 #define IWDG_Prescaler_4 ((uint8_t)0x00) #define IWDG_Prescaler_8 ((uint8_t)0x01) #define IWDG_Prescaler_16 ((uint8_t)0x02) #define IWDG_Prescaler_32 ((uint8_t)0x03) #define IWDG_Prescaler_64 ((uint8_t)0x04) #define IWDG_Prescaler_128 ((uint8_t)0x05) #define IWDG_Prescaler_256 ((uint8_t)0x06)
---------------------------------
预分频那块如何求得啊版主?
Tout=((4×2^prer) ×rlr) /40
比如我们设定prer值为4,rlr值为625,那么就可以得到Tout=64×625/40=1000ms,
(4×2^prer)这个公式哪里来的,而且设置prer为4之后,预分频的64得来?
我看手册还有固件库中写的是:
*
* @brief Sets IWDG rescaler value.
* @param IWDG_Prescaler: specifies the IWDG rescaler value.
* This parameter can be one of the following values:
* @arg IWDG_Prescaler_4: IWDG prescaler set to 4
* @arg IWDG_Prescaler_8: IWDG prescaler set to 8
* @arg IWDG_Prescaler_16: IWDG prescaler set to 16
* @arg IWDG_Prescaler_32: IWDG prescaler set to 32
* @arg IWDG_Prescaler_64: IWDG prescaler set to 64
* @arg IWDG_Prescaler_128: IWDG prescaler set to 128
* @arg IWDG_Prescaler_256: IWDG prescaler set to 256
#define IWDG_Prescaler_4 ((uint8_t)0x00)
#define IWDG_Prescaler_8 ((uint8_t)0x01)
#define IWDG_Prescaler_16 ((uint8_t)0x02)
#define IWDG_Prescaler_32 ((uint8_t)0x03)
#define IWDG_Prescaler_64 ((uint8_t)0x04)
#define IWDG_Prescaler_128 ((uint8_t)0x05)
#define IWDG_Prescaler_256 ((uint8_t)0x06)
实在没看懂那个4*2^prer的式子请在指点一下,谢谢
---------------------------------
这个我看了,写入4代表64
我是不明白后面你写的Tout=((4×2^prer) ×rlr) /40
(4×2^prer) 这如何得来64,
谢谢回复
---------------------------------
明白了,明白了,我把……符号搞错了。不好意思啊嘿嘿
注意IWDG在一旦启用,就不能再被关闭!想要关闭,只能重启,并且重启之后不能打开IWDG,否则问题依旧,所以在这里提醒大家,如果不用IWDG的话,就不要去打开它,免得麻烦。
原子哥,IWDG一旦启用就不能被关闭,该怎么理解?
是 只在本程序中不能用软件关闭, 对其它程序没有影响? 还是 IWDG一旦开启了,就一直是开启状态,除非通过“特殊”方法关闭它? 那么怎么关闭呢?
在网上看了一些,说开启了IWDG后,就不能debug, 希望原子哥 详细解释下,谢谢!
一周热门 更多>