WDT not working. Won't reboot software
Moderator: Benj
WDT not working. Won't reboot software
Good day all.
I am trying to use the WDT in a project I'm working on. For some reason I can't get it to work.
Here are the details if any one can help I would much appreciate it thanks in advance.
18LF46k80
19660800
I am trying to use the WDT in a project I'm working on. For some reason I can't get it to work.
Here are the details if any one can help I would much appreciate it thanks in advance.
18LF46k80
19660800
- Attachments
-
- 18LF46K80 Config setup view.doc
- Here is a screen shot of the config setup.
- (466.49 KiB) Downloaded 333 times
Re: WDT not working. Won't reboot software
Hello is anybody out there?
Is this a bug in version 5 that works in version 6?
Is this a bug in version 5 that works in version 6?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: WDT not working. Won't reboot software
Hi Ondra,
In your config settings you have the watchdog disabled. If you need the watchdog to be active in your program then try the "WDT enabled in hardware" setting.
In your config settings you have the watchdog disabled. If you need the watchdog to be active in your program then try the "WDT enabled in hardware" setting.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: WDT not working. Won't reboot software
Thanks Ben.
I did that. Than set the postscaler to 1:4096 which according to the data sheet should work out to about 16 seconds.
I let the device run as per-normal and nothing happens. Shouldn't the device reboot after the WDT times out?
I did that. Than set the postscaler to 1:4096 which according to the data sheet should work out to about 16 seconds.
I let the device run as per-normal and nothing happens. Shouldn't the device reboot after the WDT times out?
- Attachments
-
- 18LF46K80 Config setup WDT view.doc
- Updated file with WDT set
- (273.99 KiB) Downloaded 279 times
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: WDT not working. Won't reboot software
Could you attach your test program so we can take a look at it?
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
Re: WDT not working. Won't reboot software
Thanks Kersing.
I don't have a test program. I am trying to implement this on production code.
From the data sheet. I get that the WDT is independent to any code I write; except
when I stop or start the WD timer and that's if I select to software control the timer.
Aside from that I understand that selecting to enable in hardware; all I have to do is clear
before the timer rolls over and my program will continue uninterrupted.
I have not placed any code to clear the WDT. Shouldn't enabling it in hardware cause my Program to
reboot whenever the timer rolls over. If that is the case, I did enable in hardware for 16 seconds.
My code just continues to run. Any solid trouble shooting tips I could use to get to the bottom of this?
Thanks in advance
I don't have a test program. I am trying to implement this on production code.
From the data sheet. I get that the WDT is independent to any code I write; except
when I stop or start the WD timer and that's if I select to software control the timer.
Aside from that I understand that selecting to enable in hardware; all I have to do is clear
before the timer rolls over and my program will continue uninterrupted.
I have not placed any code to clear the WDT. Shouldn't enabling it in hardware cause my Program to
reboot whenever the timer rolls over. If that is the case, I did enable in hardware for 16 seconds.
My code just continues to run. Any solid trouble shooting tips I could use to get to the bottom of this?
Thanks in advance
-
- Flowcode v5 User
- Posts: 211
- Joined: Tue Feb 19, 2013 9:51 pm
- Has thanked: 72 times
- Been thanked: 177 times
- Contact:
Re: WDT not working. Won't reboot software
I think the wdt postscaler needs to be (divide by 2) to get 16 seconds. Your assuming a wdt timeout will always reset the micro. It might just wake from sleep. So, it is not "independent of any code I write". Some things that will reset the wdt are: sleep, a write to the the clock ircf bits and a clock failure. For trouble shooting, kersing's suggestion might work, just write a test program and run it. If your still having problems, post it and maybe someone can help.
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: WDT not working. Won't reboot software
If you want us to be able to help there are two options:Ondra wrote:I don't have a test program. I am trying to implement this on production code.
- post the production code
- create a test program and post it
Currently I do not have sufficient information and can only guess what might be wrong.
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
Re: WDT not working. Won't reboot software
Good day all. It's been a while since I tackled this issue. I am uploading this code sample in hopes that someone
can figure out why this does not work. I have tried many different combinations but nothing seems to work.
I'm starting to think this is a Flowcode issue.
Thanks in advance for your help.
can figure out why this does not work. I have tried many different combinations but nothing seems to work.
I'm starting to think this is a Flowcode issue.
Thanks in advance for your help.
- Attachments
-
- WDT test file.fcf
- (43.72 KiB) Downloaded 312 times
Re: WDT not working. Won't reboot software
Good day all. I just got a replay from support at microchip.
I sent them a copy of my sample code. The recommendations
they made. I already have setup in PPP. I'm really thinking that
this is a flowcode bug / issue. Can someone please help
with this? Thanks in advance.
Ondra
I sent them a copy of my sample code. The recommendations
they made. I already have setup in PPP. I'm really thinking that
this is a flowcode bug / issue. Can someone please help
with this? Thanks in advance.
Ondra
- Attachments
-
- Microchip WDT Ticket support.txt
- (8.28 KiB) Downloaded 311 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: WDT not working. Won't reboot software
Hello,
In your config settings what happens if you change the watchdog setting from the current
"Controlled by SWDTEN bit"
to the top setting
"Enabled in hardware"
The Microchip example uses the initial setting as they do manipulate the SWDTEN bit in software using this line of code.
In your config settings what happens if you change the watchdog setting from the current
"Controlled by SWDTEN bit"
to the top setting
"Enabled in hardware"
The Microchip example uses the initial setting as they do manipulate the SWDTEN bit in software using this line of code.
Code: Select all
WDTCONbits.SWDTEN = 1;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: WDT not working. Won't reboot software
"Enabled in hardware"
I tried it again and still no reset.
The Program just hangs in the while loop.
Ondra
I tried it again and still no reset.
The Program just hangs in the while loop.
Ondra
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: WDT not working. Won't reboot software
Hello,
I've double checked that the watchdog config settings are being mapped correctly and passed through correctly. Can't see how / why it wouldn't be working unless the device datasheet is wrong.
Have you tried multiple chips? Might the watchdog on the chip your using be damaged or burnt out? Really grasping at straws now but can't see how this problem can be linked to Flowcode. There is so little code to go wrong.
Config2H controls the Watchdog.
1:1 timing and Hardware enabled = 0x03
Config 2H is at address 0x300003
And this is the code Flowcode is generating - #pragma DATA 0x300003, 0x3
Could be a compiler issue but again this is grasping at straws and seems to be working for other config addresses.
I've double checked that the watchdog config settings are being mapped correctly and passed through correctly. Can't see how / why it wouldn't be working unless the device datasheet is wrong.
Have you tried multiple chips? Might the watchdog on the chip your using be damaged or burnt out? Really grasping at straws now but can't see how this problem can be linked to Flowcode. There is so little code to go wrong.
Config2H controls the Watchdog.
1:1 timing and Hardware enabled = 0x03
Config 2H is at address 0x300003
And this is the code Flowcode is generating - #pragma DATA 0x300003, 0x3
Could be a compiler issue but again this is grasping at straws and seems to be working for other config addresses.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: WDT not working. Won't reboot software
Thanks Ben
I got it working. With your confirmation I was forced to look somewhere else.
I unchecked the "use PPP to configure the chip" and instead
used the CCSLoader ICD-U64 programmer application to configure it, and it worked.
I did not think to do this seeing that I have had no problems loading and running the
application in the past.
Many Thanks
Ondra
I got it working. With your confirmation I was forced to look somewhere else.
I unchecked the "use PPP to configure the chip" and instead
used the CCSLoader ICD-U64 programmer application to configure it, and it worked.
I did not think to do this seeing that I have had no problems loading and running the
application in the past.
Many Thanks
Ondra