cancel
Showing results for 
Search instead for 
Did you mean: 

Period of IWDG issue.

zsu
Associate II
Posted on December 09, 2009 at 09:48

Period of IWDG issue.

3 REPLIES 3
zsu
Associate II
Posted on May 17, 2011 at 15:04

Default period of IWDG is about 15.90 ms. I try to change it to 63.70 ms by using instruction below. But it does not work. Its period keeps at 15.90 ms.

Any trick ? Your help will be appreciated.

During debugging, IWDG_PR keeps zero (default value).

IWDG_KR = 0x55 ; // Enable access to IWDG_PR and IWDG_RLR

IWDG_PR = 0x02 ; // divide by 16.

IWDG_RLR= 0xff ; // Time-out period at about 63.7ms.

zsu
Associate II
Posted on May 17, 2011 at 15:04

Solved. There is a trick.

If you use instruction in order as below, it doesn't work.

IWDG_KR = 0x55 ; // Enable access to IWDG_PR and IWDG_RLR

IWDG_PR = 0x02 ; // divide by 16.

IWDG_RLR= 0xff ; // Time-out period at about 63.7ms.

IWDG_KR = 0xcc ; // Start IWDG.

To make it work, you have to put instructions in order as below.

IWDG_KR = 0xcc ; // Start IWDG.

IWDG_KR = 0x55 ; // Enable access to IWDG_PR and IWDG_RLR

IWDG_PR = 0x02 ; // divide by 16.

IWDG_RLR= 0xff ; // Time-out period at about 63.7ms.

:p

baroudi
Associate II
Posted on May 17, 2011 at 15:04

Hi zsu,

I think you should add

IWDG_KR = 0x55 ; start the IWDG

after

IWDG_RLR= 0xff ; // Time-out period at about 63.7ms.

I think IWDG_KR = 0x55 ;doesn't start the IWDG but It enables access to

RLR and PR registers.

Let me know if you have some news.

With regards,