6 Adding Chip Peripherals

The Chip Support Package (csp), which is downloaded as part of Install Harmony 3 Dependencies, see Install Harmony 3 Dependencies from Related Links, helps to configure and generate code related to peripherals of choice. For more details on the Chip Support Package (csp), refer to the Microchip-MPLAB-Harmony /csp in Reference Documentation from Related Links.

Once a peripheral is added to Project Graph, users can configure a variety of settings applicable to the peripheral. Upon code generation, the system generates code specific to the peripheral for the users. The system automatically adds the initialization of the peripheral, for example, SERCOM0_Initialize(), to the SYS_Initialize() function call.

Figure 6-1. Adding Peripheral to Project Graph
  • For more detailed documentation to understand the usage of various APIs available for a particular peripheral, refer to the MPLAB Harmony Peripheral Libraries. For more details, see MPLAB Harmony 3 Peripheral Library Application Examples for PIC32CX-BZ6 and PIC32WM-BZ6204 Family in Reference Documentation from Related Links.
  • There are also precompiled application examples available in <Harmony Content Path>/csp_apps_pic32cxbz6_wmbz6. These examples are ready to use and help users learn by following them.

PIC32CX-BZ6/WBZ65 supports a variety of peripherals, and each of peripheral uses certain pins.

To use all the features on the PIC32-BZ6 Curiosity Board, some of the peripheral pins are shared and the peripheral’s use cases overlaps. For more details on the shared pins, refer to the PIC32-BZ6 Curiosity Board User’s Guide.

User needs to check the following table if the peripherals on the board are overlapped before development. Both the columns and rows list out all the peripherals on the board.
Note: An “X” means that some of the pins are shared among two peripherals.
The following are some of the example scenarios:
  • The board share some of the I2C pins with PTA (option 2) and USB host VBUS. Therefore, enabling I2C must drop PTA (option 2) and USB Host mode.
  • MikroBus1 UART and CAN1 both share the same pins, so either case can be used.
Table 6-1. Peripheral Interface Compatibility Matrix
QSPIEthernetI2CMikroBus1 SPIMikroBus2 SPIMikroBus1 UARTMikroBus2 UARTTouch (CVD)*Graphic (GFX)*PTA (Option 1)
QSPIXXXX
Ethernet
I2C
MikroBus1 SPI
MikroBus2 SPI
MikroBus1 UARTX
MikroBus2 UARTX
Touch (CVD)* X
Graphic (GFX)*XX
PTA (option 1)X
PTA (option 2)XXX
CAN1XX
Temperature sensorX
MCP2200 UART flow controlXX
DebuggingX
Low power batteryX
VBUS on USB hostX
USB IDXXX
USB DRP controlXX
Table 6-2. Peripheral Interface and Feature Compatibility
PTA (Option 2)CAN1Temperature SensorMCP2200 UART Flow ControlDebuggingLow Power BatteryVBUS on USB HostUSB IDUSB DRP Control
QSPIX
EthernetX
I2CXX
MikroBus1 SPIXX
MikroBus2 SPIXXX
MikroBus1 UARTX
MikroBus2 UART
Touch (CVD)*XX
Graphic (GFX)* XXX
PTA (option 1)X
PTA (option 2)X
CAN1
Temperature sensor
MCP2200 UART flow controlX
Debugging
Low power battery
VBUS on USB host
USB ID
USB DRP control