The PIC18F47Q10 features Timers with special event functions. This example shows how to use the TMR1 configured as a counter. The Capture/Compare/PWM (CCP) module will be configured with a user defined value. A GPIO pin will be configured as output and the event will toggle the logic value of this pin. The event will be triggered when the counted value from TMR1 will be equal with the CCP value.
- TB3285 - Getting Started with Timers/Counters on PIC18
- PIC18F-Q10 Family Product Page
- PIC18F47Q10 Data Sheet
- TB3261 - PIC1000: Getting Started with Writing C-Code for PIC16 and PIC18
- MPLAB® X IDE 5.30 or newer (microchip.com/mplab/mplab-x-ide)
- MPLAB® XC8 2.10 or a newer compiler (microchip.com/mplab/compilers)
- Microchip PIC18F-Q Series Device Support (1.4.109) or newer (packs.download.microchip.com/)
- PIC18F47Q10 Curiosity Nano (DM182029)
The PIC18F47Q10 Curiosity Nano Development Board is used as the test platform.
Pin | Configuration |
---|---|
RB0 | Digital Output |
Run the code. Pin RB0 is configured as digital output. The logic value of the pin will toggle every time the event occurs.