Zilog ez8 Encore Watchdog sample Code. ASM in C

Status
Not open for further replies.

Holger

Newbie level 3
Joined
Sep 27, 2007
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,319
Can I use this now with the new IDE from Zilog ??? as a asm modul in C .
I cant find a Sample for ez8 Encore ZF8 6422 for WDOG.


; ****************************************
.DEF _set_watch_dog_timer_regs ; Make a <prototype>
segment CODE
; *************************

_set_watch_dog_timer_regs: ; cF1,cF2,cF3
; DI ; No IRQs
PUSH R15 ; push save working reg
PUSH R14 ; push save working reg
LDX R14,XSPH ; save Stack-PointerH to R14
LDX R15,XSPL ; save Stack-PointerL to R15
SUBX XSPL,#%03
SBCX XSPH,#%00
; first load all R0,R1,R2 Registers from C-Stack
LDX R0,4(RR14) ; Register Relativ from R14 to R0 Grab F1 passed 8-Bit parameter
LDX R1,5(RR14) ;Grab F2 passed parameter
LDX R2,6(RR14) ;Grab F3 passed parameter
; unlock
LDX WDTCTL, #%55 ; first Unlock
LDX WDTCTL, #%AA ; second Unlock
; Coseqently store registers
LDX WDTU,R0 ; load in WDT-Upper Reg.
LDX WDTH,R1 ; load in WDT-Higer Reg.
LDX WDTL,R2 ; load in WDT-Lower Reg.
;
LDX XSPL,R15 ; Restore Stack-PointerL from R15
LDX XSPH,R14 ; Restore Stack-PointerH from R14
POP R14
POP R15
; EI
RET


; void set_watch_dog_timer_regs( char, char, char );

; Sample in C Modul set_watch_dog_timer_regs

; set_watch_dog_timer_regs( 0x00, 0x7F, 0xFF );
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…