View previous topic :: View next topic |
Author |
Message |
Yokablasta
Joined: 13 Dec 2017 Posts: 19
|
Posted: Fri Feb 22, 2019 5:45 pm Post subject: Triggering a reset with watchdog timer |
|
|
Hello,
I am trying to get a bootloader program to install and run 2 bits of application code consecutively. I'd like to use a watchdog timer to trigger a reset, but I seem to be doing it wrong. I'm using an Atmega128. What I've done is written
Config Watchdog = 1024
Start Watchdog
at the end of the first application, in hopes that it would trigger a reset. So far it's not working. Is there a flag or something I should be checking to get the WDT to trigger a reset? Any help would be appreciated. Best,
-R
(BASCOM-AVR version : 2.0.8.1 ) |
|
Back to top |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Fri Feb 22, 2019 7:10 pm Post subject: |
|
|
.
Try
instead of Watchdog.
E |
|
Back to top |
|
|
Yokablasta
Joined: 13 Dec 2017 Posts: 19
|
Posted: Fri Feb 22, 2019 7:20 pm Post subject: |
|
|
Thanks! That's a good thing to know about! |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Feb 22, 2019 9:27 pm Post subject: |
|
|
i also use the WD to get a reset in some apps.
so it should work.
I advise to check out the WATCHD.BAS sample from the samples folder. _________________ Mark |
|
Back to top |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Fri Feb 22, 2019 10:01 pm Post subject: |
|
|
Hi Mark,
I may be making an error, but when Watchdog is triggered from a Bootloader, the uC will restart from the Boot Vector and execute the Bootloader again - and not the Main program?
E |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat Feb 23, 2019 10:07 am Post subject: |
|
|
when the WD times out it generates a reset.
It depends on the fuse settings if the Boot vector or the reset vector will be executed. _________________ Mark |
|
Back to top |
|
|
njepsen
Joined: 13 Aug 2007 Posts: 469
|
Posted: Wed Mar 13, 2019 6:34 am Post subject: |
|
|
where is the samples folder ? I have searched in vain !! _________________ Neil |
|
Back to top |
|
|
Tiny
Joined: 10 Nov 2010 Posts: 101 Location: The Netherlands
|
Posted: Wed Mar 13, 2019 6:41 am Post subject: |
|
|
in windows 7 they are in C:\Program Files (x86)\MCS Electronics\BASCOM-AVR\SAMPLES |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 971
|
Posted: Wed Mar 13, 2019 9:41 am Post subject: |
|
|
No need to search
|
|
Back to top |
|
|
|