"IOT Made Easy!"
Devices: | PIC32CXBZ6 | PIC32BZ6 |
Features: | BLE | SERVO |
THE SOFTWARE ARE PROVIDED "AS IS" AND GIVE A PATH FOR SELF-SUPPORT AND SELF-MAINTENANCE. This repository contains example code intended to help accelerate client product development.
For additional Microchip repos, see: https://github.com/Microchip-MPLAB-Harmony
Checkout the Technical support portal to access our knowledge base, community forums or submit support ticket requests.
- Introduction
- Bill of materials
- Software Setup
- Hardware Setup
- Harmony MCC Configuration
- Board Programming
- Run the demo
This project demonstrates a BLE-controlled 360° servo motor system built using the Microchip PIC32CXBZ6/PIC32BZ6 wireless MCU. It combines the PIC32CXBZ6 BLE stack with TCC-based PWM generation to control an MG996R servo motor through simple wireless commands such as start, stop, and reverse.

| Tools | Quantity |
|---|---|
| PIC32-BZ6 Curiosity Board | 1 |
| TowerPro MG996R 360° High Torque Servo Motor | 1 |
- The PWM pin from the MikroBUS™ header 1 of the PIC32-BZ6 Curiosity Board is connected to the servo motor’s PWM control pin, while the 5V and GND pins from the same header are used to power the servo motor. Refer to the image below.
-
- Version: 6.25
- XC32 Compiler v4.60
- MPLAB® Code Configurator v5.6.2
- PIC32CX-BZ6_DFP v1.2.17
- MCC Harmony
- wireless_pic32cxbz_wbz: v1.5.0
- csp version: v3.21.0
- core version: v3.14.2
- wireless_ble: v1.4.0
- wireless_system_pic32cxbz_wbz: v1.7.0
- CMSIS_5: v5.9.0
- FreeRTOS-Kernel: v11.1.0
-
Any Serial Terminal application like TERA TERM terminal application
| Tip | New users of MPLAB Code Configurator are recommended to go through the overview |
|---|
Step 1 - Connect the PIC32BZ6 Curiosity board to the device/system using a Type-C USB cable.
Step 2 - This application is built by using Peripheral Transparent UART as the building block. The changes made to the peripheral_trp_uart application is mentioned below.
| Note | The peripheral_trp_uart application repository can be cloned/downloaded from this link. |
|---|---|
| File path | wireless_apps_pic32_bz6/apps/ble/building_blocks/peripheral/profiles_services/peripheral_trp_uart/firmware/peripheral_trp_uart.X |
- From project resources, go to Harmony->Peripherals and select TCC0 and configure as follows.
- In the project graph, go to plugins and select pin configuration.
Step 3 - Generate the code.
Step 4 - Once generation is complete, the merge window will appear. Merge all the changes shown.
Step 5 - Copy the mentioned files from this repository by navigating to the location mentioned below and replace the generated files.
| Note | This application repository should be cloned/downloaded to perform the following steps. |
|---|---|
| Path | The application folder can be found in the following link |
-
Copy the following files from the cloned repo(...\firmware\src).
- "app.c" and "app.h"
-
In "app_user_edits.c", make sure the below code line is commented
- "#error User action required - manually edit files as described here".
-
Replace these entire files in your project folder location(...\firmware\src\app_ble).
Step 6 - Clean and build the project. To run the project, select "Make and program device" button.
- The Precompiled hex file is given in the hex folder. Follow the steps provided in the link to program the precompiled hex file using MPLABX IPE to program the pre-compiled hex image.
The application folder can be found by navigating to the following path:
- "firmware\peripheral_trp_uart.X"
Follow the steps provided in the link to Build and program the application.
- After programming the board, the expected application behavior is shown in the below video.





