The variable definition in the while loop hides the global variable. Anyway, the CCR1 register is updated only when the line "TA1CCR1 = Duty; " is executed.
↧