Rapid prototyping with 32-bit MCU-based Curiosity Nano Evaluation Kit using MPLAB Harmony v3 Software Framework: Step 6

Last modified by Microchip on 2023/11/09 09:08

This demo application requires adding Click board functionality for the following three Click boards. Click the links below to download the examples for the Click boards.

Note: Alternatively, the Click board examples can also be downloaded from the MPLAB Harmony Reference Apps package on GitHub or using MPLAB Harmony 3 Content Manager In the downloaded Reference Apps package, the Click board examples can be found under apps/sam_e51_cnano/same51n_mikroe_click.

Add Weather Click Board Routine

Unzip the downloaded ZIP file weather.zip.

From the unzipped folder weather/firmware/src, copy the folder click_routines to the folder firmware/src under your application project.

In the project explorer, right-click on folder Header File and add a subfolder click_routines by selecting Add Existing Items from Folders…

Right-click on folder Header File and add a subfolder click_routines by selecting Add Existing Items from Folders

Figure 1

Click on the Add Folder… button.

Click on the Add Folder button

Figure 2

Select the click_routines folder and select Files of type: as Header Files.

Select the click_routines folder and select Files of type: as Header Files

Figure 3

Click on the Add button to add the selected folder.

Click on the Add button to add the selected folder

Figure 4

The Weather Click example header files get added to your project.

The Weather Click example header files is added to your project

Figure 5

In the project explorer, right-click on folder Source Files and add a subfolder click_routines by selecting Add Existing Items from Folders….

Right-click on folder Source Files and add a subfolder click_routines by selecting Add Existing Items from Folders

Figure 6

Click on the Add Folder button.

Click on the Add Folder button

Figure 7

Select the click_routines folder and select Files of type: as Source Files.

Select the click_routines folder and select Files of type: as Source Files

Figure 8

Click on the Add button to add the selected folder.

Click on the Add button to add the selected folder

Figure 9

The Weather Click example source files get added to your project.

The Weather Click example source files is added to your project

Figure 10

Back to top.


Add Fan Click Board Routine

Unzip the downloaded ZIP file fan.zip.

From the unzipped folder fan/firmware/src/click_routines, copy the folder fan to the folder firmware/src/click_routines under your application project.

In the project explorer, right-click on folder Header Files/click_routines and add a subfolder fan by selecting Add Existing Items from Folders….

Right-click on folder Header Files/click_routines and add a subfolder fan by selecting Add Existing Items from Folders

Figure 11

Click on the Add Folder… button.

Click on the Add Folder button

Figure 12

Select the fan folder and select Files of type: as Header Files.

Select the fan folder and select Files of type: as Header Files

Figure 13

Click on the Add button to add the selected folder.

Click on the Add button to add the selected folder

Figure 14

The Fan Click example header files get added to your project.

The Fan Click example header files is added to your project

Figure 15

In the project explorer, right-click on folder Source Files/click_routines and add a subfolder fan by selecting Add Existing Items from Folders….

Right-click on folder Source Files/click_routines and add a subfolder fan by selecting Add Existing Items from Folders

Figure 16

Click on the Add Folder… button.

Click on the Add Folder button.

Figure 17

Select the fan folder and select Files of type: as Source Files.

Select the fan folder and select Files of type: as Source Files

Figure 18

Click on the Add button to add the selected folder.

Click on the Add button to add the selected folder.

Figure 19

The Fan Click example source files get added to your project.

The Fan Click example source files is added to your project.

Figure 20

Back to top.


Add eINK Bundle Click Board Routine

Unzip the downloaded ZIP file eink_bundle.zip.

From the unzipped folder fan/firmware/src/click_routines, copy the folder eink_bundle to the folder firmware/src/click_routines under your application project.

In the project explorer, right-click on folder Header Files/click_routines and add a subfolder eink_bundle by selecting Add Existing Items from Folders….

Right-click on folder Header Files/click_routines and add a subfolder eink_bundle by selecting Add Existing Items from Folders

Figure 21

Click on the Add Folder… button.

Click on the Add Folder button.

Figure 22

Select the eink_bundle folder and select Files of type: as Header Files.

Select the eink_bundle folder and select Files of type: as Header Files.

Figure 23

Click on the Add button to add the selected folder.

Click on the Add button to add the selected folder.

Figure 24

The eink_bundle Click example header files get added to your project.

The eink_bundle Click example header files is added to your project.

Figure 25

In the project explorer, right-click on folder Source Files/click_routines and add a subfolder eink_bundle by selecting Add Existing Items from Folders….

Right-click on folder Source Files/click_routines and add a subfolder eink_bundle by selecting Add Existing Items from Folders

