Rapid Prototyping with 32-bit MCU-based Curiosity Nano Evaluation Kit Using MPLAB Harmony v3 Software Framework: Step 8

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

Build and Program the Application

Clean and Build

Clean and build your application by clicking on the Clean and Build Clean and Build Icon  button.

If you encounter compilation errors, recheck the steps and build the project again.

Back to Top


Program the Device

Program your application to the device by clicking on the Make and Program Make and Program Icon button.

Back to Top


Install Android App

Before proceeding, install the Microchip Bluetooth Data Android app on an Android smartphone.

Back to Top


Enable Location Services

Enable Bluetooth and location services from your smartphone settings.

Back to Top


Reset the Device

Perform a reset by unplugging and re-plugging the PIC32CM MC00 Curiosity Nano Evaluation Kit power cable.

Back to Top


Turn on Bluetooth

Open the Microchip Bluetooth Data (MBD) Android app from your smartphone and tap on the BLE UART icon on the dashboard. If prompted, allow the application to turn on Bluetooth.

Open the Microchip Bluetooth Data (MBD) Android app from your smartphone and tap on the BLE UART icon on the dashboard

Back to Top


Scan for Devices

Now, scan for Bluetooth devices by tapping BM70 > SCAN > SCAN options on the MBD APP.

Tap BM70 to open Scan

Tap Scan to scan the devices around you

Press Scan again

Back to Top


List Bluetooth Devices

The BM71 device will appear as TransparentUARTDemo in the list of Bluetooth devices.

The BM71 device will appear as TransparentUARTDemo in the list of Bluetooth devices

Once you see the TransparentUARTDemo device, click on the CANCEL button to cancel the device scanning.

Click on the CANCEL button to cancel the device scanning

Back to Top


Connect

Tap on TransparentUARTDemo to connect to the device

Tap on TransparentUARTDemo to connect to the device

Transfer data to device

Back to Top


Transfer Data

Once the device is connected, tap on Transfer data to device to build the communication interface between the demo application and MBD App.

Tap on Transfer data to device to build the communication interface between the demo application and MBD App

Back to Top


Configuration

Enable Write with Response by clicking on the OFF button at the bottom of the MBD APP screen.

Enable Write with Response by clicking on the OFF button at the bottom of the MBD APP screen

Write with response is now on

Back to Top


Send Commands

Send the commands mentioned in the demo description to control the fan. The commands mentioned in the demo description are not case-sensitive.

Send the commands mentioned in the demo description to control the fan

The commands mentioned in the demo description are not case-sensitive

Back to Top


Fan Control

The fan will be controlled based on the command received from the MBD application.

  • When the user chooses temperature based Fan Control mode, the application reads the temperature values from a weather sensor, displays them on the EInk display, and controls a DC fan

Back to Top

Results

You successfully created a smart appliance control application and observed that the application enabled control of a smart appliance through a BLE-based Android smartphone. In the first method, a 5 V DC fan is controlled based on the room temperature value. The room temperature and the fan's speed are also displayed on a low-power consuming display. In the second method, based on the command exercised by the user on the Android smartphone app, the fan operation was controlled.

Analysis

In this lab, you quickly and successfully extended an application built using MPLAB® Harmony v3 on a PIC32CM MC00 microcontroller. Your application used all the fundamental elements that go into making a real-time application. In this application, you used MPLAB® Harmony Configurator (MHC) to configure a PIC32CM MC00 device and used the MPLAB Harmony v3 Framework. You used the clock configurator to set up the CPU clock. You configured SERCOM0 (I2C), SERCOM1(USART), SERCOM3(SPI), and PORT peripheral libraries. You also configured and used the BM71 driver, Timer System Service. Lastly, you used the pin configurator to set up the pins for the peripheral functions.

Conclusions

This lab provided you training for configuring and using all the fundamental components needed to build a real-time application on a PIC32CM MC00 microcontroller with the MPLAB Harmony v3 Framework. As a next step, you may customize this application and reconfigure some of the components used in this tutorial.