Hi,
In the PWMDRV_1ch_UpDwnCnt.asm file,the following code:
PWMDRV_1ch_UpDwnCnt .macro n
;=============================
MOVW DP, #_PWMDRV_1ch_UpDwnCnt_Duty:n: ; load DP for net pointer
MOVL XAR0, @_PWMDRV_1ch_UpDwnCnt_Duty:n: ; Load net pointer address to XAR0
MOVL XT,@_PWMDRV_1ch_UpDwnCnt_Period:n:
QMPYL ACC,XT,*XAR0 ; ACC= (I8Q24) * (I16Q16) = (I24Q40): upper 32-bits -> ACC = (I24Q8)
SFR ACC,#8 ; ACC>>8: AL = duty,
MOVW DP,#_EPwm:n:Regs.CMPA
MOV @_EPwm:n:Regs.CMPA.half.CMPA,AL
.endm
; end of file
1. I don't understand the above code, can you explain in detail the process and reason of each step of code execution?
2. Variable AL didn't find a place to define.
thank you very much!
Regards,
Ren