In this project the Analog-to-Digital Converter with Computation and Context Module (ADCCC) of the PIC18F57Q84 is used to read two channel (ANA0 & ANA1) by 4 channel sequencer.
- MPLAB® X IDE 5.45 or newer (microchip.com/mplab/mplab-x-ide)
- MPLAB® XC8 2.32 or newer compiler (microchip.com/mplab/compilers)
- MPLAB® Code Configurator (MCC) 4.10 or newer (microchip.com/mplab/mplab-code-configurator)
- MPLAB® Code Configurator (MCC) Device Libraries PIC10/PIC12/PIC16/PIC18 library v1.81.7 or newer (microchip.com/mplab/mplab-code-configurator)
- Microchip PIC18F-Q Series Device Support (1.1.185) or newer (packs.download.microchip.com/)
- PIC18F57Q84 Curiosity Nano (DM182029)
- Digital Power Development Board (DM330029)
In this demo,
This section shows the settings used in the demo/example for various MCU modules configuration. These settings were done using the Microchip Code Configurator (MCC). Open MCC to look at the settings of the modules.
The MCU uses the high frequency external oscillator (10MHz), and the clock is set to 4*PLL (40 MHz).
The ADCC is configured with a clock of FOSC/2.
The timer0 is configured to 500ms to periodly trigger ADC.
The Uart1 is used to print the result of ADC.
The pins are configured as follows:
Just one interrupt from ADC Context 4.
You should disable JTAG function in configuration bit.
- After making the above hardware connections, build demo firmware and load the generated hex file onto the PIC18F57Q84 MCU.
- When the demo firmware is loaded, you could see the print result from serial terminal.
This example shows the ADC new feature of PIC18F57Q84 - Channel Sequencer and Context.