_PWM_Update
movfw L_VC0 ; AND all lower 5 bits of vertical counter
andwf L_VC1,W
andwf L_VC2,W
andwf L_VC3,W
andwf L_VC4,W
andwf L_VC5,W
iorwf copyPORTB,F ; then OR bits with copyPORTB lower byte
;
movf H_VC0,W ; AND all higher 5 bits of vertical counter
andwf H_VC1,W
andwf H_VC2,W
andwf H_VC3,W
andwf H_VC4,W
andwf H_VC5,W
iorwf copyPORTA,F ; then OR bits with copyPORTB higher byte
;
movf copyPORTA,W
movwf PORTA
movf copyPORTB,W
movwf PORTB
;
; ----------------------------------------
; Do 2^6 bit lower byte vertical counter
;
_VC64 movf L_VC4,W
andwf L_VC3,W
andwf L_VC2,W
andwf L_VC1,W
andwf L_VC0,W
xorwf L_VC5,F
;
movf L_VC3,W
andwf L_VC2,W
andwf L_VC1,W
andwf L_VC0,W
xorwf L_VC4,F
;
movf L_VC2,W
andwf L_VC1,W
andwf L_VC0,W
xorwf L_VC3,F
;
movf L_VC1,W
andwf L_VC0,W
xorwf L_VC2,F
;
movf L_VC0,W
xorwf L_VC1,F
;
comf L_VC0,F
;
; ----------------------------------------
; Do 2^6 bit higher byte vertical counter
;
movf H_VC4,W
andwf H_VC3,W
andwf H_VC2,W
andwf H_VC1,W
andwf H_VC0,W
xorwf H_VC5,F
;
movf H_VC3,W
andwf H_VC2,W
andwf H_VC1,W
andwf H_VC0,W
xorwf H_VC4,F
;
movf H_VC2,W
andwf H_VC1,W
andwf H_VC0,W
xorwf H_VC3,F
;
movf H_VC1,W
andwf H_VC0,W
xorwf H_VC2,F
;
movf H_VC0,W
xorwf H_VC1,F
;
comf H_VC0,F
;
; ---------------------------------------
decfsz PWM_Count,F ; decrement PWM counter
goto Count_ISR ; return if count != 0
; reset and reload PWM output / counter
movlw .63 ; reload PWM counter
movwf PWM_Count
clrf copyPORTB ; reset output port working variable
clrf copyPORTA ; reset output port working variable
;
movf L_VC0_S,W
movwf L_VC0
movf L_VC0_S,W
movwf L_VC1
movf L_VC0_S,W
movwf L_VC2
movf L_VC0_S,W
movwf L_VC3
movf L_VC0_S,W
movwf L_VC4
movf L_VC0_S,W
movwf L_VC5
;
movf H_VC0_S,W
movwf H_VC0
movf H_VC0_S,W
movwf H_VC1
movf H_VC0_S,W
movwf H_VC2
movf H_VC0_S,W
movwf H_VC3
movf H_VC0_S,W
movwf H_VC4
movf H_VC0_S,W
movwf H_VC5
;
Count_ISR ----
----