Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/27/00 13:51
Read: times


 
#2370 - RE: how reset hardware with Interrupts?
Assuming the only problem you are protecting against is your program getting lost you could check for a flag being set in the main loop. One of the timers could go off periodically to test to see if the flag has been set. If the flag is not set then timer interrupt jumps to a label at 00H called "reset". You should put any hardware related registers in a known state first.
Example:

cseg

.org 00H
reset:

;Here place your regular startup routine


main:
acall setwatchdogflag
;here do whatever you do
jmp main

timer_interrupt_for_watchdog:
JBC watchdog flag,exit
;Set up all registers and ports the
;way you would want them to be when
;your code restarts
LJMP reset

reti

In using this scheme you have to know that none of your functions will take longer than the timer interrupt used to check the watchdog flag. Main will set the watchdog flag regulary and you will know your program did not go off somewhere it doesn't belong.

Allen

List of 13 messages in thread
TopicAuthorDate
how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      
RE: how reset hardware with Interrupts?            01/01/70 00:00      

Back to Subject List