Timer blocks provide precise timing and resource management capabilities essential for embedded applications. The MPLAB Blockset offers timer configuration for creating named timer resources that can be shared across peripherals, and profiling tools for measuring code execution performance.
| Application | Recommended Block | Why? |
|---|---|---|
| Periodic Task Execution | TIMER_Config | Creates time base for multitasking scheduler |
| Measure Code Execution Time | TIMER_PIL_Profiling | Hardware-accurate timing for PIL |
| Time Base for Peripherals | TIMER_Config | Shared resource for PWM, IC, OC, ADC |
| Performance Optimization | TIMER_PIL_Profiling | Identify bottlenecks and validate deadlines |
Timer Resources:
TIMER_Config for automatic allocationUse TIMER_Config for Named Resources
Check Device Timer Availability
Resource Sharing Guidelines
Resolution = (Prescaler × Timer Period) / Instruction Cycle
Example: dsPIC33CK @ 100 MIPS, Prescaler=8, 16-bit timer
The PIL Profiling block provides microsecond-level timing accuracy suitable for:
| Timer Block | dsPIC30F | dsPIC33F | dsPIC33E | dsPIC33C | dsPIC33A | PIC24 | PIC32 | SAM |
|---|---|---|---|---|---|---|---|---|
| TIMER_Config | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⚠️ |
| TIMER_PIL_Profiling | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Legend: ✅ Full Support | ⚠️ Different Peripheral (TC/TCC blocks)
Note: SAM ARM devices use different timer peripherals (TC/TCC blocks instead of Type A/B/C timers). TIMER_Config concepts apply but use SAM-specific peripheral blocks.
Related Block Categories:
Recommended Reading:
Example Projects:
💡 Quick Selection Guide:
TIMER Config - Timer Configuration Block Timer Block Icon The MCHP_TIMER_Config block provides a high-level interface for configuring hardware timers …
Read more →TIMER PIL Profiling - PIL Timing Profiler Timer_PIL_Profiling Block Icon The MCHP_TIMER_PIL_Profiling block enables precise code execution timing …
Read more →