Timer Calculator Application Released!
Timer Calculator Application Released!
Timer Calculator Application Released!
We developed a small but very handy application which creates code for Timer Interrupts on 8-bit
PIC microcontrollers. We call it Timer Calculator.
Timer Calculator is a tool which creates code for timer interrupts. All you have to do is set your
microcontroller family, clock frequency and available timer, and simply specify which period you
would like the timer to run at. Clicking on the button Calculate will create code for mikroC,
mikroBasic and mikroPascal compilers for PIC.
We have provided dozens of most commonly used configuration templates that can be loaded
with a single click. All you have to do is copy the generated code and paste it into your compiler's editor.
Timer Calculator is exclusively shared on Libstock website, and we hope that you will like it as
much as we do. It really saves you time because you don't have to browse through the datasheets
and calculate register values, or worry about activating interrupts the right way.
That's why this tool is awesome for PIC developers.
Yours sincerely,
mikroElektronika
We developed a small but very handy application which creates code for Timer Interrupts on 8-bit
PIC microcontrollers. We call it Timer Calculator.
Timer Calculator is a tool which creates code for timer interrupts. All you have to do is set your
microcontroller family, clock frequency and available timer, and simply specify which period you
would like the timer to run at. Clicking on the button Calculate will create code for mikroC,
mikroBasic and mikroPascal compilers for PIC.
We have provided dozens of most commonly used configuration templates that can be loaded
with a single click. All you have to do is copy the generated code and paste it into your compiler's editor.
Timer Calculator is exclusively shared on Libstock website, and we hope that you will like it as
much as we do. It really saves you time because you don't have to browse through the datasheets
and calculate register values, or worry about activating interrupts the right way.
That's why this tool is awesome for PIC developers.
Yours sincerely,
mikroElektronika
Web Department Manager
-
- Posts: 337
- Joined: 17 Apr 2008 02:53
- Location: Fantasy Land
Re: Timer Calculator Application Released!
This looks useful! I see there are two download files: one is a .rar and one is a .zip and since I use Windows, I chose the zip file. Unfortunately, it has a rar file inside.
What is the correct application to extract the Timer Calculator Application from this?
What is the correct application to extract the Timer Calculator Application from this?
Re: Timer Calculator Application Released!
I recommend to use 7-zip in windows.
-
- Posts: 337
- Joined: 17 Apr 2008 02:53
- Location: Fantasy Land
Re: Timer Calculator Application Released!
Thank you! That worked for me.
Re: Timer Calculator Application Released!
mE thank you very much for this last two usefull tools !
P.Erasmus
Saratov,Russia
--------------------------------------------------------------
Saratov,Russia
--------------------------------------------------------------
Re: Timer Calculator Application Released!
Very handy tool, thanks!!
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Re: Timer Calculator Application Released!
Very usefull, thanks !
Just a little error message about config file on startup, but seems works as expected.
Remy
Just a little error message about config file on startup, but seems works as expected.
Remy
Re: Timer Calculator Application Released!
This is certainly a useful tool , especially for beginners.
There are also some small things that could be corrected, like unneeded reloading of PR2 register in Timer 2 ISR, or (rounding?) errors leading to inaccurate number of counts (for example, PR2=248 for 1ms with Fosc=4MHz, to stay with Timer2). (There's also missing postscaler value in description for Timer2.)
There are some fine points to timers's reloading, of which the best known is skipping of two instruction cycles before resuming counting after loading Timer0 registers. Unfortunately, at an attempt to include it, the calculator makes things worse. First, to compensate, the count should be decreased, not increased, and second, count may be so compensated (count per instruction cycle) only when prescaler is not used.
I'm not sure compensation of the subtleties does any good when larger errors in timing, like those caused by the ISR overhead are neglected. Some pointers in Help file about the latter would be in place, BTW.
Yes, that's something that should be corrected - when Windows localisation leads to decimal dot replaced with comma, there's the "Invalid timer config file" error for files coming with the calculator. Replacing decimal dots in numerical fields in config files removes the error, but, naturally, the program shouldn't be sensitive to localisation.chimimic wrote:Just a little error message about config file on startup,
There are also some small things that could be corrected, like unneeded reloading of PR2 register in Timer 2 ISR, or (rounding?) errors leading to inaccurate number of counts (for example, PR2=248 for 1ms with Fosc=4MHz, to stay with Timer2). (There's also missing postscaler value in description for Timer2.)
There are some fine points to timers's reloading, of which the best known is skipping of two instruction cycles before resuming counting after loading Timer0 registers. Unfortunately, at an attempt to include it, the calculator makes things worse. First, to compensate, the count should be decreased, not increased, and second, count may be so compensated (count per instruction cycle) only when prescaler is not used.
I'm not sure compensation of the subtleties does any good when larger errors in timing, like those caused by the ISR overhead are neglected. Some pointers in Help file about the latter would be in place, BTW.
- janko.kaljevic
- Posts: 3565
- Joined: 16 Jun 2011 13:48
Re: Timer Calculator Application Released!
Hello,
Thanks for the reporting.
It will be fixed as soon as possible.
Best regards.
Thanks for the reporting.
It will be fixed as soon as possible.
Best regards.
- marko.curcic
- Posts: 3
- Joined: 27 Jul 2012 10:03
Re: Timer Calculator Application Released!
@janni
Hi,
Thanks for reporting the bugs. New version of application will be published on LIbstock soon.
About compensation, did you mean increasing the value written to TMR0? Because, if you decrease the value written to TMR0, timer interrupt will be longer for that time period. Just curious about your statetment.
Best regards
Hi,
Thanks for reporting the bugs. New version of application will be published on LIbstock soon.
About compensation, did you mean increasing the value written to TMR0? Because, if you decrease the value written to TMR0, timer interrupt will be longer for that time period. Just curious about your statetment.
Best regards
Re: Timer Calculator Application Released!
Hi Marko,
Yes, I meant increasing value written to registers, i.e. decreasing the count for timer (it's easier, at least for me, to think what timer has to count, than what has to be written to registers , which equals 65536-count).About compensation, did you mean increasing the value written to TMR0?
Re: Timer Calculator Application Released!
Hi,
Below is the code generate by Timer Calculator. I wonder why PR2 is 248 but not 249.
Regards
Below is the code generate by Timer Calculator. I wonder why PR2 is 248 but not 249.
Code: Select all
//Timer2
//Prescaler 1:4; Postscaler 1:12; TMR2 Preload = 248; Actual Interrupt Time : 1 ms
//Place/Copy this part in declaration section
void InitTimer2(){
T2CON = 0x5D;
TMR2IE_bit = 1;
PR2 = 248;
INTCON = 0xC0;
}
void Interrupt(){
if (TMR2IF_bit){
//TODO: Enter your code here
TMR2IF_bit = 0;
PR2 = 248;
}
}
Re: Timer Calculator Application Released!
It shouldn't, but this was already pointed out .cclinus wrote:Below is the code generate by Timer Calculator. I wonder why PR2 is 248 but not 249.
Re: Timer Calculator Application Released!
Really handy application. Thanks for providing it, Janko!
Cheers,
Olli
Cheers,
Olli
Re: Timer Calculator Application Released!
hello I want to congratulate you for this excellent tool allows us to go faster in our developments is made to order.
good until yesterday I started to speak I have a question, etoy trying to read the pulse count in a given period, but I have clear the way I write the data on screen, I mean how do I load the value of pulse a bariable to see her on screen so I am not clear that part!
good until yesterday I started to speak I have a question, etoy trying to read the pulse count in a given period, but I have clear the way I write the data on screen, I mean how do I load the value of pulse a bariable to see her on screen so I am not clear that part!