May I modify the TCPWM_CNT_CC value when the timer is enable and start ?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi, 

   

My application for multiple time cc events used.

   

I wish used a same timer resource, it means that I write a compare register value to generate cc event interrupts when timer count reach the compare register, in the mean time, the timer does not stop, keep running and enter interrupt service routine, then firmware change compare register to a new value , new value is great than old (example it is a up counting mode), after clear interrupt return to main routine, wait for reaching  next compare register value then CC event happened. The new value is enough to process interrupt service routine. 

   

Is it workable ?  

0 Likes
1 Reply
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted
        yuhua, Here is a link for 2 similar projects that use single Timer/Counter/PWM block for multiple outputs. It operates same way as you describe, that is settings are being updated in isr on-the-fly. http://www.cypress.com/comment/388031#comment-388031 Another approach for re-creating Timer in software can be found in this thread. It is based on software timing, and may not hold for very high frequencies. http://www.cypress.com/comment/401386#comment-401386   
0 Likes