Part Number: MSP430FR2355
Hello.
I am trying to capture every 1/10 second P2IN and PI1N....TIMER2 runs in the background and collects pin history. In the event a keystroke PORT1 VECTOR is hit a 2 second timer (TIMER0 ISR) is started. After the 2 second timer expires I immediately disable TIMER2 ISR and look at history array. It NEVER shows change in the P1IN status...P1IN is configured as an input with pulldowns. In the event I put a breakpoint in TIMER2 ISR where I reset the pointer to the beginning of history for rollover I can see changes in history showing it has read P1IN....please can someone explain to me why when I break after disabling TIMER2 in TIMER0 that the history array reverts back to 00??? I am using an MSP430FR2355EVM board. One more quick blurb....If I hold 3.3V to one of P1 pins for the duration of 2 seconds all history shows it captured...I however would like to know why >1/10s and < 2s I cannot see any captures?
#pragma vector=TIMER2_B0_VECTOR //CCIE every tenth of a second
__interrupt void m100SecondTimerB2(void)
//rolling counter...resets after 20 hits or at 2 sec. timer going off
{
TB2CCR0 += TENTHSEC;
*pHistory = ((unsigned)((P2IN << 8)|(P1IN)));
*pHistory &= ~(0xF701); //mask unused pins
pHistory++;
if (pHistory > history + 19)
pHistory = history;
}
/*#pragma vector=TIMER0_B0_VECTOR //CCIE every tenth of a second
__interrupt void m100SecondTimer(void)
{
TB0CCR0 += TENTHSEC;
*pHistory = ((unsigned)((P2IN << 8)|(P1IN)));
*pHistory &= ~(0xF701); //mask unused pins
pHistory++;
}*/
#pragma vector=TIMER0_B1_VECTOR //TBIE overflow every 2 seconds
__interrupt void twoSecondTimer(void)
{
switch(__even_in_range(TB0IV,TB0IV_TBIFG))
{
case TB0IV_NONE: break; // No interrupt
case TB0IV_TBCCR1: break; // CCR1 not used
case TB0IV_TBCCR2: break; // CCR2 not used
case TB0IV_TBIFG: // overflow
remote = T;
TB2CCTL0 &= ~CCIE;
pHistory = history;
__bic_SR_register_on_exit(LPM3_bits); //exit ISR and wake up, process in main
break;
default: break;
}
}
//ISR for on/off buttons
#pragma vector=PORT1_VECTOR
__interrupt void indicatorButtons(void)
{
launchTimerSeq();
switch (__even_in_range(P1IV, 16))
{
case 4: //P1.1
indicator ^= SW1;
P1IFG &= ~BIT1;
break;
case 6: //P1.2
indicator ^= SW2;
P1IFG &= ~BIT2;
break;
case 8: //P1.3
indicator ^= SW3;
P1IFG &= ~BIT3;
break;
case 10: //P1.4
indicator ^= SW4;
P1IFG &= ~BIT4;
break;
case 12: //P1.5
indicator ^= SW5;
P1IFG &= ~BIT5;
break;
case 14: //P1.6
indicator ^= SW6;
P1IFG &= ~BIT6;
break;
case 16: //P1.7
indicator ^= ALL;
P1IFG &= ~BIT7;
break;
default:
break;
}
}
Any ideas....
Thank you
Steve