With the PIC Timer 2 calculator you can see the resulting frequencies and
periods when you change four pieces of information. :
To download these free calculators signup here:
Enter your details to get the Download Link
and in addition, get the microcontroller newsletter:
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.
Arduino EEPROM: How to use it and How to presrve the life of EEPROM. Two examples sketches to save multiple values to EEPROM.
A tutorial on using the ADS1115 precision 16 bit ADC for low power use.
Learn how to use the TP4056 properly. There's a right, and a wrong way, to use it to safely charge Lithium Ion batteries.
The DW01A chip is a Lithium Ion battery protector commonly used on TP4056 boards. Find out Exactly how it works and how to use it the correct way.
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.
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…