How to set cascade timer using processor expert?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set cascade timer using processor expert?

2,205 Views
Aili
Contributor II

Hi,

 

I have a small project which is based on 56F803. I am going to use Timer A0 as a free running 1 ms clock, and Timer A1 and Timer A2 are both based on Timer A0 output. Anyone know how to set the beans for Timer A1 & A2?

 

Thanks,

 

Liping

Labels (1)
Tags (1)
0 Kudos
Reply
3 Replies

898 Views
ProcessorExpert
Senior Contributor III

There are two possible approaches.

1) Task approach - Processor Expert is generally task-orinted so unless it's really necessary you should not ask "how to connect two timers", but the questions should be "how to produce 1ms periodic interrupt" or "how to ouptut PWM pulses on a specific pin with given period etc..". This way you can use beans like TimerInt, PPG, FreeCntr etc... that allow to use chained timers for achieving long times. PE generates initialization code and runtime methods for you.

 

2) Peripheral approach - If it's necessary or you really want to handle low-level peripheral configuration including advanced fuatures, you can use peripheral init beans.They are peripheral specific. In your case, you can add three Init_TMR beans into the project (one for each timer) and configure their properties (Primary and secondary clock source, operation mode etc.)

 

best regards
Petr Hradsky
Processor Expert Support Team
 

0 Kudos
Reply

898 Views
Aili
Contributor II

Hi Petr Hradsky,

 

The reason I am asking how to connect two timers is because I have many timers and the DSP is not able to provide enough resources to do it if they are not shared. For example, I want to have timers of 1ms, 1s, 5s, ... 1hours. In order to save resources, I need to let TimerA0 does 1ms, and TimerA0 & TimerA1 do 1s, ... However, if I use Processor Expert to configure TimerA0 for 1ms free run, I am not able to use TimerA01 for 1s (it says the TimerA0 has already been used).

I am not familiar with Peripheral approach, but I think I will try it. Thank you for your help.

 

Best regards,

 

Liping

0 Kudos
Reply

898 Views
jag
Contributor IV

Hi,

 

you can do it with one single timer.  

 

Bye Jack 

0 Kudos
Reply