Part Number: TMS320F28377S
I believe that I have found a problem with configuring the ePWM DBCTL register from the CLA. I have not tested if the same problem shows up when writing the registers from the CPU.
It appears that if ePWM register DBCTL2 contains an 0x04 value and a CLA write of 0x00 is done to it the value of register DBCTL OUT_MODE field is set to 0x3.
Here is a CLA assembly example:
; --------------------
; This code sequence will produce bad value in DBCTL register
;
MXOR32 MR0, MR0, MR0 ; Zero
MMOV16 @_EPwm1Regs.DBCTL, MR0 ; Zero
MMOVXI MR0, #4
MMOV16 @_EPwm1Regs.DBCTL2, MR0 ; Set with SHDWDBCTLMODE enabled
MXOR32 MR0, MR0, MR0 ; Zero
MMOV16 @_EPwm1Regs.DBCTL, MR0 ; Zero
MMOV16 @_EPwm1Regs.DBCTL2, MR0 ; Set with SHDWDBCTLMODE enabled
; *** Error: At this point DBCTL is 0x03 when it should be 0x00. DBCTL2 is 0x00.
; --------------------
; The following code segments will all work
;
MXOR32 MR0, MR0, MR0 ; Zero
MMOV16 @_EPwm1Regs.DBCTL, MR0 ; Zero
MMOVXI MR0, #0
MMOV16 @_EPwm1Regs.DBCTL2, MR0 ; Set Zero
MXOR32 MR0, MR0, MR0 ; Zero
MMOV16 @_EPwm1Regs.DBCTL, MR0 ; Zero
MMOV16 @_EPwm1Regs.DBCTL2, MR0 ; Set with SHDWDBCTLMODE enabled
; Correct: At this point DBCTL is 0x00 and DBCTL2 is 0x00.
; Just setting DBCTL2 to zero first before zeroing DBCTL works.
MXOR32 MR0, MR0, MR0 ; Zero
MMOV16 @_EPwm1Regs.DBCTL2, MR0 ; Set Zero
MMOV16 @_EPwm1Regs.DBCTL, MR0 ; Zero
; Correct: At this point DBCTL is 0x00 and DBCTL2 is 0x00.
I would like to have this verified and an explanation for why writing to DBCTL2 register would change the value in DBCTL?
I would also like a list of other register write combinations that would show this same type of sequence initialization related issue?
Thanks
Jeramie