Browse Source

docs: Rename pwm phase macros

main
Mathias Rasmussen 4 years ago
parent
commit
2b66e93d99
  1. 28
      Bluejay.asm
  2. 8
      Layouts/Base.inc
  3. 8
      Layouts/C.inc
  4. 8
      Layouts/Q.inc
  5. 8
      Layouts/V.inc
  6. 8
      Layouts/W.inc

28
Bluejay.asm

@ -1445,7 +1445,7 @@ led_3_done:
switch_power_off:
All_Pwm_Fets_Off ; Turn off all pwm fets
All_Com_Fets_Off ; Turn off all commutation fets
Set_Pwms_Off
Set_All_Pwm_Phases_Off
ret
@ -2419,7 +2419,7 @@ wait_for_comm:
jc wait_for_comm_wait ; Cut power if many consecutive demags. This will help retain sync during hard accelerations
All_Pwm_Fets_Off
Set_Pwms_Off
Set_All_Pwm_Phases_Off
wait_for_comm_wait:
Wait_For_Timer3
@ -2446,7 +2446,7 @@ comm1_comm2: ; C->A
clr IE_EA
B_Com_Fet_Off
A_Com_Fet_On
Set_Pwm_C ; Reapply power after a demag cut
Set_Pwm_Phase_C ; Reapply power after a demag cut
setb IE_EA
Set_Comparator_Phase_B
ret
@ -2455,7 +2455,7 @@ comm1_comm2_rev: ; A->C
clr IE_EA
B_Com_Fet_Off
C_Com_Fet_On
Set_Pwm_A ; Reapply power after a demag cut
Set_Pwm_Phase_A ; Reapply power after a demag cut
setb IE_EA
Set_Comparator_Phase_B
ret
@ -2466,7 +2466,7 @@ comm2_comm3: ; B->A
clr IE_EA
C_Pwm_Fet_Off ; Turn off pwm fet (Necessary for EN/PWM driver)
Set_Pwm_B
Set_Pwm_Phase_B
A_Com_Fet_On ; Reapply power after a demag cut (Necessary for EN/PWM driver)
setb IE_EA
Set_Comparator_Phase_C
@ -2475,7 +2475,7 @@ comm2_comm3: ; B->A
comm2_comm3_rev: ; B->C
clr IE_EA
A_Pwm_Fet_Off ; Turn off pwm fet (Necessary for EN/PWM driver)
Set_Pwm_B
Set_Pwm_Phase_B
C_Com_Fet_On ; Reapply power after a demag cut (Necessary for EN/PWM driver)
setb IE_EA
Set_Comparator_Phase_A
@ -2488,7 +2488,7 @@ comm3_comm4: ; B->C
clr IE_EA
A_Com_Fet_Off
C_Com_Fet_On
Set_Pwm_B ; Reapply power after a demag cut
Set_Pwm_Phase_B ; Reapply power after a demag cut
setb IE_EA
Set_Comparator_Phase_A
ret
@ -2497,7 +2497,7 @@ comm3_comm4_rev: ; B->A
clr IE_EA
C_Com_Fet_Off
A_Com_Fet_On
Set_Pwm_B ; Reapply power after a demag cut
Set_Pwm_Phase_B ; Reapply power after a demag cut
setb IE_EA
Set_Comparator_Phase_C
ret
@ -2508,7 +2508,7 @@ comm4_comm5: ; A->C
clr IE_EA
B_Pwm_Fet_Off ; Turn off pwm fet (Necessary for EN/PWM driver)
Set_Pwm_A
Set_Pwm_Phase_A
C_Com_Fet_On ; Reapply power after a demag cut (Necessary for EN/PWM driver)
setb IE_EA
Set_Comparator_Phase_B
@ -2517,7 +2517,7 @@ comm4_comm5: ; A->C
comm4_comm5_rev: ; C->A
clr IE_EA
B_Pwm_Fet_Off ; Turn off pwm fet (Necessary for EN/PWM driver)
Set_Pwm_C
Set_Pwm_Phase_C
A_Com_Fet_On ; Reapply power after a demag cut (Necessary for EN/PWM driver)
setb IE_EA
Set_Comparator_Phase_B
@ -2530,7 +2530,7 @@ comm5_comm6: ; A->B
clr IE_EA
C_Com_Fet_Off
B_Com_Fet_On
Set_Pwm_A ; Reapply power after a demag cut
Set_Pwm_Phase_A ; Reapply power after a demag cut
setb IE_EA
Set_Comparator_Phase_C
ret
@ -2539,7 +2539,7 @@ comm5_comm6_rev: ; C->B
clr IE_EA
A_Com_Fet_Off
B_Com_Fet_On
Set_Pwm_C ; Reapply power after a demag cut
Set_Pwm_Phase_C ; Reapply power after a demag cut
setb IE_EA
Set_Comparator_Phase_A
ret
@ -2550,7 +2550,7 @@ comm6_comm1: ; C->B
clr IE_EA
A_Pwm_Fet_Off ; Turn off pwm fet (Necessary for EN/PWM driver)
Set_Pwm_C
Set_Pwm_Phase_C
B_Com_Fet_On ; Reapply power after a demag cut (Necessary for EN/PWM driver)
setb IE_EA
Set_Comparator_Phase_A
@ -2559,7 +2559,7 @@ comm6_comm1: ; C->B
comm6_comm1_rev: ; A->B
clr IE_EA
C_Pwm_Fet_Off ; Turn off pwm fet (Necessary for EN/PWM driver)
Set_Pwm_A
Set_Pwm_Phase_A
B_Com_Fet_On ; Reapply power after a demag cut (Necessary for EN/PWM driver)
setb IE_EA
Set_Comparator_Phase_C

