MPC5604S internal Watchdog

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5604S internal Watchdog

1,007 Views
akhilprasad
Contributor III

I am using MPC5604S. Can anyone provide code for enabling internal watchdog only and i need to load a period of 70%.

0 Kudos
6 Replies

829 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

take a look at attached example.

Regards,

Lukas

0 Kudos

829 Views
akhilprasad
Contributor III

Thank you so much :smileyhappy:.

You have configured it in interrupt mode right ?SWT.CR.R = 0x8000014A;

But i dont want interrupt mode, I want the controller to reset when timeout happens. So I have configured

SWT.CR.R = 0x8000010B. Then I have given period SWT.TO.R =  0x4CCCCCCC. Will this work ? My intention is when the watchdog timer is 70% the controller should reset.

Thanks in advance.

0 Kudos

829 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

SWT.CR.R = 0x8000010B - this is correct.

What do you mean by 70%?

If you set time out to 0x4CCCCCCC then the time out will be 1/128kHz * 0x4CCCCCCC = 10066.3s which is almost 3 hours...

Regards,

Lukas

0 Kudos

829 Views
akhilprasad
Contributor III

Thanks for the input Lukas. 

How can i check whether the counter is running or not ? From datasheet its mentioned that SWT_CO reg will show the downcounter value. 

So what I did is I configured internal watchdog and put a while(1) in main to make the controller to reset.But I couldnt see any update in SWT_CO register. So in the configuration do i need to change anything ? Below is the configuration i did.

SWT.SR.R = 0x0000c520;
SWT.SR.R= 0x0000d928;
SWT.TO.R= 0x4CCCCCCC; /*to get 10ms what value should i load ?*/
SWT.CR.R= 0x8000010B;

-  What value should i load in SWT.TO.R reg to reset the controller if watchdog is not refreshed within 10ms ?

- With this configuration and just disabling the watchdog will I be able to watch the counter running ?

Thanks in advance.

0 Kudos

829 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Be aware that debuggers usually disable the watchdog automatically for debugging purposes. So it is good idea to test this without debugger and measure the timeout by oscilloscope - toggle a pin when you configuring the watchdog and then measure the time to reset assertion...

Lukas

0 Kudos

829 Views
akhilprasad
Contributor III

Ok. But please share your thoughts on the points I mentioned in my previous post.

0 Kudos