Posted on May 17, 2011 at 12:50Hi, thanks a lot for your tips. Now it seems to work!!! Here´s my code Code:u32 ulPeriod, ulCounter; void TIM4_IRQHandler(void) { static UW_16 old=0; BOOL bUpdateFlag=FALSE; if (TIM4_SR_UPDATE) { TIM4->SR = 0xFFF...
Posted on May 17, 2011 at 12:50Hi, thanks a lot for your advise. Know it´s a littlebit better: As i wrote in my older posting the TIM4_SR_UPDATE and TIM4_SR_CC4 are bitbanding defines for the interrupt flags. Unfortunatelley they didn´t work, beca...
Posted on May 17, 2011 at 12:50Hi, that´s right for errors +/- one timer overflow. I did your suggestion in the past an could solve this issue. I didn´t mention it to keep it simple. My problem is that the result vor ulPeriod is sometimes the DOUB...
Posted on May 17, 2011 at 12:50Hi, Here my complete code. TIM4_SR_UPDATE and TIM4_SR_CC4 are defines for the interrupt flags (i use bitbanding). They both work fine. Code:u32 ulPeriod, ulCounter; void TIM4_IRQHandler(void) { static u16 old=0; if (...
Posted on May 17, 2011 at 12:50Hi, i´m using TIM4/CH4 for input capture. Because TIM4/CH3 generates PWM i have to count the update events for correct input capture calculation. I calculate the IC period like this: period= ( overflowcounter * TIM4-...