AN2839 Freescale Semiconductor / Motorola, AN2839 Datasheet - Page 17

no-image

AN2839

Manufacturer Part Number
AN2839
Description
Implementing a Lamp Dimmer with an HC908Q Family MCU
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Waitpta0:
Next:
Waitpta:
Next1:
IncT:
DecT:
;**** Interrupt Vectors ***********
END
Freescale Semiconductor
nop
brclr PTA0,PTA,Waitpta0
brclr
brclr
mov
jsr
jsr
nop
brset
mov
jsr
jsr
bra
jsr
cpx
beq
jsr
bra
jsr
cpx
beq
jsr
bra
org
dcw
#StartTim,TSC
TOverflow
Gate
#StartTim,TSC ;Start the timer
TOverflow
Gate
Waitpta0
Delay
#IncTcomp
Next
IncTimer
Next
Delay
#DecTcomp
Next
DecTimer
Next
PTA5,PTA,IncT ;Inc timer if PTA5 is clear
PTA4,PTA,DecT ;Dec timer if PTA4 is clear
PTA0,PTA,Waitpta
$FFFE
main
Implementing a Lamp Dimmer with an HC908Q Family MCU, Rev. 0
;Go to Timer Overflow subroutine
;Go to Gate subroutine
;Go to Timer Overflow subroutine
;Go to Gate subroutine
;Start the timer
;Wait for a edge on PTA0 (Zero crossing)
;Wait for a edge on PTA0 (Zero crossing)
Software Description
17

Related parts for AN2839