Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 215725

Forum post: CCS/MSP430FR6989: MSP430 interrupt with delay coding problem

$
0
0
Part Number: MSP430FR6989 Tool/software: Code Composer Studio Hi, I have attached a switch to port 2.0 and a led to port 2.4. I am trying to figure out how interrupts work with a delay timer, I thought I had the hang of it, but unfortunately, when I press my switch nothing happens. Can someone help me figure out where my mistake is? I have written comments in my code to help explain my logic. #include /* * DEFINE LED PORT & PIN */ #define LED_PDIR P2DIR #define LED_POUT P2OUT #define LED_PIN 0x10 // Port 2.4 #pragma vector=PORT2_VECTOR __interrupt void Port2ISR(void) // function, describing the interrupt routine { int counter1; int value = 14; for(counter1=0; counter1 falling edge P2IFG &= ~0x01; // P2.0 IFG cleared _BIS_SR(GIE); // Enable interupts blinkDelay(); }

Viewing all articles
Browse latest Browse all 215725

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>