6.1 MCC Generated Code
To generate this project using MPLAB Code Configurator (MCC), follow the next steps:
- Create a new MPLAB X IDE project for PIC18F47Q10.
- Open MCC from the toolbar (more information about how to install the MCC plug-in can be found here).
- Go to Project Resources →
System → System Module and make the following configurations:
- Oscillator Select: HFINTOSC
- HF Internal Clock: 32 MHz
- Clock Divider: 32
- In the Watchdog Timer Enable field in the WWDT tab, WDT Disabled has to be selected.
- From the Device Resources window, add
TMR1 and CCP1. Make the following configurations for each peripheral:
- TMR1 Configuration:
- Enable Timer: checked
- Timer Clock
tab
- Clock Source: FOSC/4
- Prescaler: 1:1
- Enable Synchronization: Checked
- CCP1 Configuration:
- Enable CCP: Checked
- CCP Mode tab:
Compare
- Select Timer: Timer1
- Compare Mode: Toggle_
- TMR1 Configuration:
- Open Pin Manager → Grid View window and select UQFN40 in the MCU package field and make the following pin configuration to enable the internal signal access to the I/O:
- Click Generate in the Project Resources tab.
Note: In this example, the event will be
strictly handled by the hardware peripheral without any software, and load on the core
so no extra code was used aside from the one generated from MCC.