Become a subscriber (Free)

Join 29,000 other subscribers to receive subscriber sale discounts and other free resources.
:
:
Don't worry -- youre-mail address is totally secure. I promise to use it only to send you MicroZine.

PIC Timer 2 calculator

With the PIC Timer 2 calculator you can see the resulting frequencies and periods when you change four pieces of information. :

  • Frequency (the default is 4MHz).
  • The Prescaler ratio.
  • Timer 2 period register value.
  • The Postscaler ratio.

Into page : PIC Timer intro (details on installing TCL)
Jump to PIC Timer 0 calculator.
Jump to PIC Timer 1 calculator.

Donwload your Calculators

To download these free calculators signup here:

Enter your details to get the Download Link
and in addition, get the microcontroller newsletter:



(Your email is safe it will never be sold or rented).
You will get the calculators plus free souce code from this site.

Note: Check your email for the project code download link.

PICTimer 2  Block diagram [from 33023a.pdf]
PIC Timer 1 block diagram 33023a.pdf

PICTimer 2 registers 
[from 33023a.pdf]
PIC timer 2 registers

Three sliders let you change the values by dragging a control up and down on the screen and the resulting changes are immediately shown in this page.   The first is for the prescaler, the middle is for the Period register and the last is for the postscaler.

Note: Setting of timer 2 value is not shown as the intended use of the timer is for making it easy to control the period of TMR2 using the period register - taking away the need to service interrupts in order to generate a specific frequency.

All you do is set the Prescaler and Postscaler and set the period register PR2.  For example if you set Prescaler=1:1 and Postscaler=1:1 and PR2=99.  The output period of the  module would be 100us i.e. a Timer 2 interrupt every 100us.

Note: Timer 2 counter is reset on the next count after matching PR2 (this is why you need PR2=99 and not 100).

The important point is that there will be no need to set any registers within the interrupt (as you have to do with the other timers).  This is why it is used as the baud rate generator for the USARTs - it requires no processing.

Screen shot of PIC Timer 2 calculator in action

PIC Timer 2 calculator




Jump from PIC Timer 2 calculator to
Best-Microcontroller-Projects Home Page


New! Comments

Have your say about what you just read! Leave me a comment in the box below.



Privacy Policy | Contact | About Me

Site Map | Terms of Use



Visit our Facebook Page:
To Visit Click Here


Recent Articles

  1. Arduino String: How to read commands from the serial port.

    For Arduino string operations you can use Object Class Strings or C style strings but which should you use? Also find out how to decode commands and control variables in your programs using strings.

    Read more

  2. A Real Time Clock design (DS1307) with a PIC microcontroller

    Real Time Clock Design (FREE): A Free and Complete RTC design using the DS1307 and a PIC micro (16F88) also re-targetable. This PIC project uses an I2C Clock chip and 7-segment display to create a fou…

    Read more

  3. How to use the ADXL345 for movement sensing and more.

    With the ADXL345 acellerometer you can detect up to 16g! You can also find out how to use it for tap detection and more.

    Read more

  4. Arduino Interrupt : There are Some You May Never Have Heard About!

    Arduino Interrupt Tutorial: Find out how many external there are on an Arduino Uno - The answer is more than two!

    Read more

  5. Easy Switch Debounce

    Switch debounce: Three different ways to debounce input push switches with one amazing method that you can't miss.

    Read more

  6. How to use the ADS1115

    A tutorial on using the ADS1115 precision 16 bit ADC for low power use.

    Read more

Readers Comments

"I wanted to thank
you so so so much
for all the information
you have provided in
your site it's

SUPERB and FANTASTIC."

- Ranish Pottath

"This site really is
the best and my favorite.
I find here many useful
projects and tips."

- Milan

bursach<at>gmail.com<

"Awesome site,
very, very easy and nice
to navigate!"


- Matt
matt_tr<at>
wolf359.cjb.net


Learn Microcontrollers

"Interested in
Microcontrollers?"

Sign up for The
Free 7 day guide:

FREE GUIDE : CLICK HERE


"I am a newbie to PIC
and I wanted to say
 how great your
site has been for me."


- Dave

de_scott<at>bellsouth.net

"Your site is a great
and perfect work.
congratulations."


- Suresh

integratredinfosys<at>
yahoo.com

"I couldn't find the correct
words to define
yourweb site.

Very useful, uncovered,
honest and clear.

Thanks so much for
your time and works.
Regards."


- Anon

Back to Top