Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Triggering a reset with watchdog timer

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Yokablasta

Bascom Member



Joined: 13 Dec 2017
Posts: 11

PostPosted: Fri Feb 22, 2019 5:45 pm    Post subject: Triggering a reset with watchdog timer Reply with quote

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
View user's profile
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 459

https://www.mcselec.com/c
PostPosted: Fri Feb 22, 2019 7:10 pm    Post subject: Reply with quote

.
Try

Code:
Goto Reset


instead of Watchdog.

E
Back to top
View user's profile
Yokablasta

Bascom Member



Joined: 13 Dec 2017
Posts: 11

PostPosted: Fri Feb 22, 2019 7:20 pm    Post subject: Reply with quote

Thanks! That's a good thing to know about!
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4705
Location: Holland

blank.gif
PostPosted: Fri Feb 22, 2019 9:27 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 459

https://www.mcselec.com/c
PostPosted: Fri Feb 22, 2019 10:01 pm    Post subject: Reply with quote

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
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4705
Location: Holland

blank.gif
PostPosted: Sat Feb 23, 2019 10:07 am    Post subject: Reply with quote

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
View user's profile Visit poster's website
njepsen

Bascom Member



Joined: 13 Aug 2007
Posts: 367

newzealand.gif
PostPosted: Wed Mar 13, 2019 6:34 am    Post subject: Reply with quote

where is the samples folder ? I have searched in vain !!
_________________
Neil
Back to top
View user's profile
Tiny

Bascom Member



Joined: 10 Nov 2010
Posts: 85
Location: The Netherlands

netherlands.gif
PostPosted: Wed Mar 13, 2019 6:41 am    Post subject: Reply with quote

in windows 7 they are in C:\Program Files (x86)\MCS Electronics\BASCOM-AVR\SAMPLES
Back to top
View user's profile Visit poster's website
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 572

poland.gif
PostPosted: Wed Mar 13, 2019 9:41 am    Post subject: Reply with quote

No need to search Very Happy
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum