Summary of PIC Microcontroller Timer Calculation
This article addresses the difficulty of manual PIC timer calculations by introducing free TCL-based interactive scripts. These tools automate prescaler, postscaler, and register value adjustments to achieve precise frequencies or periods for PIC Timer 0, Timer 1, and Timer 2. Users can experiment with different clock sources and settings via sliders without needing a calculator, simplifying hardware design workflows.
Parts used in the PIC Timer Calculation Project:
- PIC Timer 0
- PIC Timer 1
- PIC Timer 2
- TCL (Tool Command Language) Scripts
- Prescaler
- Postscaler
- Timer Register
- Period Register
timer – it makes it easier to use (although it is tricky to get right – but If you use a calculator script).
Prescaler: 2 bits (1:1, 1:4, 1:16)
Timer Register: 8-bit
Period register: 8-bit
Postscaler: 4 bits (1:1 to 1:16 inclusive)
pic MCU, pic24
More Atmel Microcontroller Articles
- How can I automate PIC timer calculations?
You can use three online interactive module scripts written in TCL that function like Java applets. - What is the benefit of using these scripts over manual calculation?
The scripts allow you to move sliders to adjust values and see results instantly without a calculator. - Which timers are supported by these calculation tools?
The tools support PIC Timer 0, PIC Timer 1, and Timer 2. - Can I change the main clock frequency in the tool?
Yes, you can set the main clock frequency to be either internal or an external crystal. - What is the bit size of the prescaler for PIC Timer 0?
PIC Timer 0 has an 8-bit prescaler. - How does Timer 2 differ from Timer 0 and 1 regarding the period register?
Timer 2 has a period register that lets you set frequency output without updating values in the timer interruption routine. - What is the prescaler configuration range for Timer 2?
Timer 2 uses a 2-bit prescaler with ratios of 1:1, 1:4, and 1:16. - Does Timer 1 support external clock sources?
Yes, Timer 1 can be driven from an external clock or low-speed sources like a 32kHz crystal.
