3.1 PIC32CZ CA90 Curiosity Ultra Development Board

To add and configure MPLAB Harmony components using MCC, follow these steps:

  1. In the MCC window, under Device Resources, click and expand the list of options Harmony > Peripherals > SERCOM.
  2. Click SERCOM2 and observe that the SERCOM2 Peripheral Library block is added in the Project Graph section.
    Figure 3-1. SERCOM Module
  3. Click SERCOM2 and in the Configuration Options property page, click and expand SERCOM2 and configure SERCOM2 module as SPI Master as shown below.
    Figure 3-2. SERCOM2 Configuration
  4. From the Plugins drop-down list, select Pin Configuration.
    Figure 3-3. Plugins - Pin Configuration
  5. Click Pin Settings and then sort entries by selecting Ports from the Order list.
    Figure 3-4. Selecting Ports from the Order Menu
  6. Configure the pins as shown below:
    Figure 3-5. Configuration of Pins
  7. In the Plugins drop-down list, select DMA Configuration.
    Figure 3-6. Plugins - DMA Configuration
  8. In the DMA Configuration, click Add Channel to add DMAC Channel 0 and choose the trigger as SERCOM2_Transmit. Repeat the same steps, but for DMAC Channel 1 choose SERCOM2_Receive as the trigger.
    Figure 3-7. DMA Configuration
  9. Click Generate to generate the code.
    Figure 3-8. Generating the Code