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.

msp430g2210 timer on P1.6

Other Parts Discussed in Thread: MSP430G2210

hi 

i am working on mspg2210 timers.

the problem i am facing is timer 0 is working fine but when i configure timer on p1.6 it is not generating any interrupt.

here is my code can any one tell me where i went wrong..........................

#include "msp430G2210.h"

unsigned int i;

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer

//LED CONFIGURATION
//P1DIR |=BIT5; // Set P1.5
//output direction
//P1OUT =BIT0; // Led on

//SIGNAL PORT
//P1DIR = 0x40; //P1.6 -> input
P1SEL |= 0x40; //Select TA1

TACCTL1 = CM_3 + SCS + CCIS_1 + CAP + CCIE;
TACCR1 = 1000;
TACTL = TASSEL_2 + MC_1;

_BIS_SR(GIE);
while(1)
{

}

}

// Timer A1 interrupt service routine
#pragma vector=TIMERA1_VECTOR
__interrupt void Timer_A (void)
{
/*TACCTL1 &= ~CCIFG;
TACCR1 = 1000;
TACCTL1 = CCIE;*/
i++;
//P1OUT ^= BIT5; //Toggle LED
}

  • Hello,

    What is the intent of this application?  Looking over the code, it looks like you are trying to use Timer_A to measure a signal edge on P1.6.

    Two things to note:

    1. P1.6 (Pin 4) is not available to be used for CC1B on the G2210 device.  It is available on the G2230 device.  You can review this on page 4 and page 5 of the device datasheet.

    2. When the timer is in capture mode, writing a value to CCR1 does not have any effect.  This register will be written over by the value of TAR when the capture event occurs (an edge on the timer input, which is the CC1B pin).  This edge is also what triggers the interrupt that you are enabling.  You need to provide an external signal to CC1B to get an interrupt (and a timer value at the time of the interrupt).

    Since you are using a G2210, CC1B is not available. You can try using CC1A on P1.2 (Pin 2), or try switching to a G2230 device to use CC1B.

    Walter

  • hi Walter,


                     Thank you for your help,now i am using 1.5 for timer which was working.in the data what i have gone                          through is not clear there it is given P2.6 and P2.7 in 4 and 5 pages.so, i got confused.

                      once again thanks for your support.


                       shyam

  • but one thing is i am able to configure that P1.6 pin as output pin and it is working fine but may i know why it is not working for timer....

    shyam.

  • shyam reddy1 said:
    i configure timer on p1.6 it is not generating any interrupt.

    The table in the users guide )port pin schematics) tell that on the 2210, P1.6 is only TA0.1 output.
    For the 2230, P1.6 can be TA0.CCI1A input too.

    The table under peripherals/Timer_A2 tells the same. On 2210, TA0.CCI1A is on P1.2 ans TA0.CCI1B is internally connected to CAOUT. while on the 2230, it is connected to P1.6

    So P1.6 is output only on the 2210.

**Attention** This is a public forum