2012-05-22 10:23 AM
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