cancel
Showing results for 
Search instead for 
Did you mean: 

STM32W108 Interrupt help

dolk89
Associate
Posted on May 22, 2012 at 19:23

This will probably be a very trivial post for some. I'm still pretty new to programming, and I am trying to figure out how to get interrupts to work properly on the STM32W

I am trying to get TIM1 to count down and create an interrupt with each underflow. I believe I have everything setup right but I can't seem to get the interrupt to trigger.

void ConfigTimer1_CountDown()
{
// Timer 1 Control Register 1
TIM1_CR1 = 0x90; //TIM1_CEN needs to be set last
// Timer 1 Slave Mode Control Register
TIM1_SMCR = 0x00;
// Timer 1 Event Generation Register
TIM1_EGR = 0x01;
//Timer 1 Counter Register
TIM1_CNT = 0xFFFF; // Value for counter
//Timer 1 Auto-Reload Register
TIM1_ARR = 0xFFFF; // Same value as teh Counter Register
}
void ConfigTimer1_Interrupt()
{
// Interrupts Configuration Register
INT_CFGSET = 0x01; // Enable interrupt on timer 1
// The Set would also set the INT_CFGCLR to 0x01 as well....
}
void TIM1_IRQHandler(void)
{
}

Any and all help is appreciated Thanks #interrupt #stm32w #stm32w108
0 REPLIES 0