cancel
Showing results for 
Search instead for 
Did you mean: 

Timer str7lib

sjo
Associate II
Posted on February 10, 2005 at 17:19

Timer str7lib

3 REPLIES 3
sjo
Associate II
Posted on December 20, 2004 at 06:55

Another query regarding the str7 library (v1.3).

The function used to config the output compare mode - TIM_OCMPModeConfig does a TIMx->OCAR = ( XpulseLength - 5 ). According to the data this is only required for pwm mode.

I am also guessing the timer is based around the st7 timer - is this correct?

Another query is in your library supplied vector handlers (71x_vect.s), you call SaveContext r0,r11 surely it would be safer to save all the user working registers upto r12.

Merry Xmas

sjo

sjo
Associate II
Posted on December 20, 2004 at 11:13

What I mean is in the function TIM_OCMPModeConfig the XpulseLength variable is decremented by 5, as per the data this is only required for pwm mode not output compare.

The pwm mode function TIM_PWMOModeConfig is correct as it subtracts 5 as per data.

The str71x data is correct to how I would expect an st7 timer to work.

Also I am unable to download the above attachment.

Many Thanks

sjo

technischesoftware
Associate II
Posted on February 10, 2005 at 17:19

Hi,

regarding the r0..r11 query, it is not only safer to change it to r0..r12 but it is a must. I had severe problems due to interrupts. One timer interrupt routine used all the registers r0..r12 and so currupted r12. This caused 'random' type of failures in the complex application.

Regards,

CeeCee.