CCS is throwing up this error for the attached code that I am trying to get it to compile and move to the launchpad.
#include <msp430x20x2.h>
#define LED0 BIT0
#define LED1 BIT6
#define TACH BIT3
unsigned int tachCount = 0;
unsigned int tachRPM = 0;
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR |= (LED0 + LED1); // Set P1.0 to output direction
// P1.3 must stay at input
P1OUT &= ~(LED0 + LED1); // set P1.0 to 0 (LED OFF)
P1IE |= TACH; // P1.3 interrupt enabled
P1IES |= TACH;
if(tachCount>=12000)
{
P1OUT ^=(LED0 +LED1);
// P1IFG &= ~BUTTON; // P1.3 IFG cleared
}
}
void updateTach(void)
{
P1IE &= ~(TACH); // Disable tachometer interrupt
_NOP(); // Wait 1 instruction cycle
// Convert pulse count to RPM
tachRPM = (tachCount)*60;
P1IE |= (TACH); // Re-enable tachometer interrupt
tachCount = 0; // Reset the pulse counter
}
// Port 1 interrupt service routine
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
if(P1IFG & TACH) {
tachCount++;
P1IFG &= ~TACH; // P1.3 IFG cleared
}
I created a blank Tach.out in the relevant directory, that makes me go past this error, but the code does not get pushed to the LaunchPad, which in hindsight should have been obvious.
This code (http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_PushButton#Code) works like a charm without any issue, and that is what I have on my LaunchPad right now.
Can someone tell me what am I doing wrong here?