Matt, I still can't get the timer to work inside of Captivate. It works if I comment out the BSP_configureMCU() and the CAPT_appStart() lines. I have commented out all other instances of BIT0 in Captivate program(both found in CAPT_BSP.c and CAPT_BSP.h) with no success. I have included the problem code. Where the timer code ends, I would normally go into some decision procedures which are commented out for now. #include // Generic MSP430 Device Include #include "driverlib.h" // MSPWare Driver Library #include "captivate.h" // CapTIvate Touch Software Library #include "CAPT_App.h" // CapTIvate Application Code #include "CAPT_BSP.h" // CapTIvate EVM Board Support Package #include "CAPTIVATE_PROXIMITY_Demo.h" // CAPTIVATE-PROXIMITY PCB Demo //***************************************************************************** // Function Implementations //***************************************************************************** #pragma PERSISTENT(RADIO_data1); unsigned long RADIO_data1=0X1FFF0; ///////////////////////// int main(void) //void main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop WDT //Configure GPIO P1DIR |= BIT0; // P1.0 output P1OUT |= BIT0; // P1.0 high // Disable the GPIO power-on default high-impedance mode to activate // previously configured port settings PM5CTL0 &= ~LOCKLPM5; TA1CCTL0 |= CCIE; // TACCR0 interrupt enabled TA1CCR0 = 550; TA1CTL = TASSEL__SMCLK | MC__UP; // SMCLK, UP mode __bis_SR_register(LPM0_bits | GIE); // Enter LPM0 w/ interrupt __no_operation(); // For debug } //Timer A0 interrupt service routine #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector = TIMER1_A0_VECTOR __interrupt void Timer_A (void) #elif defined(__GNUC__) void __attribute__ ((interrupt(TIMER1_A0_VECTOR))) Timer_A (void) #else #error Compiler not supported! #endif { volatile uint32_t i;//TOGGLE FUNCTION WDT_A_hold(WDT_A_BASE);//TOGGLE FUNCTION // Initialize everything that is required for the demo. // The standard CAPTIVATE-FR2633 BSP is used to bring up the MCU. // The CAPTIVATE-PROXIMITY-Demo is setup with Demo_init(), which sets up // the LEDs and sensor callbacks. The CapTIvate application // is started with CAPT_appStart(), which calibrates the sensors and // configures the CapTIvate timer to provide the requested scan period. // WDTCTL = WDTPW | WDTHOLD; //BSP_configureMCU(); Timer does not start with this line--------xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx---PROBLEM LINE __bis_SR_register(GIE); Demo_init(); //CAPT_appStart(); Timer does not start with this line------------xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx---PROBLEM LINE //////////////////////////////////////////////////////////////////////////////// { P1OUT ^= BIT0; //TA1CCR0 += 600; // Add Offset to TACCR0, changed from 50000 } //////////////////////////////////////////////////////////////////////////////// /** // // The CapTIvate application handler will refresh the user interface // when requested to by the CapTIvate timer flag. It will also handle // responding to communication on the I2C interface via the CapTIvate // protocol. If there is nothing left to do, the loop will sleep. // while(1) ///////////////////////////////////////// { //LED3_OFF; /////////////////////////////////////////// // // Run the captivate application handler. // Set LED1 while the app handler is running, // and set LED2 if proximity is detected // on any sensor. Test1: if(CAPT_appHandler()==true) goto Framtest;//testing for touch if(CAPT_appHandler()==false)goto Standby;//no touch Framtest: if (RADIO_data1 == 0X1FFFF) goto Alarm_off;//testing for radio off signal //FRAM_data will change to incoming data from radio if (RADIO_data1 != 0X1FFFF) goto Alarm_on;//no radio off signal Alarm_off: {//LED3_OFF; LED2_ON; goto Test1;} Alarm_on: ////////////////////////////////////////////////////////////////////////////// {//LED3_ON ^= BIT0; P1OUT ^= BIT0; //TA1CCR0 += 600;//} // Add Offset to TACCR0, changed from 50000 /////////////////////////////////////////////////////////////////////////// //LED3_ON; for(i=1000000; i>0; i--);//LED OUTPUT TIME FUNCTION, decrementing LED2_OFF; while(i>0); goto Test2; } Test2: { if(CAPT_appHandler()==true) goto Framtest; if (RADIO_data1 == 0X1FFFF) goto Alarm_off; LED1_TOGGLE; for(i=100000; i>0; i--); LED3_OFF; goto Test2; } Standby: {//LED3_OFF; LED2_OFF; } // This is a great place to add in any // background application code. __no_operation(); // // End of background loop iteration // Go to sleep if there is nothing left to do CAPT_appSleep(); } **/// End background loop } // End main() Any help would be greatly appreciated. If I can't get this to work from the processor I will just trigger a comparator/oscillator on another chip but seems like this should be doable. The nomenclature used for the Timers is a bit confusing by the way.
↧