AtomSoft
Well-Known Member
Code:
;*** Blinky.asm will flash LED 4
;*** Junebug DIP switches 1,2,3 on all others off
list p=18F1320
include <p18f1320.inc>
CONFIG OSC=INTIO2,WDT=ON,WDTPS=256
ORG 0h ; Originin or Start
movlw b'00111111' ; Move Binary 00111111 aka $3F
movwf TRISA ; to TRISA setting the input to all in execpt 7:6
MyTog:
btg LATA,6 ; Toggle bit 6 on/off on LATA (RA6) Which turns on LED4
; (check assembly schem)(7=0 and 6=1) to turn on LED4
bra $ ; Branch to current locataion (endless loop)
END
Ok i commented the above code for me to better understand it. But i still get lost sort of.
blueroomelectronics you said:
"The program is actually depending on the WDT to reboot it about once per second."
i know for the 16F series devices the timing is 1/4 of the clock speed. How about the 18F?
for 16F it would be like:
at 4Mhz = 4,000,000 / 4 / 1,000,000 would equal 1us per instruction cycle.
So how would i calculate the time it would take to be reset by wdt ?
Last edited: