This page provides instructions for exercising the RapidHA serial interface for sleep control, as well as guidelines for validating the current draw of the MMB Z357PA2x or Z357PA4x modules while the application transitions through sleepy to waking states.
The following items are required to execute the steps described in this guide.
Minor modifications to the Module are required such that it may be powered by an external 3.3V supply. This ensures accurate current draw measurements that are not influenced by external components on the fixture (e.g. LED's, USB, etc.).
The following pins on the Module must to have test points added as follows:
Once modified, the Module should be loaded into the MMB Programming Fixture for configuration, after which it will once again be removed ahead of current draw testing.
Please ensure that the power supply is able to handle an increase in current draw upon the Module waking, as the application will immediately poll the network.
Please see Startup Synchronization for a detailed overview of the Host to Module serial configuration process.
Please see Device Type Configuration for a detailed overview of available device types and their configuration. This tutorial focuses on the Reduced Function Device (RFD) configuration required for Sleepy End Devices.
There are two ways you can configure the device as a Sleepy End-Device, which are described in subsequent sections:
The Module may be loaded into an MMB Programming Fixture to facilitate a serial USB connection to a PC or Mac. Using the RapidHA Desktop tool, the Module may be configured as a Sleepy End Device using one of the methods detailed below.
An XML configuration file may be defined with the following entry for the Device Type Configuration, which will configure the device as a sleepy end-device:
<deviceType> <reducedFunctionDevice>true</reducedFunctionDevice> <sleepy>true</sleepy> </deviceType> |
This configuration file may then be selected on establishing a connection with the Module with RapidHA Desktop.
You can download an example xml file for a fan controller here.
Another way of configuring the module as a sleepy end-device, is to issue a Device Type Write, with the correct Sleepy and End-Device values in its payload, while configuring the module during the Startup Synchronization phase.
For example, if you issue a Device Type Write frame (PH: 0x03, SH: 0x00) with the following 2-byte Payload: 0x01 0x01, you will configure the module as a Reduced Function Device (RFD) configured in a Sleepy mode.
On successful completion of configuration, the device will exhibit one of the following behaviours:
The following Sleep Control frames have been added to the Utility command group (PH: 0x55) in RapidHA v1.7.0.
Primary Header | 0x55 |
---|---|
Secondary Header | 0xA0 |
The Sleep Control Wakeup frame is issued by the Host to the Module to wake the application when it is sleeping. On reception, the application will stay awake for a default duration of 50ms. It is expected that the Host will stuff the 19-byte payload with all 0xFF’s.
The Host may then either send a serial message within the 50ms wake window or issue the Sleepy Control Stay Awake Duration Write command to force the application stay awake for a longer specified duration.
Byte Index | Field Name | Notes |
---|---|---|
0.. 18 | Filler Bytes | Stuff all payload bytes with 0xFF |
Primary Header | 0x55 |
---|---|
Secondary Header | 0x58 |
The Sleep Control Stay Awake Duration Write command is issued by the Host to the Module and serves to impose a duration for which the application will stay awake. This allows the Host to override the standard sleep cycle of the application when desired.
Specifying a Stay Wake Duration of 0 will return the application to the sleep state upon the subsequent application tick, provided there are no pending tasks.
Bytes | Field Name | Notes |
---|---|---|
0.. 3 | Stay Awake Duration | The duration for which the application should stay awake, in milliseconds. A value of 0 will return the application to the sleep state upon the subsequent application tick, provided there are no pending tasks. |
Primary Header | 0x55 |
---|---|
Secondary Header | 0x59 |
The Sleep Control Stay Awake Duration Read command is issued by the Host to the Module to query the Stay Awake Duration of the application. The command has no payload.
Primary Header | 0x55 |
---|---|
Secondary Header | 0x5A |
The Sleep Control Stay Awake Duration Read Response is issued by the Module to the Host in response to a Sleep Control Stay Awake Duration Read command. It conveys the remaining Stay Awake Duration of the application, in milliseconds.
Bytes | Field Name | Notes |
---|---|---|
0.. 3 | Stay Awake Duration | Remaining stay awake duration in milliseconds at the time the Read query was received. |
The following section will demonstrate an example of using the new serial interface for interacting with a Sleepy End-Device.
The following steps may be taken to measure the current draw of the Module in the Sleep and Awake states.
The following screenshot shows current draw during network transmission:
{style} .wiki-content h1 { font-family: 'Helvetica Neue', sans-serif; font-size: 30px; font-weight: bold; color: #20b6e1; letter-spacing: 1px; line-height: 1; text-align: left; #border-bottom: 1px solid #98bddd !important; } .wiki-content h2 { font-family: 'Helvetica Neue', sans-serif; font-size: 20px; font-weight: normal; color: #00517f; letter-spacing: 1px; line-height: 1; text-align: left; } .wiki-content h3 { font-family: 'Helvetica Neue', sans-serif; font-size: 15px; font-weight: bold; color: #00517f; letter-spacing: 1px; line-height: 1; text-align: left; } .wiki-content h4 { font-family: 'Helvetica Neue', sans-serif; font-size: 15px; font-weight: normal; font-style:italic; color:#00517f; letter-spacing: 1px; line-height: 1; text-align: left; } #title-text{ font-family: 'Helvetica Neue', sans-serif; font-size: 40px; font-weight: 500; letter-spacing: 1px; line-height: 1; text-align: left; } .panel, #content .panel { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } .panel .panelHeader { text-align: left; color: #FFFFFF; line-height: 1em; padding: 10px 10px 5px; margin-bottom: 0; background-color: #00517f; -moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px; border-top-right-radius: 5px; border-top-left-radius: 5px; color:#FFFFFF } {style} |