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.

Using INCLK (TAINCLK) on the MSP430F2274

Other Parts Discussed in Thread: MSP430F2274

 

Can anyone help???

I've built a project using the eZ430-RF2500 platform.  I got everything working great (SPI display et al), but determined I needed a more accurate timer.  I added a 32.768 KHz oscillator, and fed it to INCLK (via the header interface on the target board).  It appears that there are no clock pulses to TimerA - based on the fact that TAR never increments from 0.  If I change ONE line of code to use ACLK, it all works (although with a sloppy timebase, as I'm driving ACLK with the VLO).

SOOOO......

TACTL = TASSEL_1 + MC_1;    works, but

TACTL = TASSEL_3 + MC_1;    does not.  Is there something simple I'm overlooking?  I've programmed P2.1 as input - although I don't know if I was supposed to.  Is there something really simple that I'm just overlooking?  For the record, my o-scope shows a (roughly) 33 KHz waveform at P2.1.  If anyone has done this, a code fragment would be fantastic.

 

  • Found it!

    The issue was that I did not understand the "peripheral module" concept.  I needed to program the PxSEL bits to define what I wanted to use the processor pin for - in my case, peripheral support versus basic port I/O.

  • Hi, 

    I'm trying to do a similar thing. Can you please share the way you have set up P2SEL. I have the following configuration, and TAR does not increment at all. 

    /* Initialize board */
    BSP_Init();

    /* Port 2 Port Select Register */
    P2SEL = BIT1 + BIT6 + BIT7;  -   this was generated with GRACE

    /* Initialize TimerA and oscillator */

    TACTL |= TASSEL_3;          // INCLK

    TACTL |= ID_0;                     // no divider

    TACTL |= MC_2;                   // continuous mode, start timer

    Do I have to set up BCSCTL3 or any other registers ?

    Thanks, 

    Victor

  • I would suggest you consult the Pin Schematic section of the MSP430F2274 datasheet to see which configuration register bits needs to be modified to ensure the TimerA TAINCLK is propagated to the pin.  P2SEL.1 = 1, P2DIR.1 = 0 and ADC10AE0.1 = 0.  This would allow TAINCLK to be connected to pin P2.1.

  • Thanks a lot for your response.

    I've looked into the datasheet and found Table 25. Port P2 (P2.1) Pin Functions. Afterwords I found one of your older posts, explaining that "The nomenclature of P2DIR.x means the register P2DIR and bit position x."

    And then I've added the following set up: 

    /* Port 2 Port Select Register */
    P2DIR &= 0xFD;
    P2SEL |= 0x02;
    ADC10AE0 &= 0xFD;

    but unfortunately, TAR is stil not incrementing. Is there anything else I might be missing ?

    I also tried using 

    TACTL |= TASSEL_0;            // TACLK

    /* Port 1 Port Select Register */

    // P1SEL = BIT0;

    And simulating with proteus my code works as expected and TAR is incremented. 

    Thanks again, 

    Victor Vlad

  • Victor Vlad said:

    but unfortunately, TAR is stil not incrementing. Is there anything else I might be missing ?

    Have you verified that a toggling clock input is at P2.1 of the device?  Just a sanity check.

  • It's true that I only tried this set up in the context of a proteus simulation, using a signal generator. 

    My input signal is digital and comes from a "home made" electronic circuit. I will try as soon as I get home and reply back. 

    Thanks a lot for trying to help, 

    Victor Vlad

  • Hello, 

    It works !!!! Sorry for my previous post. I should have tried with a real signal generator or straight on my board, before rushing to say that TAR is not incrementing. I really appreciate your help... I am a begginer and I learned a lot trying to sort this out... Sooo, thanks for your time !

  • Do you externally connect some signal to INCLK pin?

**Attention** This is a public forum