Hi folks,
I am having some trouble measuring PWM counts, wish some of you could give me a hand. The PWM signal (RSSI of xbee) runs at 12MHz, depending on strength of signal, the number of pulse counts varies. My setup is: MSP430F6720, PWM signal is fed into TACLK (P3.2), used it as source of timer. I then read number of counts in certain period of time, say 400 micro second.
Somehow this setup doesn't work. TA3R always reads 0.My code seems to be OK:
// Bring RSSI from xbee into TACLK/P3.2, refer to port map.
P3SEL |= BIT2;
P3DIR &= ~BIT2;
TA3CTL = MC_2 | TACLR; // Default to external clock, continuous mode
delay_us(400); // Delay 400 micro seconds / two duty cycles
TA3CTL &= ~MC_3; // Stop TA3
count = TA3R;
TA3CTL |= TACLR;
Is this a correct way of doing this sort task? or I would better off using capturing mode? Many thanks.