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.

MSP430F67791A: P2SEL error for peripheral function selection

Part Number: MSP430F67791A
Other Parts Discussed in Thread: MSP430G2452

This is the code used in the energy meter development. I use Energy meter ASIC for the development. I need to use the peripheral function of P2.2 pin. The timer capture functionality is to be used.

#include <msp430f67791a.h>
#include <signal.h>
#include <math.h>
#include <io.h>
#include <stdio.h>
#include <stdint.h>d
#include <stdlib.h>
#include <emeter-toolkit.h>

#if defined(MESH_NET_SUPPORT)
#include "mesh_structure.h"
#endif

//#if defined(__GNUC__)

void initTimer_A(void);

unsigned int presenttime=0;
unsigned int lasttime=0;
unsigned int buffer=0;
unsigned char i=0;

int main(void)
{
WDTCTL = WDTPW + WDTHOLD; //Stop watchdog timer
//BCSCTL1 = CALBC1_1MHZ; // Set DCO to 1MHz
//DCOCTL = CALDCO_1MHZ;
P2DIR &= BIT2;
P2SEL |= BIT2;
TA0CTL = TACLR;
TA0CTL = TASSEL_1 + ID_2 + MC_2;
TA0CCTL2 = CM_2 + CCIS_0 + SCS + CAP + CCIE;
_BIS_SR(LPM0_bits + GIE);
while(1);
}

//Timer ISR
#pragma vector = TIMER0_A1_VECTOR
__interrupt void Timer_A1_CCR2_ISR(void)
{
switch(TA0IV)
case 04:
{
presenttime = TA0CCR2;
buffer = lasttime - presenttime;
printf("period = %d", buffer);
TA0CCTL2 &= ~CCIFG;
lasttime = TA0CCR2;
}
}

I want to measure the time period of the signal given to the pin 2 of port 2. I use IAR for development. When I remove the P2SEL line from the code, it gets successfully compiled. But when I include it, there is an error 

Error[Pe020]: identifier "P2SEL" is undefined


When I run the same code in using a different part number, (msp430g2452 launchpad)  the code successfully compiles.

Please help me to solve this issue.

**Attention** This is a public forum