The PIC18F47Q10 features Three 8-bit Timers/Counters and a 10-bit ADC with computation (ADCC) module. In this demo, uses TMR2 peripheral to trigger the ADCC to make conversions at a fixed frequency rate, that can be adjusted with the period of TMR2.
- TB3285 - Getting Started with Timers/Counters on PIC18
- PIC18F47Q10 Product Family Page
- PIC18F47Q10 datasheet
- 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 newer compiler (microchip.com/mplab/compilers)
- PIC18F47Q10 Curiosity Nano (DM182029)
- Curiosity Nano Base for Click Boards™ (AC164162)
- POT click board™ (MIKROE-3402)
- The PIC18F47Q10 Curiosity Nano Development Board (DM182029) is used as the test platform.
- Insert it into the Curiosity Nano Base for Click Boards™ (AC164162) along with the POT click board™ (MIKROE-3402).
The following pin configurations must be made for this project:
Pin | Configuration |
---|---|
RA0 | Analog input for ADCC |
RE0 | Digital output (LED0) |
- Build demo firmware, make and program the generated code onto the PIC18F47Q10 Curiosity Nano.
- Plug the POT click board™ into the mikroBUS™ slot (1) of the Curiosity Nano Base board.
- Run the code, LED0 will blink with
Timer2Period
frequency. - LED0 will blink if Potentiometer value is below
DesiredThreshold
, and if aboveDesiredThreshold
, LED0 will be ON.
This project showcases how easy it is to use the TMR2 of PIC18F47Q10 as a Auto-conversion trigger for ADCC module.