|
|
@ -318,18 +318,12 @@ ENDM |
|
|
|
;********************* |
|
|
|
; EQU 7 ;i |
|
|
|
; EQU 6 ;i |
|
|
|
CcomFET EQU 4 ;o |
|
|
|
CpwmFET EQU 5 ;o |
|
|
|
BcomFET EQU 2 ;o |
|
|
|
BpwmFET EQU 3 ;o |
|
|
|
AcomFET EQU 0 ;o |
|
|
|
ApwmFET EQU 1 ;o |
|
|
|
;CcomFET EQU 2 ;o |
|
|
|
;CpwmFET EQU 3 ;o |
|
|
|
;comFET EQU 0 ;o |
|
|
|
;BpwmFET EQU 1 ;o |
|
|
|
;AcomFET EQU 4 ;o |
|
|
|
;ApwmFET EQU 5 ;o |
|
|
|
CcomFET EQU 5 ;o |
|
|
|
CpwmFET EQU 4 ;o |
|
|
|
BcomFET EQU 3 ;o |
|
|
|
BpwmFET EQU 2 ;o |
|
|
|
AcomFET EQU 1 ;o |
|
|
|
ApwmFET EQU 0 ;o |
|
|
|
|
|
|
|
P1_DIGITAL EQU (1 SHL ApwmFET)+(1 SHL BpwmFET)+(1 SHL CpwmFET)+(1 SHL AcomFET)+(1 SHL BcomFET)+(1 SHL CcomFET) |
|
|
|
P1_INIT EQU (1 SHL AcomFET)+(1 SHL BcomFET)+(1 SHL CcomFET) |
|
|
@ -337,92 +331,92 @@ P1_PUSHPULL EQU (1 SHL ApwmFET)+(1 SHL BpwmFET)+(1 SHL CpwmFET)+(1 SHL AcomFET)+ |
|
|
|
P1_SKIP EQU 3Fh |
|
|
|
|
|
|
|
ApwmFET_on MACRO |
|
|
|
clr P1.ApwmFET |
|
|
|
setb P1.ApwmFET |
|
|
|
IF FETON_DELAY == 0 |
|
|
|
clr P1.AcomFET |
|
|
|
ENDIF |
|
|
|
ENDM |
|
|
|
ApwmFET_off MACRO |
|
|
|
IF FETON_DELAY != 0 |
|
|
|
setb P1.ApwmFET |
|
|
|
clr P1.ApwmFET |
|
|
|
ELSE |
|
|
|
setb P1.AcomFET |
|
|
|
setb P1.AcomFET |
|
|
|
ENDIF |
|
|
|
ENDM |
|
|
|
BpwmFET_on MACRO |
|
|
|
clr P1.BpwmFET |
|
|
|
setb P1.BpwmFET |
|
|
|
IF FETON_DELAY == 0 |
|
|
|
clr P1.BcomFET |
|
|
|
clr P1.BcomFET |
|
|
|
ENDIF |
|
|
|
ENDM |
|
|
|
BpwmFET_off MACRO |
|
|
|
IF FETON_DELAY != 0 |
|
|
|
setb P1.BpwmFET |
|
|
|
clr P1.BpwmFET |
|
|
|
ELSE |
|
|
|
setb P1.BcomFET |
|
|
|
setb P1.BcomFET |
|
|
|
ENDIF |
|
|
|
ENDM |
|
|
|
CpwmFET_on MACRO |
|
|
|
clr P1.CpwmFET |
|
|
|
setb P1.CpwmFET |
|
|
|
IF FETON_DELAY == 0 |
|
|
|
clr P1.CcomFET |
|
|
|
clr P1.CcomFET |
|
|
|
ENDIF |
|
|
|
ENDM |
|
|
|
CpwmFET_off MACRO |
|
|
|
IF FETON_DELAY != 0 |
|
|
|
setb P1.CpwmFET |
|
|
|
clr P1.CpwmFET |
|
|
|
ELSE |
|
|
|
setb P1.CcomFET |
|
|
|
setb P1.CcomFET |
|
|
|
ENDIF |
|
|
|
ENDM |
|
|
|
All_pwmFETs_Off MACRO |
|
|
|
IF FETON_DELAY != 0 |
|
|
|
setb P1.ApwmFET |
|
|
|
setb P1.BpwmFET |
|
|
|
setb P1.CpwmFET |
|
|
|
clr P1.ApwmFET |
|
|
|
clr P1.BpwmFET |
|
|
|
clr P1.CpwmFET |
|
|
|
ELSE |
|
|
|
setb P1.AcomFET |
|
|
|
setb P1.BcomFET |
|
|
|
setb P1.CcomFET |
|
|
|
setb P1.AcomFET |
|
|
|
setb P1.BcomFET |
|
|
|
setb P1.CcomFET |
|
|
|
ENDIF |
|
|
|
ENDM |
|
|
|
|
|
|
|
AcomFET_on MACRO |
|
|
|
IF FETON_DELAY == 0 |
|
|
|
setb P1.ApwmFET |
|
|
|
clr P1.ApwmFET |
|
|
|
ENDIF |
|
|
|
clr P1.AcomFET |
|
|
|
clr P1.AcomFET |
|
|
|
ENDM |
|
|
|
AcomFET_off MACRO |
|
|
|
setb P1.AcomFET |
|
|
|
setb P1.AcomFET |
|
|
|
ENDM |
|
|
|
BcomFET_on MACRO |
|
|
|
IF FETON_DELAY == 0 |
|
|
|
setb P1.BpwmFET |
|
|
|
clr P1.BpwmFET |
|
|
|
ENDIF |
|
|
|
clr P1.BcomFET |
|
|
|
clr P1.BcomFET |
|
|
|
ENDM |
|
|
|
BcomFET_off MACRO |
|
|
|
setb P1.BcomFET |
|
|
|
setb P1.BcomFET |
|
|
|
ENDM |
|
|
|
CcomFET_on MACRO |
|
|
|
IF FETON_DELAY == 0 |
|
|
|
setb P1.CpwmFET |
|
|
|
clr P1.CpwmFET |
|
|
|
ENDIF |
|
|
|
clr P1.CcomFET |
|
|
|
clr P1.CcomFET |
|
|
|
ENDM |
|
|
|
CcomFET_off MACRO |
|
|
|
setb P1.CcomFET |
|
|
|
setb P1.CcomFET |
|
|
|
ENDM |
|
|
|
All_comFETs_Off MACRO |
|
|
|
setb P1.AcomFET |
|
|
|
setb P1.BcomFET |
|
|
|
setb P1.CcomFET |
|
|
|
setb P1.AcomFET |
|
|
|
setb P1.BcomFET |
|
|
|
setb P1.CcomFET |
|
|
|
ENDM |
|
|
|
|
|
|
|
Set_Pwm_A MACRO |
|
|
|
IF FETON_DELAY == 0 |
|
|
|
clr P1.AcomFET |
|
|
|
clr P1.AcomFET |
|
|
|
mov P1SKIP, #3Eh |
|
|
|
ELSE |
|
|
|
mov P1SKIP, #3Ch |
|
|
@ -430,7 +424,7 @@ ENDIF |
|
|
|
ENDM |
|
|
|
Set_Pwm_B MACRO |
|
|
|
IF FETON_DELAY == 0 |
|
|
|
clr P1.BcomFET |
|
|
|
clr P1.BcomFET |
|
|
|
mov P1SKIP, #3Bh |
|
|
|
ELSE |
|
|
|
mov P1SKIP, #33h |
|
|
@ -438,7 +432,7 @@ ENDIF |
|
|
|
ENDM |
|
|
|
Set_Pwm_C MACRO |
|
|
|
IF FETON_DELAY == 0 |
|
|
|
clr P1.CcomFET |
|
|
|
clr P1.CcomFET |
|
|
|
mov P1SKIP, #2Fh |
|
|
|
ELSE |
|
|
|
mov P1SKIP, #0Fh |
|
|
|