Tool/software: TI C/C++ Compiler
Hi,
I am using CC430f5137 to control my device.
I want to use the timer A1 to count pulses generated by a moving sensor. I want to use pin P3.0 to as input for pulses.
What kind of mapping is required for the port 3?
I have done following actions:
P3MAP0 = PM_TA1CLK; <-- wrong to do mapping if using INCLK?
P3DIR &= ~BIT0; // BIT0 = 0 -> input
P3SEL |= BIT0; // BIT0 = 0 -> periheral
Timer settings:
// - TASSEL_2: clock source INCLK
// - MC_0: clock stopped
TA1CTL = TASSEL_2 + MC_0 + ID_0 + TACLR;
TA1R = 0;
// mode to count up to 0xFFFF.
TA1CTL |= MC_1;
There is something I do not understand how to make P3.0 to work as a pulse counter.
BR
JanneN