4.6 Running a Precompiled Application Example

This section gives a detail explanation on how to open, build and program an existing application example.

Prerequisites

  1. Install Installing the IDE and Compiler

  2. Install Install Device Family Part Pack

  3. Install Installing the MPLAB® Code Configurator (MCC) Plugin

  4. Install Install Harmony 3 Dependencies

Downloading Application Example from Discover

To download application examples such as wireless_apps_pic32cxbz3_wbz35 from MPLAB Discover platform, follow these steps:
Note: In this application developers guide, the user uses wireless_apps_pic32cxbz3_wbz35 only as an example. The user can choose any application example as per the requirement.
  1. Open Microchip MPLAB Discover by clicking the MPLAB Discover button.
    Note: The user can also access MPLAB Discover by going to Microchip MPLAB Discover.
    Figure 4-17. MPLAB Discover
  2. In the “Search” bar, enter the keyword wireless_apps_pic32cxbz3_wbz35.
    1. Press Enter on the keyboard to see the list of application examples.
    2. The “MPLAB Discover” window displays the list of application examples related to the PIC32CX-BZ3 and the WBZ35x wireless modules.
    Figure 4-18. MPLAB Discover – List of Applications
  3. The user can browse through the list of available applications.
    1. Click on any application example as per the requirement.
    2. Click Download to download the application example.
    Figure 4-19. MPLAB Discover – Downloading Application
  4. When prompted, the user must specify the path to save the downloaded applications.
    1. By default, the system downloads the applications as a .zip file named wireless_apps_pic32cxbz3_wbz35-1.1.1.
    2. Click Save to continue.
    3. The .zip file contains all the selected application examples for the PIC32CX-BZ3/WBZ35x wireless modules.
    Figure 4-20. MPLAB Discover – Downloading Application Path

COM Port Setup

To resolve COM port issues that prevent the output of text to the Tera Term terminal using the WBZ351 Curiosity Board, follow these steps:

  1. Close Tera Term and unplug the WBZ351 Curiosity Board from the computer.
  2. Open Device Manager.
    Figure 4-21. Device Manager
  3. Plug the WBZ351 Curiosity Board back into the computer.
  4. In the Tera Term window, select “Serial”.
    1. From “Port:” drop-down list, select USB Serial Device.
    Figure 4-22. USB Serial Port Selection
  5. In the Setup tab, pefrom the following steps:
    1. From “Port:” drop-down list, select the USB Serial Device.
    2. From the “Speed:” drop-down list, select 115200.
    3. Click New setting to apply the changes.
    Figure 4-23. Serial Port Setup and Connection
  6. Press the reset button on the board to see text on the terminal if the WBZ351 Curiosity Board is programmed.

Opening , Building and Programming an Existing Application Example

  1. Connect the WBZ351 Curiosity Board to the PC using USB cable.
  2. Open MPLAB® X IDE.
  3. To select file, navigate to File>Open Project.
  4. Browse to project location of choice (In this example, it is “ble_sensor_app”) project, select project file from the location <Discover Path>\wireless_apps_pic32cxbz3_wbz35\apps\ble\advanced applications\ble_sensor_touch\firmware\ble_sensor_touch.X.
  5. Open Project Properties:
    1. Right-click on the “Project” and select Properties to open the project properties.
    2. In the Project Properties dialog, select WBZ351 Curiosity Board as hardware tool for programming.
    3. The user must ensure to select the correct DFP vx.xx.xx version. For more details, see Install Harmony 3 Dependencies.
    Figure 4-24. Project Properties – Hardware Tool DFP Compiler Selection
  6. The user must ensure to select the correct XC32 compiler vx.xx version. For more details, see Getting Started with Software Development.
  7. The user must ensure to select the correct CMSIS vx.x.x version. For more details, see Getting Started with Software Development.
  8. Click Clean and Build Main Project in MPLAB® X IDE to compile the application example.
    Figure 4-25. Clean and Build Main Project
  9. Click Make and Program Device Main Project in MPLAB® X IDE to program the target. The on-board debugger programs the example application.
    Figure 4-26. Make and Program Device Main Project
    Note:
    • For more information related to the workings of the application example, refer to the PIC32CX-BZ3/PIC32CX-BZ36 and WBZ35x Application Developer’s Guide available in the ble_sensor_touch folder.
    • The user might need a smartphone application to explore the full feature set of Bluetooth Low Energy application examples.