# pic18f47q10-cnano-tmr2-one-shot-reset-bare
**Repository Path**: microchip-pic-avr-examples/pic18f47q10-cnano-tmr2-one-shot-reset-bare
## Basic Information
- **Project Name**: pic18f47q10-cnano-tmr2-one-shot-reset-bare
- **Description**: This repository provides a bare-metal code example for using TMR4 peripheral in One-Shot to stop TMR2 if an external pin is pulled to GND for more than a desired period.
- **Primary Language**: C
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-06-17
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# PIC18F47Q10 Use TMR4 in One-Shot mode with external signal as reset
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.
## Related Documentation
- Technical Brief Link [(linkTBD)](http://www.microchip.com/)
- [PIC18F47Q10 Product Family Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/PIC18F47Q10)
- [PIC18F47Q10 datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/40002043D.pdf) for more information or specifications.
## Software Used
- MPLABĀ® X IDE 5.30 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide)
- MPLABĀ® XC8 2.10 or newer compiler [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers)
## Hardware Used
- PIC18F47Q10 Curiosity Nano [(DM182029)](https://www.microchip.com/Developmenttools/ProductDetails/DM182029)
## Setup
- The PIC18F47Q10 Curiosity Nano Development Board [(DM182029)](https://www.microchip.com/Developmenttools/ProductDetails/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 |
## Operation
1. Build demo firmware, make and program the generated code onto the PIC18F47Q10 Curiosity Nano.
2. Run the code, LED0 will blink with a rate of `Timer2Period` (100ms).
3. If the external pin RC7 is pulled to GND for more than `Timer4Period` (500ms), then LED0 will stop blinking.
## Summary
This project showcases how easy it is to use the TMR4 of PIC18F47Q10 in One-Shot mode with external signal as reset.