8
Layouts/Base.inc

@ -177,7 +177,7 @@ P_B_Com EQU P1.B_Com
P_C_Pwm EQU P1.C_Pwm
P_C_Com EQU P1.C_Com
Set_Pwm_A MACRO
Set_Pwm_Phase_A MACRO
IF DEADTIME == 0
cON P_A_Com
mov P1SKIP, #(NOT (1 SHL A_Pwm))
@ -186,7 +186,7 @@ ELSE
ENDIF
ENDM
Set_Pwm_B MACRO
Set_Pwm_Phase_B MACRO
IF DEADTIME == 0
cON P_B_Com
mov P1SKIP, #(NOT (1 SHL B_Pwm))
@ -195,7 +195,7 @@ ELSE
ENDIF
ENDM
Set_Pwm_C MACRO
Set_Pwm_Phase_C MACRO
IF DEADTIME == 0
cON P_C_Com
mov P1SKIP, #(NOT (1 SHL C_Pwm))
@ -204,7 +204,7 @@ ELSE
ENDIF
ENDM
Set_Pwms_Off MACRO
Set_All_Pwm_Phases_Off MACRO
mov P1SKIP, #0FFh
ENDM

8
Layouts/C.inc

@ -108,7 +108,7 @@ P_B_Com EQU P1.B_Com
P_C_Pwm EQU P1.C_Pwm
P_C_Com EQU P1.C_Com
Set_Pwm_A MACRO
Set_Pwm_Phase_A MACRO
IF DEADTIME == 0
cON P_A_Com
mov P0SKIP, #(NOT (1 SHL A_Pwm))
@ -119,7 +119,7 @@ ELSE
ENDIF
ENDM
Set_Pwm_B MACRO
Set_Pwm_Phase_B MACRO
IF DEADTIME == 0
cON P_B_Com
mov P0SKIP, #0FFh
@ -130,7 +130,7 @@ ELSE
ENDIF
ENDM
Set_Pwm_C MACRO
Set_Pwm_Phase_C MACRO
IF DEADTIME == 0
cON P_C_Com
mov P0SKIP, #0FFh
@ -141,7 +141,7 @@ ELSE
ENDIF
ENDM
Set_Pwms_Off MACRO
Set_All_Pwm_Phases_Off MACRO
mov P0SKIP, #0FFh
mov P1SKIP, #0FFh
ENDM

8
Layouts/Q.inc

@ -108,7 +108,7 @@ P_B_Com EQU P1.B_Com
P_C_Pwm EQU P0.C_Pwm
P_C_Com EQU P1.C_Com
Set_Pwm_A MACRO
Set_Pwm_Phase_A MACRO
IF DEADTIME == 0
cON P_A_Com
mov P0SKIP, #(NOT (1 SHL A_Pwm))
@ -119,7 +119,7 @@ ELSE
ENDIF
ENDM
Set_Pwm_B MACRO
Set_Pwm_Phase_B MACRO
IF DEADTIME == 0
cON P_B_Com
mov P0SKIP, #(NOT (1 SHL B_Pwm))
@ -130,7 +130,7 @@ ELSE
ENDIF
ENDM
Set_Pwm_C MACRO
Set_Pwm_Phase_C MACRO
IF DEADTIME == 0
cON P_C_Com
mov P0SKIP, #(NOT (1 SHL C_Pwm))
@ -141,7 +141,7 @@ ELSE
ENDIF
ENDM
Set_Pwms_Off MACRO
Set_All_Pwm_Phases_Off MACRO
mov P0SKIP, #0FFh
mov P1SKIP, #0FFh
ENDM

8
Layouts/V.inc

@ -108,7 +108,7 @@ P_B_Com EQU P1.B_Com
P_C_Pwm EQU P1.C_Pwm
P_C_Com EQU P0.C_Com
Set_Pwm_A MACRO
Set_Pwm_Phase_A MACRO
IF DEADTIME == 0
cON P_A_Com
mov P0SKIP, #0FFh
@ -119,7 +119,7 @@ ELSE
ENDIF
ENDM
Set_Pwm_B MACRO
Set_Pwm_Phase_B MACRO
IF DEADTIME == 0
cON P_B_Com
mov P0SKIP, #0FFh
@ -130,7 +130,7 @@ ELSE
ENDIF
ENDM
Set_Pwm_C MACRO
Set_Pwm_Phase_C MACRO
IF DEADTIME == 0
cON P_C_Com
mov P0SKIP, #0FFh
@ -141,7 +141,7 @@ ELSE
ENDIF
ENDM
Set_Pwms_Off MACRO
Set_All_Pwm_Phases_Off MACRO
mov P0SKIP, #0FFh
mov P1SKIP, #0FFh
ENDM

8
Layouts/W.inc

@ -151,22 +151,22 @@ All_Com_Fets_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
Set_Pwm_Phase_A MACRO
mov P1SKIP, #(NOT(1 SHL A_Pwm));
orl P1MDIN, #(1 SHL A_Pwm) ; enable pin driver
ENDM
Set_Pwm_B MACRO
Set_Pwm_Phase_B MACRO
mov P1SKIP, #(NOT(1 SHL B_Pwm));
orl P1MDIN, #(1 SHL B_Pwm) ; enable pin driver
ENDM
Set_Pwm_C MACRO
Set_Pwm_Phase_C MACRO
mov P1SKIP, #(NOT(1 SHL C_Pwm));
orl P1MDIN, #(1 SHL C_Pwm) ; enable pin driver
ENDM
Set_Pwms_Off MACRO
Set_All_Pwm_Phases_Off MACRO
mov P1SKIP, #P1_SKIP;
ENDM

Loading…
Cancel
Save