Skip to content

This example demonstrates on how to configure RNBD451 in Host-less mode and create a wireless alarm application. This application uses WBZ451 Curiosity board as the central device.

Notifications You must be signed in to change notification settings

MicrochipTech/RNBD451_HOSTLESS_MODE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RNBD451_HOSTLESS_MODE

"IoT Made Easy!"

Devices: | RNBD451 | WBZ451 |
Features: | BLE |

⚠ Disclaimer

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.

Contents

  1. Introduction
  2. Bill of materials
  3. Software Setup
  4. Hardware Setup
  5. Harmony MCC Configuration
  6. Board Programming
  7. Run the demo

1. Introduction

This application demonstrates the RNBD451 remote command feature. This feature allows the control of an RNBD451 module without the use of a host microcontroller remotely from either another RNBD451 module or a mobile application.

The remote command feature works by using a special BLE GATT service that emulates a wireless serial connection called transparent UART mode. This combined with a unique command set allows remote functionality of the module. Please check this link for further details.

This example demonstrates on how to configure RNBD451 in Host-less mode and create a wireless alarm application. This application uses WBZ451 Curiosity board as the central device. On initialization the WBZ451 device will establish a secure and bonded BLE connection with the remote RNBD451 module and will be in Remote Command mode of the RNBD451 Remote/host-less Module. Once there is a button press on WBZ451 board the LED and the solenoid connected to the RNBD451 Host-less device will be switched on/off.

2. Bill of materials

TOOLS QUANTITY
RNBD451 Add On Board 1
WBZ451 Curiosity Board 1
Solenoid lock 1
DC 3V Relay High Level Driver 1
RGB LED 1

3. Software Setup

  • MPLAB X IDE

    • Version: 6.20
    • XC32 Compiler v4.40
    • MPLAB® Code Configurator v5.7.1
    • PIC32CX-BZ_DFP v1.4.243
    • MCC Harmony
      • csp version: v3.19.5
      • core version: v3.13.5
      • CMSIS-FreeRTOS: v11.1.0
      • CMSIS_5: v5.9.0
      • wireless_pic32cxbz_wbz: v1.4.0
      • wireless_ble: v1.3.0
      • wolfssl version: v5.4.0
      • crypto version: v3.8.2
  • Any Serial Terminal application like TERA TERM terminal application

  • MPLAB X IPE v6.20

4. Hardware Setup

  • In the RNBD451 Add on Board, the gpio pins are not brought out. For this application, the GPIO pin PA0 in the Remote module is connected to an NC pin on the Mikro Bus header. Using the relay we have connected the Solenoid by giving the Gpio pin(PA0) as Input to the relay. And in the same manner Gpio pin(PA0) is given to the Green line of the RGB Module.

5. Harmony MCC Configuration

Getting started with the RNBD Hostless application in WBZ451 Curiosity board

Tip New users of MPLAB Code Configurator are recommended to go through the overview

Step 1 - Connect the WBZ451 Curiosity board setup to the device/system using a micro-USB cable.

Step 2 - Create a new MCC Harmony project.

Step 3 - The "MCC - Harmony Project Graph" below depicts the harmony components utilized in this project.

  • From Device resources, go to Wireless->Drivers->BLE and select Transparent Service. Accept Dependencies or satisfiers, select "Yes". Select Transparent Profile.

  • From the project graph, select BLE Stack. The configuration is depicted as follows.

  • From Device resources, go to Library->Harmony->Peripherals->SERCOM and select SERCOM0. Right click on the "⬦" on UART and select STDIO. The configuration is depicted as follows.

  • From Device resources, go to Library->Harmony->Peripherals->EIC and select EIC. The configuration is depicted as follows.

  • From the project graph, select System. The configuration is depicted as follows.

  • From Device resources, go to Library->Harmony->Wireless->System Services and select APP_TIMER_SERVICE.

  • From project graph, go to Plugins->PIN configuration and configure as follows.

Step 4 - Generate the code.

Step 5 - Copy the mentioned files from this repository by navigating to the location mentioned below and replace it your project folder.

Note This application repository should be cloned/downloaded to perform the following steps.
Path firmware/src
  • Copy the "app_ble" folder, "app_timer" folder, "app.c" and "app.h" which can be found by navigating to the following path: "...\firmware\src"
  • Paste the folder under source files in your project folder (...\firmware\src).

The user can achieve the Remote Command mode control functionality by making use of the transparent UART service. To get into the Remote Command mode from a central device, the following steps need to be performed.

  • The two devices must be connected using a secured and bonded connection.

  • The user has to send the below command via Transparent Control characteristic to make the RNBD451 to enter into the RMT mode.

  • Send an hex “0x59” first and then followed by the PIN code in hex to enter RMT mode. Please refer "APP_MSG_BLE_ENT_RMT_MODE" in "app.c" for implementation.

  • Send an hex “0x46” first and then followed by the PIN code in hex to enter RMT mode. Please refer "APP_MSG_BLE_EXT_RMT" in "app.c" for implementation.

Step 6 - Clean and build the project. To run the project, select "Make and program device" button.

6. Board Programming

Program the precompiled hex file using MPLAB X IPE

  • The application hex file can be found 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.

Build and program the application using MPLAB X IDE

Follow the steps provided in the link to Build and program the application.

To configure the RNBD Remote module

  • Power the RNBD451 Add-on board via external supply and place the Power select Jumper accordingly.
  • Connect RNBD Add-on board to your Mobile phone using a C type cable.
  • Follow the below steps to configure the remote module

Step 1 – Enter command mode

  • Input Command: $$$

  • Expected response:CMD>

Step 2 – Set to Factory defaults

  • Input Command:SF,2

  • Expected response: Reboot after Factory Reset

  • %REBOOT%

Step 3 – Enter command mode

  • Input Command: $$$

  • Expected response: CMD>

Step 4 – Set advertising data of the module to "DAFEFF10"

  • Input Command:NA,Z

  • Expected response : AOK

  • CMD>

  • Input Command:NA,16,DAFEFF10

  • Expected response : AOK

  • CMD>

Step 5 – Enable authentication/security

  • Input Command:SA,0

  • Expected response: AOK

  • CMD>

Step 5 – Save and reboot

  • Input Command:R,1

  • Expected response: Rebooting

  • %REBOOT%

7. Run the demo

  • Once the Remote module is configured, Connect the WBZ451 Curiosity Board.
  • On power up the WBZ451 device starts a Secure a and Bonded connection.
  • Once connected, by pressing the user button on the WBZ451 Board the user can control the RGB Led/Solenoid connected to RNBD device.

About

This example demonstrates on how to configure RNBD451 in Host-less mode and create a wireless alarm application. This application uses WBZ451 Curiosity board as the central device.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published