MCC Generated Code

To generate this project using MPLAB Code Configurator (MCC), follow the next steps:

  1. 1.Create a new MPLAB X IDE project for PIC18F47Q10.
  2. 2.Open MCC from the toolbar (more information about how to install the MCC plug-in can be found here).
  3. 3.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.
  4. 4.From the Device Resources window, add TMR1 and CCP1. Make the following configurations for each peripheral:
    • TMR1 Configuration:
      1. i.Enable Timer: checked
      2. ii.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_
  5. 5.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:
    Figure 1. Pin Mapping
  6. 6.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.