I am using MPC5604S. Can anyone provide code for enabling internal watchdog only and i need to load a period of 70%.
take a look at attached example.
Thank you so much .
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.
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...
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 ?
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...
Ok. But please share your thoughts on the points I mentioned in my previous post.
Retrieving data ...