Timer Calculator Application Released!

Timer Calculator is a free software development tool used for easier calculation of timer interrupts.
Author
Message
User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

Timer Calculator Application Released!

#1 Post by anikolic » 25 Jul 2012 16:42

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.

Image

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

Jack Flanders
Posts: 337
Joined: 17 Apr 2008 02:53
Location: Fantasy Land

Re: Timer Calculator Application Released!

#2 Post by Jack Flanders » 25 Jul 2012 17:03

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?

Limba
Posts: 10
Joined: 20 Jul 2012 13:31

Re: Timer Calculator Application Released!

#3 Post by Limba » 25 Jul 2012 17:28

I recommend to use 7-zip in windows.

Jack Flanders
Posts: 337
Joined: 17 Apr 2008 02:53
Location: Fantasy Land

Re: Timer Calculator Application Released!

#4 Post by Jack Flanders » 25 Jul 2012 17:57

Thank you! That worked for me.

p.erasmus
Posts: 3391
Joined: 05 Mar 2009 10:28

Re: Timer Calculator Application Released!

#5 Post by p.erasmus » 25 Jul 2012 19:30

mE thank you very much for this last two usefull tools !
P.Erasmus
Saratov,Russia
--------------------------------------------------------------

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: Timer Calculator Application Released!

#6 Post by Dany » 25 Jul 2012 19:30

Very handy tool, thanks!! :D :D
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)

chimimic
Posts: 178
Joined: 29 Sep 2007 14:35
Location: France
Contact:

Re: Timer Calculator Application Released!

#7 Post by chimimic » 26 Jul 2012 09:08

Very usefull, thanks ! :D
Just a little error message about config file on startup, but seems works as expected.
Remy

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Timer Calculator Application Released!

#8 Post by janni » 26 Jul 2012 13:30

This is certainly a useful tool :) , especially for beginners.
chimimic wrote:Just a little error message about config file on startup,
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.

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.

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Timer Calculator Application Released!

#9 Post by janko.kaljevic » 27 Jul 2012 11:22

Hello,

Thanks for the reporting.
It will be fixed as soon as possible.

Best regards.

User avatar
marko.curcic
Posts: 3
Joined: 27 Jul 2012 10:03

Re: Timer Calculator Application Released!

#10 Post by marko.curcic » 31 Jul 2012 12:18

@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

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Timer Calculator Application Released!

#11 Post by janni » 31 Jul 2012 13:32

Hi Marko,
About compensation, did you mean increasing the value written to TMR0?
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).

cclinus
Posts: 4
Joined: 09 Jul 2012 05:22

Re: Timer Calculator Application Released!

#12 Post by cclinus » 02 Aug 2012 16:35

Hi,

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;
  }
}
Regards

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Timer Calculator Application Released!

#13 Post by janni » 02 Aug 2012 16:55

cclinus wrote:Below is the code generate by Timer Calculator. I wonder why PR2 is 248 but not 249.
It shouldn't, but this was already pointed out :wink: .

OlliD
Posts: 9
Joined: 13 Apr 2010 19:04

Re: Timer Calculator Application Released!

#14 Post by OlliD » 11 Aug 2012 15:00

Really handy application. Thanks for providing it, Janko!

Cheers,
Olli

Frank73
Posts: 33
Joined: 09 Jan 2012 15:56

Re: Timer Calculator Application Released!

#15 Post by Frank73 » 13 Aug 2012 05:53

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!

Post Reply

Return to “Timer Calculator”