SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By actionplus
#49681
I am trying to transmit an rpm from a pulse that is getting monitored on P2.0 on the end device.

Seems like my tachCount does not increment. P2.) does not detect it.
I can manually define a number for tachCount and it show up on the AP side. But when I rely on the actual signal. Nothing happens.

Can someone take a look at my interupt routine to see if I am not seeing something?

Thanks

void updateTach(void)
P2IE &= ~(TACH); // Disable tachometer interrupt
_NOP(); // Wait 1 instruction cycle
tachRPM = (tachCount/PULSESPERREVOLUTION)*60;// Convert pulse count to RPM
P2IE |= (TACH); // Re-enable tachometer interrupt

}


// PORT2 Interrupt Service Routine
#pragma vector=PORT2_VECTOR
__interrupt void isrPORT2(void)
{
if (P2IFG & TACH) { // Tachometer pulse detected ?//defined TACH BIT0
tachCount++; // Increment tach counter
P2IFG &= ~TACH; // Clear interrupt flag//
}
}
//Version: ED_rr1.1. addition END


/*------------------------------------------------------------------------------
* ADC10 interrupt service routine
------------------------------------------------------------------------------*/
#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR(void)
{
__bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR)
}

/*------------------------------------------------------------------------------
* Timer A0 interrupt service routine
------------------------------------------------------------------------------*/
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
__bic_SR_register_on_exit(LPM3_bits); // Clear LPM3 bit from 0(SR)
}