2008-11-04 12:17 AM
Centre agligned pwm interrupt problem
2011-05-17 03:50 AM
Hi Guys,
I am trying to generate a interrput on the rising edge of center agligned pwm using TIM1_CCR4 but I keeping getting both rising & falling interrupts. Is possible to mask out the the falling edge interrupt? TIM1_ARR=0xFFFF; TIM1_CCR1=0x7FFF; TIM1_CCR2=0x7FFF; TIM1_CCER = TIM1_CCER_CC1E|TIM1_CCER_CC1NE|TIM1_CCER_CC2E|TIM1_CCER_CC2NE; TIM1_BDTR = 0x02| TIM1_BDTR_OSSR|TIM1_BDTR_OSSI|TIM1_BDTR_AOE; TIM1_EGR|= TIM1_EGR_UG; TIM1_CR1 = TIM1_CR1_CEN|TIM1_CR1_ARPE| 2<TIM1_CCMR1_OUTPUT_COMPARE_MODE = TIM1_MODE_PWM1<TIM1_MODE_PWM1<TIM1_CCR4=1; TIM1_CCMR2_OUTPUT_COMPARE_MODE = TIM1_MODE_PWM2<TIM1_CCER|= TIM1_CCER_CC4E; TIM1_DIER = TIM1_DIER_CC4IE; Irq_0_to_31_Set_Enable = 1<thx