SLAA513B December 2011 – February 2022 MSP430G2112 , MSP430G2112 , MSP430G2152 , MSP430G2152 , MSP430G2212 , MSP430G2212 , MSP430G2252 , MSP430G2252 , MSP430G2312 , MSP430G2312 , MSP430G2352 , MSP430G2352 , MSP430G2412 , MSP430G2412 , MSP430G2452 , MSP430G2452
It is possible to implement multiple timer periods on the same timer module by using Continuous Mode. In Continuous Mode, the timer always count up to 0xFFFF and then rolls over, rather than resetting at TxCCR0 each time. This means that the period is no longer set by placing a constant value in TxCCR0; rather, it is the difference between the previous and next value of TxCCRx that sets the period for each capture compare register. For example, this means that in the code, instead of setting TACCR0 = 0xFF at the beginning of the program, we would need to dynamically change TxCCR0 by 0xFF every time the counter reaches TxCCR0 (“TACCR0 += 0xFF”). Because each TxCCRx register is now completely independent from TxCCR0, a different frequency can be generated for each TxCCRx register on each timer module, drastically increasing the number of frequencies that can be produced. Figure 2-1 shows the relationship of the TxCCR0 value and two independent periods t0 and t1 in Continuous Mode. t0 corresponds to a count that is added to TxCCR0 at each interrupt, and t1 corresponds to a count that is added to TxCCR1 at each interrupt, creating the two different periods.
When using the multiple time base method, the number of frequencies and duty cycles that can be simultaneously produced on a particular MSP430 device is dependent on the total number of all TxCCRx registers on the device.
Continuing with the previous example using the MSP430F5529 device, the available timers are TA0 with five capture/compare (CC) registers, TA1 with three CC registers, TA2 with three CC registers, and TB0 with seven CC registers. Therefore, using the multiple time base method on an MSP430F5529:
Number of Frequencies and Duty Cycles = 5 CC + 3 CC + 3 CC + 7 CC = 18 frequencies and duty cycles
With the single time base method four frequencies with 14 varying duty cycles was the only option available. With the multiple time base method, any combination of the available 18 frequencies and duty cycles is available.