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.

MSP430I2040: Stop / restart PWM output using Timer1

Part Number: MSP430I2040

Hi,

My customer is using MSP430I2040TPW.
P2.2 is assigned as TA1.2 and used as PWM output.

Here are TimerA configurations:
clock = SMCLK (4.096MHz)
divider = 1
Timer mode = UP (MC=01b)
Output mode = Set/Reset (OUTMODx=011b)
TA1CCR0 = 260d
TA1CCR1 = 227d

Expected behavior:
a1) The P2.2 output is toggled "L to H" at counter value = 227.
a2) The P2.2 is toggled "H to L" at counter value = 260 and counter value returns to zero.
a3) Go back to 1).

Customer wants to stop the P2.2 with the output=L. The P2.2 may be stopped asynchronously with TimerA count.
What customer tried were below steps:
b1) Change TA1CCR1 = 260d.
b2) Change Timer Mode = STOP.
But the P2.2 output was sometimes stopped with H and sometimes stopped with L.
It seems if above steps b1) & b2) are done while TimerA counter is between 228d and 259d, the P2.2 output remains H.

To keep the P2.2 output always stop with L, customer applied added step after b2).
b3) Switch P2.2 to GPIO output L.

When PWM is restarted, below sequence is taken.
c1) P2.2 is switched to TA2.1. 
c2) Change TA1CCR1 = 227d.
c3) Change Timer Mode = UP.

[Questions]
The sequence customer took is OK?
Do you have any recommended sequence to stop / restart PWM output?

Thanks and regards,
Koichiro Tashiro

**Attention** This is a public forum