I prefer using timer 2 over other timers as it allows much more precise control.
That is because you have a Postscaler, Prescaler and a rollover value to deal with.
While having more options gives you much better flexibility, it's downfall is its more complicated to calculate correct values to give desired frequency.
For example, I'm after an interrupt hat gives me exactly 60Hz, how do I determine the correct Postscaler, Prescaler and Rollover values?
That is where the attached Excel sheet comes in extremely handy.
Just enter the oscillator frequency and required interrupt frequency and the Excel sheet gives all the answers!
As you can see if maximum prescaler is only 16 then the nearest value to 60 will be 75Hz.
How about I would like to know all the whole frequency values?
Not a problem, excel sheet can do that as well:
Hope this helps you as much as it has helped me.
The Excel sheet was modified with Libra Office, but I see no reason why it won't work with excel.
Note: After entering frequency you must select the drop-down and what maximum Prescaler you have, before results are shown.
Timer 2 Calculator
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Timer 2 Calculator
V2 shows a more instant values without having to select drop-down filter.
Also, selection bug fix.Martin
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: Timer 2 Calculator
Thanks Martin
Appears to work ok with Apache open office
Steve
Appears to work ok with Apache open office
Steve
Success always occurs in private and failure in full view.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Timer 2 Calculator
Just saved with microsoft office.
Libra Office version was not working with excel 365
Libra Office version was not working with excel 365
Martin