Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 63713

Forum Post: Blinky example using interrupts in CMSIS

$
0
0
Hi, I'm trying to replicate the blinky example fro MSP432 , but without delays, and using interrupts and the CMSIS example. Here is my code: /****************************************************************************** * * MSP432 blink.c template - P1.0 port toggle * * CMSIS compliant coding * ******************************************************************************/ #include "msp.h" #include "blink.h" void main(void) { volatile uint32_t i; Setup(); // The following code toggles P1.0 port while(1) { // - Infinite loop } } void TA0_0_ISR(void) { // - Toggle P1.0 P1->OUT ^= BIT0; return; } void Setup(void) { // **************************** // DEVICE CONFIG // **************************** // - Disable WDT WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD; // **************************** // PORT CONFIG // **************************** // - P1.0 is connected to the Red LED P1->DIR |= BIT0; P1->OUT = 0U; // **************************** // TIMER CONFIG // **************************** // - TimerA configuration TIMER_A0->CTL = TIMER_A_CTL_SSEL__SMCLK | TIMER_A_CTL_ID__1 | TIMER_A_CTL_MC__CONTINUOUS | TIMER_A_CTL_CLR | TIMER_A_CTL_IE; TIMER_A0->EX0 = TIMER_A_EX0_IDEX__1; __enable_irq(); NVIC_EnableIRQ(TA0_0_IRQn); return; } I already added the TA0_0_ISR function in the startup file, in the slot for the Timer 0 interrupt. But I'm not getting any interrupts firing, so I believe I might have misconfigured the timer, but at this point I'm really lost.

Viewing all articles
Browse latest Browse all 63713

Trending Articles



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