The PIC18F47Q10 features Three 8-bit Timers/Counters with One-Shot Operation. In this demo, uses TMR4 peripheral in One-Shot to stop TMR2 if an external pin is pulled to GND for more than a desired period.
- TB3285 - Getting Started with Timers/Counters on PIC18
- PIC18F47Q10 Product Family Page
- PIC18F47Q10 datasheet
- MPLAB® X IDE 5.30 or newer (microchip.com/mplab/mplab-x-ide)
- MPLAB® XC8 2.10 or newer compiler (microchip.com/mplab/compilers)
- MPLAB® Code Configurator (MCC) 3.95.0 or newer (microchip.com/mplab/mplab-code-configurator)
- MPLAB® Code Configurator (MCC) PIC10/PIC12/PIC16/PIC18 library v1.79.0 or newer (microchip.com/mplab/mplab-code-configurator)
- PIC18F47Q10 Curiosity Nano (DM182029)
- The PIC18F47Q10 Curiosity Nano Development Board (DM182029) is used as the test platform.
The following pin configurations must be made for this project:
Pin | Configuration |
---|---|
RE0 | Digital output (LED0) |
RC7 | Digital input as TMR4 trigger |
- Build demo firmware, make and program the generated code onto the PIC18F47Q10 Curiosity Nano.
- Run the code generated with MCC, LED0 will blink with a rate of
Timer2Period
(100ms). - If the external pin RC7 is pulled to GND for more than
Timer4Period
(500ms), then LED0 will stop blinking.
This project showcases how easy it is to use the TMR4 of PIC18F47Q10 in One-Shot mode with external signal as reset.