Part Number:MSP430G2553
HI, I am programming my MSP430G2553 by using the code below:
Everything is wired correctly: I am using the launchpad and it is using jumper wires connected P2.0 to a breadboarded LED and for input I am detecting in P1.1 whichis connected to a floating wire. My issue is that the LED not turning ON.
Its either because there is simple connection error or that I am doing something wrong. PLEASE HELP ME
#include "CTS_Layer.h"
//#define ELEMENT_CHARACTERIZATION_MODE
#ifdef ELEMENT_CHARACTERIZATION_MODE
unsigned int dCnt;
#endif
// Main Function
void main(void)
{
// Initialize System Clocks
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
BCSCTL1 = CALBC1_1MHZ; // Set DCO to 1, 8, 12 or 16MHz
DCOCTL = CALDCO_1MHZ;
BCSCTL3 |= LFXT1S_2; // LFXT1 = VLO
P2OUT = 0x00; // Drive all Port 2 pins low
P2DIR = 0xFF; // Configure all Port 2 pins outputs
TI_CAPT_Init_Baseline(&one_button); // Initialize Baseline measurement
TI_CAPT_Update_Baseline(&one_button,100); // Update baseline measurement (Average 100measurements)
while (1)
{
#ifdef ELEMENT_CHARACTERIZATION_MODE
// Get the raw delta counts for element characterization
TI_CAPT_Custom(&one_button,&dCnt);
__no_operation(); // Set breakpoint here
#endif
#ifndef ELEMENT_CHARACTERIZATION_MODE
if(TI_CAPT_Button(&one_button))
{
__delay_cycles(10000);
if(TI_CAPT_Button(&one_button))
P2OUT += BIT2; // Turn on center LED
}
else
{
__delay_cycles(10000);
if(!TI_CAPT_Button(&one_button))
P2OUT &= ~BIT2; // Turn off center LED
}
__delay_cycles(100000);
#endif
}
}