Okay, I'm a newbie and I'm trying to implement a pulse counter using the TACLK input pin on the launchpad. All I want is an interrupt to be triggered when i press a push button which will then increment a counter which is a global variable. I may be doing something stupid here but any help is appreciated
//*****************************************************************************
//
// MSP432 main.c template - Empty main
//
//****************************************************************************
#include "msp.h"
float g_fCount;
void main(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
TA1CTL = TASSEL_0 + MC_2 + TAIE; //TACLK source, Cont mode, enable TA1 Interrupt
__enable_interrupt();
while(1){
}
}
void TA1_N_IRQHandler (void){
g_fCount++; //Increment Counter
TA1CTL = !TAIFG; //Set interrupt flag to 0
}