EALLOW
MOVW DP,#_EPwm1Regs.TBSTS
MOV AL,@_EPwm1Regs.TBSTS
ANDB AL,#0x1 ; Check TBCNT1 Direction
B Dwn_Cnt,EQ ; If equal to 0 (Counting Down) 注释是不是写错了?
EQ = 1,而NEQ = 0
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
EALLOW
MOVW DP,#_EPwm1Regs.TBSTS
MOV AL,@_EPwm1Regs.TBSTS
ANDB AL,#0x1 ; Check TBCNT1 Direction
B Dwn_Cnt,EQ ; If equal to 0 (Counting Down) 注释是不是写错了?
EQ = 1,而NEQ = 0
SPRU430F应用文档第161页开始,EQ是指Zflag =1,NEQ是指Zflag =0,
After the shift, the Z flag is set if the ACC value is zero, else Z is cleared. Even if the T register specifies a shift of 0, the content of the ACC register is still tested for the zero condition and Z is affected.
Z位的定义,B指令的含义:
Conditional branch. If the specified condition is true, then branch by adding the signed
16-bit constant value to the current PC value; otherwise continue execution without
branching:
If (COND = true) PC = PC + signed 16-bit offset;
If (COND = false) PC = PC + 2;
所以如果此时ACC = 0,那就跳转Dwn_Cnt,如果不等于0,就继续往下走
仔细看刚刚贴出来的这句话:
After the shift, the Z flag is set if the ACC value is zero, else Z is cleared. Even if the T register specifies a shift of 0, the content of the ACC register is still tested for the zero condition and Z is affected.
是如果ACC =0 就跳转