Figure 26

Click on the Add Folder… button.

Click on the Add Folder button.

Figure 27

Select the eink_bundle folder and select Files of type: as Source Files.

Select the eink_bundle folder and select Files of type: as Source Files.

Figure 28

Click on the Add button to add the selected folder.

Click on the Add button to add the selected folder.

Figure 29

The eink_bundle Click example source files get added to your project.

The eink_bundle Click example source files get added to your project.

Figure 30

Note: Remove the weather_example.c, fan_example.c, weather_example.h, fan_example.h, eink_bundle_example.c, and eink_bundle_example.h from the project by right click and select Remove from Project since these files are not used in this project. This would save some application memory space.

Back to top.


Add BLE Source Files
Unzip the downloaded ZIP file pic32cmmc_smart_appliance_control.zip

From the unzipped folder /pic32cmmc_smart_appliance_control/dev_files/pic32cm_mc00_cnano, copy the folder ble to the folder firmware/src/ under your application project

In the project explorer, right-click on folder Header Files and add a subfolder ble by selecting Add Existing Items from Folders….

Right-click on folder Header Files and add a subfolder ble by selecting Add Existing Items from Folders

Figure 31

Click on the Add Folder… button.

Click on the Add Folder button.

Figure 32

Select the ble folder from src/ble and select Files of type: as Header Files.

Select the ble folder from src/ble and select Files of type: as Header Files.

Figure 33

Click on the Add button to add the selected folder.

Click on the Add button to add the selected folder.

Figure 34

The ble example header files get added to your project.

The ble example header files is added to your project.

Figure 35

In the project explorer, right-click on folder Source Files and add a subfolder click_routines by selecting Add Existing Items from Folders….

Right-click on folder Source Files and add a subfolder click_routines by selecting Add Existing Items from Folders

Figure 36

Click on the Add Folder… button.

Click on the Add Folder button.

Figure 37

Select the ble folder and select Files of type: as Source Files.

Select the ble folder and select Files of type: as Source Files

Figure 38

Click on the Add button to add the selected folder.

Click on the Add button to add the selected folder

Figure 39

The ble example source files get added to your project.

The ble example source files is added to your project.

Figure 40

Back to top.


Map Generic Macros of Click Routines
Copy the Generic Macros used in the Fan Click and eINK bundle Click routines

From the unzipped folder fan/firmware/src/click_routines, open the file click_interface.h, and copy the Click routine interfaces/resources Macro Declarations as highlighted in Figure 41

Open the file click_interface.h copy the Click routine interfaces/resources Macro Declarations

Figure 41

Paste click_interface.h in the folder firmware/src/click_routines under your application project.

And paste the click_interface.h in the folder firmware/src/click_routines under your application project

Figure 42

From the unzipped folder eink_bundle/firmware/src/click_routines, open the file click_interface.h copy the Click routine interfaces resources Macro Declarations as highlighted in Figure 43

open the file click_interface.h copy the Click routine interfaces resources Macro Declarations

Figure 43

Paste click_interface.h in the folder firmware/src/click_routines under your application project

Paste in the click_interface.h in the folder firmware/src/click_routines under your application project

Figure 44

  • Map the generic macros used in the Weather Click, Fan Click, and eINK Click bundle routines to the Harmony PLIB APIs of the PIC32CM MC00 MCU based on where the Click boards are placed on the mikroBUS sockets on the Curiosity Nano Base for Click boards.

Fan Click API Mapping

  • In this demo, the Fan Click board is placed on the mikroBUS socket #2, which corresponds to the SERCOM0 I2C peripheral to communicate with the Click board. In the click_interface.h, map the generic Fan Click APIs to SERCOM0 as shown in Figure 45.
In the click_interface.h, map the generic Fan Click APIs to SERCOM0

Figure 45

Weather Click routine API Mapping.

  • In this demo, the Weather Click board is placed on the mikroBUS socket #3, which corresponds to the SERCOM0 I2C peripheral to communicate with the Click board. In the click_interface.h, map the generic Weather APIs to SERCOM0 as shown in Figure 46.
    In the click_interface.h, map the generic Weather APIs to SERCOM0

    Figure 46

eINK Bundle Click routine API Mapping

  • In this demo, the eINK Click board is placed on the mikroBUS socket #1, which corresponds to the SERCOM1 SPI peripheral to communicate with the Click board. In the click_interface.h, map the generic eINK Click APIs to SERCOM1 as shown in Figure 47.
In the click_interface.h, map the generic eINK Click APIs to SERCOM1

Figure 47

Back to top.