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.
On the MSP430F5659 I wish to output a 1.6 KHz square wave on P1.7 (TA0.2). I note that TA0.2 is assigned on P1.3 also, which is confusing (assuming asserting P1 SEL for the desired pin will assign it to the PWM output).
Using an ACLK of 32.768KHz, I create a timer/counter using these registers:
P1DIR |= BIT7; // P3.5 output
P1SEL |= BIT7; // P3.5 option select
TA0CCTL2 = OUTMOD_4; // CCR0 toggle mode
TA0CCR2 = 5;
TA0CTL = TASSEL_1 | MC_3 | TACLR; // ACLK, up-downmode, clear TAR
This gives NO output.
However, (after experimenting) I found that this works:
P1DIR |= BIT7; // P3.5 output
P1SEL |= BIT7; // P3.5 option select
TA0CCTL2 = OUTMOD_4; // CCR0 toggle mode
TA0CCR0 = 5;
TA0CTL = TASSEL_1 | MC_3 | TACLR; // ACLK, up-downmode, clear TAR
How come?
Since the timer channel I am using is TA0.2 shouldn't the TA0CCR2 register be used?
Perhaps there is a simple chart that shows the association between each pin and the timer/counter registers, but I can't seem to find it.
Thank you.
//most of the comments in your code are incorrect.
Yes, I know. Should have updated these. Just cut and pasted without much edit.
Thanks for the clearer explanation.
**Attention** This is a public forum