cancel
Showing results for 
Search instead for 
Did you mean: 

WDG, free runing timer

popov2004
Associate II
Posted on September 28, 2007 at 14:37

WDG, free runing timer

2 REPLIES 2
popov2004
Associate II
Posted on September 28, 2007 at 07:25

Hi All,

I am using the WDG free runing timer mode in order to make the couter counting 5s.

I would like to print (begining) continue executing the programm, after 5 second print( END ).

with out stopping executing the program.

here is the code, could any one tell me where is the problem ?

printf(''\r\n Beginning ***************************'');

WDG_ECITConfig (ENABLE);

WDG_CntOnOffConfig (ENABLE);

WDG_PeriodValueConfig (5000000); /* 5 s*/

/* EIC peripheral configuration -------------------------------------------*/

EIC_IRQChannelPriorityConfig(WDG_IRQChannel, 1);

EIC_IRQChannelConfig(WDG_IRQChannel, ENABLE);

EIC_IRQConfig(ENABLE);

hStatus = WDG_ECStatus();

if (hStatus==1){

printf(''\r\n END ***********************\r\n'');

WDG_ECFlagClear();

}

kleshov
Associate II
Posted on September 28, 2007 at 14:37

Without trying to check if initialization sequence is correct, I can point out two things. First, do you need the watchdog interrupt for this? Seems not. Second, surely you should use a loop to check if the timer has expired, rather than an 'if' statement?

while (WDG_ECStatus() != 1) { /* empty */ }

printf(''whatever...'');