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.

Compiler/CC430F5137: CC430F5137

Part Number: CC430F5137

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:

    // Set timer1 for pulse counting:
    // - TASSEL_2: clock source INCLK
    // - MC_0: clock stopped
    // - ID_0: Divider 1
    TA1CTL = TASSEL_2 + MC_0 + ID_0 + TACLR;
   
    // Initialize the counter to 0.
    TA1R = 0;
   
    // Normally the counter is stopped. MC1 sets the continuous
    // 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