diff --git a/Common.inc b/Common.inc index 6db865c..d88bcf1 100644 --- a/Common.inc +++ b/Common.inc @@ -184,9 +184,11 @@ ENDM Clear_COVF_Interrupt MACRO anl PCA0PWM, #0DFh ENDM + Enable_COVF_Interrupt MACRO orl PCA0PWM, #40h ENDM + Disable_COVF_Interrupt MACRO anl PCA0PWM, #0BFh ENDM @@ -195,9 +197,11 @@ ENDM Clear_CCF_Interrupt MACRO anl PCA0CN0, #0FEh ENDM + Enable_CCF_Interrupt MACRO orl PCA0CPM0,#01h ENDM + Disable_CCF_Interrupt MACRO anl PCA0CPM0,#0FEh ENDM @@ -241,5 +245,6 @@ ENDM Set_RPM_Out MACRO ENDM + Clear_RPM_Out MACRO ENDM diff --git a/targets/A.inc b/targets/A.inc index 2249b6e..f62c116 100644 --- a/targets/A.inc +++ b/targets/A.inc @@ -48,11 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/B.inc b/targets/B.inc index fb98b7d..ef43558 100644 --- a/targets/B.inc +++ b/targets/B.inc @@ -49,11 +49,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/Base.inc b/targets/Base.inc index 1cd91ac..e21cf31 100644 --- a/targets/Base.inc +++ b/targets/Base.inc @@ -156,6 +156,7 @@ IF FETON_DELAY == 0 cON P_AcomFET ENDIF ENDM + ApwmFET_off MACRO IF FETON_DELAY != 0 pOFF P_ApwmFET @@ -163,12 +164,14 @@ ELSE cOFF P_AcomFET ENDIF ENDM + BpwmFET_on MACRO pON P_BpwmFET IF FETON_DELAY == 0 cON P_BcomFET ENDIF ENDM + BpwmFET_off MACRO IF FETON_DELAY != 0 pOFF P_BpwmFET @@ -176,12 +179,14 @@ ELSE cOFF P_BcomFET ENDIF ENDM + CpwmFET_on MACRO pON P_CpwmFET IF FETON_DELAY == 0 cON P_CcomFET ENDIF ENDM + CpwmFET_off MACRO IF FETON_DELAY != 0 pOFF P_CpwmFET @@ -189,39 +194,48 @@ ELSE cOFF P_CcomFET ENDIF ENDM + All_pwmFETs_Off MACRO ApwmFET_off BpwmFET_off CpwmFET_off ENDM + + AcomFET_on MACRO IF FETON_DELAY == 0 pOFF P_ApwmFET ENDIF cON P_AcomFET ENDM + AcomFET_off MACRO cOFF P_AcomFET ENDM + BcomFET_on MACRO IF FETON_DELAY == 0 pOFF P_BpwmFET ENDIF cON P_BcomFET ENDM + BcomFET_off MACRO cOFF P_BcomFET ENDM + CcomFET_on MACRO IF FETON_DELAY == 0 pOFF P_CpwmFET ENDIF cON P_CcomFET ENDM + CcomFET_off MACRO cOFF P_CcomFET ENDM + All_comFETs_Off MACRO AcomFET_off BcomFET_off @@ -235,18 +249,25 @@ $if NOT CUSTOM_LED Set_LED_0 MACRO ENDM + Clear_LED_0 MACRO ENDM + Set_LED_1 MACRO ENDM + Clear_LED_1 MACRO ENDM + Set_LED_2 MACRO ENDM + Clear_LED_2 MACRO ENDM + Set_LED_3 MACRO ENDM + Clear_LED_3 MACRO ENDM diff --git a/targets/C.inc b/targets/C.inc index 9decceb..416ba1b 100644 --- a/targets/C.inc +++ b/targets/C.inc @@ -50,11 +50,8 @@ P0_INIT EQU NOT((1 SHL A_pwm) + (1 SHL A_com)) P0_PUSHPULL EQU (1 SHL A_pwm) + (1 SHL A_com) P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 @@ -121,6 +118,7 @@ ELSE mov P1SKIP, #0FFh ENDIF ENDM + Set_Pwm_B MACRO IF FETON_DELAY == 0 cON P_BcomFET @@ -131,6 +129,7 @@ ELSE mov P1SKIP, #(NOT ((1 SHL B_pwm) + (1 SHL B_com))) ENDIF ENDM + Set_Pwm_C MACRO IF FETON_DELAY == 0 cON P_CcomFET @@ -141,6 +140,7 @@ ELSE mov P1SKIP, #(NOT ((1 SHL C_pwm) + (1 SHL C_com))) ENDIF ENDM + Set_Pwms_Off MACRO mov P0SKIP, #0FFh mov P1SKIP, #0FFh diff --git a/targets/D.inc b/targets/D.inc index 5ce8dd7..7303830 100644 --- a/targets/D.inc +++ b/targets/D.inc @@ -48,11 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 0 - - -; Damping noninverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 0 ; Damping non-inverted IF FETON_DELAY == 0 diff --git a/targets/E.inc b/targets/E.inc index 795453f..847f39e 100644 --- a/targets/E.inc +++ b/targets/E.inc @@ -48,11 +48,8 @@ P0_INIT EQU NOT((1 SHL LED_0) + (1 SHL LED_1)) P0_PUSHPULL EQU (1 SHL LED_0) + (1 SHL LED_1) P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 @@ -127,22 +124,29 @@ P2_SKIP EQU 0FFh Set_LED_0 MACRO setb P0.LED_0 ENDM + Clear_LED_0 MACRO clr P0.LED_0 ENDM + Set_LED_1 MACRO setb P0.LED_1 ENDM + Clear_LED_1 MACRO clr P0.LED_1 ENDM + Set_LED_2 MACRO setb P1.LED_2 ENDM + Clear_LED_2 MACRO clr P1.LED_2 ENDM + Set_LED_3 MACRO ENDM + Clear_LED_3 MACRO ENDM diff --git a/targets/F.inc b/targets/F.inc index ea9e853..43aaeab 100644 --- a/targets/F.inc +++ b/targets/F.inc @@ -48,11 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/G.inc b/targets/G.inc index 1c44b11..4252f5d 100644 --- a/targets/G.inc +++ b/targets/G.inc @@ -48,11 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/H.inc b/targets/H.inc index 395a9ab..e55a88e 100644 --- a/targets/H.inc +++ b/targets/H.inc @@ -49,11 +49,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/I.inc b/targets/I.inc index 6472332..9c3d088 100644 --- a/targets/I.inc +++ b/targets/I.inc @@ -48,11 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/J.inc b/targets/J.inc index b280e9b..70a2169 100644 --- a/targets/J.inc +++ b/targets/J.inc @@ -48,11 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU (1 SHL LED_0) + (1 SHL LED_1) + (1 SHL LED_2) P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 @@ -122,22 +119,29 @@ P2_SKIP EQU 0FFh Set_LED_0 MACRO clr P0.LED_0 ENDM + Clear_LED_0 MACRO setb P0.LED_0 ENDM + Set_LED_1 MACRO clr P0.LED_1 ENDM + Clear_LED_1 MACRO setb P0.LED_1 ENDM + Set_LED_2 MACRO clr P0.LED_2 ENDM + Clear_LED_2 MACRO setb P0.LED_2 ENDM + Set_LED_3 MACRO ENDM + Clear_LED_3 MACRO ENDM diff --git a/targets/K.inc b/targets/K.inc index d20ef98..4b7f45c 100644 --- a/targets/K.inc +++ b/targets/K.inc @@ -48,11 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 0 - - -; Damping noninverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 0 ; Damping non-inverted IF FETON_DELAY == 0 diff --git a/targets/L.inc b/targets/L.inc index fb77399..0376a18 100644 --- a/targets/L.inc +++ b/targets/L.inc @@ -48,11 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/M.inc b/targets/M.inc index 7e6831f..0d738df 100644 --- a/targets/M.inc +++ b/targets/M.inc @@ -49,11 +49,8 @@ P0_INIT EQU NOT(1 SHL LED_0) P0_PUSHPULL EQU (1 SHL LED_0) P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 @@ -132,18 +129,25 @@ P2_SKIP EQU 0FFh Set_LED_0 MACRO setb P0.LED_0 ENDM + Clear_LED_0 MACRO - clr P0.LED_0 + clr P0.LED_0 ENDM + Set_LED_1 MACRO ENDM + Clear_LED_1 MACRO ENDM + Set_LED_2 MACRO ENDM + Clear_LED_2 MACRO ENDM + Set_LED_3 MACRO ENDM + Clear_LED_3 MACRO ENDM diff --git a/targets/N.inc b/targets/N.inc index 117800f..7ea0803 100644 --- a/targets/N.inc +++ b/targets/N.inc @@ -49,11 +49,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/O.inc b/targets/O.inc index a44fcee..0a769b0 100644 --- a/targets/O.inc +++ b/targets/O.inc @@ -48,11 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 0 - - -; Damping noninverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 0 ; Damping non-inverted IF FETON_DELAY == 0 diff --git a/targets/P.inc b/targets/P.inc index dc54d12..b6cdbd9 100644 --- a/targets/P.inc +++ b/targets/P.inc @@ -49,11 +49,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/Q.inc b/targets/Q.inc index d7e93a9..ed7292c 100644 --- a/targets/Q.inc +++ b/targets/Q.inc @@ -50,11 +50,8 @@ P0_INIT EQU (1 SHL Rcp_In) P0_PUSHPULL EQU (1 SHL LED_0) + (1 SHL LED_1) + (1 SHL A_pwm) + (1 SHL B_pwm) + (1 SHL C_pwm) P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 @@ -121,6 +118,7 @@ ELSE mov P1SKIP, #(NOT (1 SHL A_com)) ENDIF ENDM + Set_Pwm_B MACRO IF FETON_DELAY == 0 cON P_BcomFET @@ -131,6 +129,7 @@ ELSE mov P1SKIP, #(NOT (1 SHL B_com)) ENDIF ENDM + Set_Pwm_C MACRO IF FETON_DELAY == 0 cON P_CcomFET @@ -141,6 +140,7 @@ ELSE mov P1SKIP, #(NOT (1 SHL C_com)) ENDIF ENDM + Set_Pwms_Off MACRO mov P0SKIP, #0FFh mov P1SKIP, #0FFh @@ -167,20 +167,27 @@ P2_SKIP EQU 0FFh Set_LED_0 MACRO setb P0.LED_0 ENDM + Clear_LED_0 MACRO clr P0.LED_0 ENDM + Set_LED_1 MACRO setb P0.LED_1 ENDM + Clear_LED_1 MACRO clr P0.LED_1 ENDM + Set_LED_2 MACRO ENDM + Clear_LED_2 MACRO ENDM + Set_LED_3 MACRO ENDM + Clear_LED_3 MACRO ENDM diff --git a/targets/R.inc b/targets/R.inc index dd0ed48..113e921 100644 --- a/targets/R.inc +++ b/targets/R.inc @@ -48,11 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/S.inc b/targets/S.inc index 3e954a6..8e3752a 100644 --- a/targets/S.inc +++ b/targets/S.inc @@ -48,10 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/T.inc b/targets/T.inc index 1fe5de6..de1310b 100644 --- a/targets/T.inc +++ b/targets/T.inc @@ -49,11 +49,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 diff --git a/targets/U.inc b/targets/U.inc index dc7994c..5ad6297 100644 --- a/targets/U.inc +++ b/targets/U.inc @@ -49,11 +49,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU (1 SHL LED_0) + (1 SHL LED_1) + (1 SHL LED_2) P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 @@ -132,23 +129,29 @@ P2_SKIP EQU 0FFh Set_LED_0 MACRO clr P0.LED_0 ENDM + Clear_LED_0 MACRO setb P0.LED_0 ENDM + Set_LED_1 MACRO clr P0.LED_1 ENDM + Clear_LED_1 MACRO setb P0.LED_1 ENDM + Set_LED_2 MACRO clr P0.LED_2 ENDM + Clear_LED_2 MACRO setb P0.LED_2 ENDM + Set_LED_3 MACRO ENDM + Clear_LED_3 MACRO ENDM - diff --git a/targets/V.inc b/targets/V.inc index 08f21cd..1535c50 100644 --- a/targets/V.inc +++ b/targets/V.inc @@ -50,11 +50,8 @@ P0_INIT EQU NOT(1 SHL C_com) P0_PUSHPULL EQU (1 SHL C_com) P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 1 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm noninverted +PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0 @@ -121,6 +118,7 @@ ELSE mov P1SKIP, #(NOT ((1 SHL A_pwm) + (1 SHL A_com))) ENDIF ENDM + Set_Pwm_B MACRO IF FETON_DELAY == 0 cON P_BcomFET @@ -131,6 +129,7 @@ ELSE mov P1SKIP, #(NOT ((1 SHL B_pwm) + (1 SHL B_com))) ENDIF ENDM + Set_Pwm_C MACRO IF FETON_DELAY == 0 cON P_CcomFET @@ -141,6 +140,7 @@ ELSE mov P1SKIP, #(NOT (1 SHL C_pwm)) ENDIF ENDM + Set_Pwms_Off MACRO mov P0SKIP, #0FFh mov P1SKIP, #0FFh diff --git a/targets/W.inc b/targets/W.inc index 78b0581..3462ba7 100644 --- a/targets/W.inc +++ b/targets/W.inc @@ -107,23 +107,29 @@ ApwmFET_on MACRO setb P1.A_pwm ; set pin to high orl P1MDIN, #(1 SHL A_pwm) ; enable pin driver ENDM + ApwmFET_off MACRO anl P1MDIN, #(NOT(1 SHL A_pwm)) ; analog in -> pullup, driver and digital in is disable = floating ENDM + BpwmFET_on MACRO setb P1.B_pwm ; set pin to high orl P1MDIN, #(1 SHL B_pwm) ; enable pin driver ENDM + BpwmFET_off MACRO anl P1MDIN, #(NOT(1 SHL B_pwm)) ; analog in -> pullup, driver and digital in is disable = floating ENDM + CpwmFET_on MACRO setb P1.C_pwm ; set pin to high orl P1MDIN, #(1 SHL C_pwm) ; enable pin driver ENDM + CpwmFET_off MACRO anl P1MDIN, #(NOT(1 SHL C_pwm)) ; analog in -> pullup, driver and digital in is disable = floating ENDM + All_pwmFETs_Off MACRO anl P1MDIN, #(NOT((1 SHL A_pwm) + (1 SHL B_pwm) + (1 SHL C_pwm))) ; analog in -> pullup, driver and digital in is disable = floating ENDM @@ -132,38 +138,48 @@ AcomFET_on MACRO clr P1.A_pwm ; set pin to low orl P1MDIN, #(1 SHL A_pwm) ; enable pin driver ENDM + AcomFET_off MACRO anl P1MDIN, #(NOT(1 SHL A_pwm)) ; analog in -> pullup, driver and digital in is disable = floating ENDM + BcomFET_on MACRO clr P1.B_pwm ; set pin to low orl P1MDIN, #(1 SHL B_pwm) ; enable pin driver ENDM + BcomFET_off MACRO anl P1MDIN, #(NOT(1 SHL B_pwm)) ; analog in -> pullup, driver and digital in is disable = floating ENDM + CcomFET_on MACRO clr P1.C_pwm ; set pin to low orl P1MDIN, #(1 SHL C_pwm) ; enable pin driver ENDM + CcomFET_off MACRO anl P1MDIN, #(NOT(1 SHL C_pwm)) ; analog in -> pullup, driver and digital in is disable = floating ENDM + All_comFETs_Off MACRO anl P1MDIN, #(NOT((1 SHL A_pwm) + (1 SHL B_pwm) + (1 SHL C_pwm))) ; analog in -> pullup, driver and digital in is disable = floating ENDM + Set_Pwm_A MACRO mov P1SKIP, #(NOT(1 SHL A_pwm)); orl P1MDIN, #(1 SHL A_pwm) ; enable pin driver ENDM + Set_Pwm_B MACRO mov P1SKIP, #(NOT(1 SHL B_pwm)); orl P1MDIN, #(1 SHL B_pwm) ; enable pin driver ENDM + Set_Pwm_C MACRO mov P1SKIP, #(NOT(1 SHL C_pwm)); orl P1MDIN, #(1 SHL C_pwm) ; enable pin driver ENDM + Set_Pwms_Off MACRO mov P1SKIP, #P1_SKIP; ENDM @@ -209,17 +225,24 @@ ENDM Set_LED_0 MACRO ENDM + Clear_LED_0 MACRO ENDM + Set_LED_1 MACRO ENDM + Clear_LED_1 MACRO ENDM + Set_LED_2 MACRO ENDM + Clear_LED_2 MACRO ENDM + Set_LED_3 MACRO ENDM + Clear_LED_3 MACRO ENDM diff --git a/targets/Z.inc b/targets/Z.inc index 7f8a29b..c035d01 100644 --- a/targets/Z.inc +++ b/targets/Z.inc @@ -48,11 +48,8 @@ P0_INIT EQU 0FFh P0_PUSHPULL EQU 0 P0_SKIP EQU 0FFh -PWM_ACTIVE_HIGH EQU 0 -COMPWM_ACTIVE_HIGH EQU 1 - - -; Damping inverted, pwm inverted +PWM_ACTIVE_HIGH EQU 0 ; Pwm inverted +COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted IF FETON_DELAY == 0