Cypress, the Cypress Logo, PRoC, and WirelessUSB are trademarks or registered trademarks of Cypress Semiconductor
Corporation. Windows is a registered trademark of Microsoft Corporation. All other product or company names used in this
manual may be trademarks, registered trademarks, or servicemarks of their respective owners.
Any Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by
and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty
provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create
derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as specified in the applicable agreement. Any reproduction, modification, transla tion, compilation, or representation of this Source
Code except as specified above is prohibited without the express written permission of Cypress.
Disclaimer
CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes without furthe r notice to the materials described herein.
Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress
does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user . The inclusion of Cypress ' product in a life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges.
Use may be limited by and subject to the applicable Cypress software license agreement.
This document was written for firmware an d hard ware develop ers th at want to und erst a nd an d make
modifications to the PRoC™ LP KBM Reference Design Kit (RDK).
This document provides a description of the hardware along with architecture and configuration
options for the PRoC LP KBM RDK.
1.2Chapter Overviews
Table 1-1. Overview of the CY4672 Reference Design Guide Chapters
ChapterDescription
Introduction
(on page 9)
WirelessUSB™ Protocol 2.2
(on page 13)
Mouse
(on page 33)
Keyboard
(on page 51)
Bridge
(on page 75)
Manufacturing Test Support, MTK
(on page 101)
Regulatory Testing Results
(on page 105)
Power Considerations
(on page 107)
Software Guide
(on page 111)
Describes the purpose of this guide, overviews each chapter, supplies
product support information, and lists documentation conventions.
Presents an overview of the radio channel management and pseudo
noise code. Lists the protocol modes, packet structures, bind and reconnect timing, signature byte and the encryption methods.
Discusses the design features, hardware, firmware architecture, and the
development environment.
Describes the design features, hardware, firmware architecture, modifying the keyboard matrix or adding new keys, and the development environment.
Describes the design features, hardware, firmware architecture, USB
interface, and the development and debut environment.
Details the MTK block diagram, MTK serial protocol, MTK RF protocol,
MTK DUT source code porting, and accessing MTK in the DUT.
Describes all EMC test results.
Details the usage mode, current measurments, and battery life calcula-
tions for both the RDK keyboard and RDK mouse.
Describes software code modules and the development environment.
1.3Support
Technical Support can be reached at http://www.cypress.com/support or can be contacted by phone
at: 1-800-541-4736.
The WirelessUSB™ protocol 2.2 is designed to address 2-way Human Interface Devices (HID) as
well as general purpose devices; it provides reliable 2-way communication between a wireless
device configured as 1:1 (one HID and one bridge) or 2:1 (two HIDs and one bridge) systems. The
WirelessUSB protocol 2.2 allows HID applications to establish a connection to the bridge and
receive ACK and DATA packets from the bridge.
WirelessUSB uses the unlicensed 2.4 GHz Industrial, Scientific, and Medical (ISM) band for wireless
connectivity. WirelessUSB uses 78 of the available channels and splits the 78 channels into 6 channel subsets consisting of 13 channels ea ch. T h e channel subsets are used by each n et wor k t o m in i mize the probability of interference from other WirelessUSB systems (see the Channel Selection
Algorithm on page 15 section for more details). A designated channel subset is used during bind
mode (along with an associated pseudo noise code) in order to enable all WirelessUSB devices to
effectively communicate during this procedure.
Pseudo noise codes (PN codes) are the codes used to achieve the special matched filter characteristics of direct sequence spread spectrum (DSSS) communication. Certain codes referred to as ‘multiplicative codes’ are used for WirelessUSB 2-way communication. These codes have minim al crosscorrelation properties, meaning they are less susceptible to interference caused by overlapping
transmissions on the same channel. The length of the PN code results in different communication
characteristics. Higher data rates are achieved with 32-chips/bit PN codes, while 64-chips/bit PN
codes allow a longer range. The number of frequency/code pairs is large enough to comfortably
[+] Feedback
WirelessUSB™ Protocol 2.2
accommodate hundreds of WirelessUSB devices in the same space. Each bridge/HID pair must use
the same PN code and channel in order to communicate with each other.
2.1.3Chip Error Correction
In the presence of interference (or near the limits of range), the transmitted PN code will often be
received with some PN code chips corrupted. DSSS receivers use a data correlator to decode the
incoming data stream. WirelessUSB LP supports a separate start of packet (SOP) and data threshold. The RDK uses an SOP threshold of ‘4’. The data threshold is set to the default value of ‘4’.
2.1.4Automatic Acknowledgment (AutoACK)
The WirelessUSB LP radio contains an autom atic acknowledgment feature that allows it to automatically send an ACK to any valid packet that is received. The WirelessUSB LP radio also uses the
concept of transactions to allow the radio in the HID to automatically power down after transmitting a
packet and receiving an AutoACK instead of waiting for the firmware to power the radio down. This
conserves power and reduces the firmware complexity of WirelessUSB applications.
2.1.5Network ID
The network ID contains the parameters for the channel selection algorithm as well as the PN code
to be used. HIDs retrieve the network ID information from the bridge during the bind procedure. A
special network ID is reserved for bind mod e, known as the bind ID. The bind ID gives a common
channel subset so that any two devices can communicate with each other during bind mode. The
network ID is composed of the following fields:
PINThis is a random number between 2–5 that defines the channel subset and is
used in the channel selection algorithm.
Base ChannelThis is the first channel to be used in the channel selection algorithm, that deter-
mines which channels are contained in the channel subset.
PN CodeThis is used as an index to select one of 10 used SOP PN codes, as noted in the
radio driver document.
CRC SeedThis 8-bit value is used for the CRC calculation, that further diversifies transmis-
sions from different networks. All packets sent between non-bound devices use
the default CRC seed of 0x0000. All packets sent between bound devices use a
CRC seed that is common to all devices bound to a particular bridge or network
but unique from network to network.
2.1.6Manufacturing ID
Each WirelessUSB radio contains a 4-byte manufacturing ID (MID), that has been laser fused into
the device during manufacturing. The bridge uses its MID to help randomize channel subsets, PN
codes and network CRC seeds. The bridge sends its MID to the HIDs when binding. The HID then
stores the bridge’s MID in non-volatile memory after binding. The HID sends the bridge’ s MID as p art
of the connect request packet, allowing the bridge to verify the identity of the HID when establishing
a connection.
Both the bridge and the HID use the bridge’ s MID as to generate the device network ID compon ent s.
The following equations ensure that each network will have a unique set of network ID components:
The channel selection algorithm produces a subset containing 13 of the possible 78 channels. The
channel selection algorithm is based on the network ID, with each channel in the subset being six
megahertz from the nearest neighboring channels in the subset. This algor ithm r educes the possibility of multiple bridges selecting the same channels in the same order at the same time.
Ping mode is used by the bridge to find an available channel; channels are unavailable if they are
being used by another network with the same PN code, or if there is excessive noise on the chann el.
The bridge first listens for activity on the selected chan nel. If the chan nel is inactive the bridge alter nately transmits ping packets and listens for ping response packets for a defined* period of time.
During ping mode the bridge also checks the Receive Signal Strength Indicator (RSSI) of the radio in
order to determine if a non-WirelessUSB device is using this channel (or a WirelessUSB device on
the same channel using a different PN code). If a ping response is received, indicating that another
bridge is using this channel the bridge selects the next channel using the ch annel selection algor ithm
and repeats this procedure. The bridge also selects another channel using the channel selection
algorithm if RSSI is high; this indicates that there are other RF sources on the ch annel. If a ping
response is not received and RSSI is low, the bridge assumes the ch annel is available a nd moves to
data mode. Bridges send ping response packets in response to all received ping packets if the
bridge is in data mode. HIDs never respond to ping packets.
[*The timeout value is configurable using the PING_NUM_RSSI define.]
The HID enters this mode after a power on reset before it has had any communication with the RDK
bridge. If the bridge’s MID is stored in non-volatile memory the HID r etrieves the bridge’s MID, calculate the network ID and move to reconnect mode. If the bridge’s MID is not stored in non-volatile
memory the HID waits in idle mode until a user-initiated event causes the HID to enter bind mode.
After a defined period of time in idle mode the HID goes to sleep in orde r to conserve power. When
the HID wakes up due to a user action, it re-enters Idle mode.
2.2.3Reconnect Mode (HID only)
Reconnect mode is used by the HID to discover the current channel used by the bridge and to establish a connection with the bridge. Upon entering reconnect mode the HID uses the network ID to
select a channel using the channel selection algorithm. The HID transmits ‘connect requests’ containing the manufacturing ID of the desired bridge and listens for an AutoACK. If an AutoACK is
received the HID disables the AutoACK and continues to listen for a ‘connect response’. If a bridge
in data mode receives a ‘connect request’ containing its manufacturing ID, it sends a positive ‘connect response’ to the HID. If a HID receives a positive ‘connect response’ it moves to data mode. If a
HID does not receive a positive ‘connect response’, it selects the next channel using the channel
selection algorithm and repeats the procedure. If the HID does not receive a positive ‘connect
response’ on any of the channels in the subset, it enters goes to sleep in order to conserve power.
When the HID wakes up due to a user action it reenters reconnect mode.
WirelessUSB™ Protocol 2.2
2.2.4Button Bind Mode
HID
Bind mode allows the HID to retrieve the bridge’s manufacturing ID which is used to calculate the
network ID. Upon entering bind mode the HID sets the current channel and PN code to the channel
and PN code specified in the bind ID. The HID then transmits bind requests and listens for an
AutoACK. If an AutoACK is received, the HID (keeping the AutoACK enabled) continues to listen for
a bind response (containing the br idge’s MID) from the bridge. If a bind response is not received, the
HID moves to the next channel. If a bind response is received, the HID stores the bridge’s MID, calculates the network ID, and moves to reconnect mode. The algorithms used to calculate these fields
are implementation specific and should be the same on the bridge and th e HID (both devices use the
bridge’s manufacturing ID to calculate these fields). If a defined* period of time has elapsed while in
bind mode without receiving a bind response, the HID exits bind mod e and re sto res the chann el and
PN code settings that were in use prior to entering bind mode. Bind mo de should last long e nough
for the user to locate and push the button on both the bridge and the HID. A user-initiated event can
cause the HID to enter bind mode from any other mode.
[*The timeout value is configurable using the BIND_RETRY_COUNT define.]
Bridge
Upon entering bind mode the bridge sets the current channel and PN code to the channel and PN
code specified in the bind ID. The bridge listens for a bind request on each channel for approximately 320 ms before selecting the next channel using the channel selectio n algorithm. This reduces
the possibility of the bridge not receiving the bind request from the HID in the event of channel interference. If the bridge receives a bind request from the HID containing a supported device type, it
sends a bind response containing the bridge’s manufacturing ID and then switches to ping mode.
The bridge also switches to ping mode if the defined* time period has elapsed while in bind mode.
The channel selection algorithm uses the bind ID to produce the channel subset for bind mode.
[*The timeout value is configurable using the NUM_CHANNELS_PER_SUBSET define.]
KISSBind provides the ability to automatically bind out of the box without any intervention by the
user other than installing the batteries. KISSBind essentially is a bind process while in the data
mode. The bridge goes through the normal pr ocess of p ingin g and then go ing to the da ta mode. The
device upon powering up and determining that it is not bound , transmits KISS_BIND_REQ packets
on all channels and PN codes looking for a bridge that has not been bound to that specific device.
The bridge keeps track of which device is connected and only responds with a KISS_BIND_RESP
packet if it is not already bound to that specific device. Once bound, the bridge stores the device
specific state in Flash.
HID
When the HID first powers up it checks the validity of the flash bind parameters. If the bind parameters checksum is not valid then the HID is considered to be un-bound. The HID then transmit s KISSBind request packets on all channels and PN codes using a CRC seed of ze ro in or der t o loca te the
bridge. If an AutoACK is received the HID enters the receive state to listen for a KISSBind response
packet from the bridge. The HID completes the KISSBind process if a KISSBind response packet is
received from the bridge. If, after RX_PACKET_TIMEOUT (ms), the HID does not receive from the
bridge it then resumes the channel/PN code search for the bridge. If the search sequence is unsuccessful after BIND_RETRY_COUNT attempts, then the HID enters a low power state waiting for a
button press or other activity and begin the search process all over.
Bridge
The bridge, upon powering up, enters the ping mode in order to locate a suitable channel/PN code
based on its MID. When the ping mode is complete the bridge then enters the data mode. If a KISSBind Request packet is received, the bridge checks the bind status for the specific device that sent
the KISSBind request (mouse or keyboard) based on the device type in the packet header. If the
specific device has not been bound then the bridge proceeds by sending a KISSBind response
packet and completing the KISSBind process. Once an AutoACK is received from the HID in
response to the KISSBind response, the bridge updates the Flash bind status for the specific device.
An ‘unbind’ mechanism allows the bridge and HIDs to return to their default unbind mode as if they
had never bound to any system before.
The bridge dedicates a bind flag to each device type that it supports. A bind flag is a 1-bit field in
Flash. Once the bridge has been bound to an HID by either KISSBind or button bin d mechanism, the
bridge sets the corresponding bind flag for that device type and stores the flag in its Flash.
If the bind flag for a particular device type is se t, the bridge treats future KISSBind packets from this
device type as nonfunctional packets.
The bridge unbind process clears all bind flags, and the bridge allows devices to KISSBind.
The HID dedicates a byte in its Flash, called SIGNATURE, to indicate whether or not the HID has
bound to a bridge before. The SIGNATURE is set to 0x90 after a successful KISSBind or button
bind. If the SIGNATURE is not set to 0x90, the HID tries to KISSBind to any bridge in the area that
allows the HID to KISSBind. Once the SIGNATURE is set, the HID does not attempt to KISSBind.
Note Once the HID enters unbind mode, p ower-cycle the HID to exit this mode. Once the bridge is
unbound, the bridge continues to communicate with any HID that already has the bridge MID. In
order to completely unbind the system, the HIDs and bridge must be unbound.
2.2.7Data Mode
HID
When the HID application has data to send to the bridge the HID transmits a DATA packet and listens for an AutoACK. If an AutoACK is not received, the HID retransmits the packet. If the HID does
not receive an AutoACK after N DATA_PACKETS_RETRIES of retransmissions of the data packet it
assumes the channel has become unavailable due to excessive interference and moves to reconnect mode.
Bridge
Data mode allows application data to be transmitted from the HID to the bridge. The bridge continuously listens for data packets from the HID. When valid data is received from the HID the bridge
sends an ACK to the HID and sends the data to the USB host. If invalid data is received the bridge
ignores the packet and listens for the HID to retransmit the data. The bridge monitors the interference level and moves to ping mode if the RSSI interference threshold RSSI_NOISE_THRESHOLD
is reached. This ensures that the bridge is operating on a clean channel.
2.2.8Back Channel Data Support
Back channel data support provides a mechanism for the host to send data to the device at the
request of the device. The device is responsible for interrogating the bridge for back channel data
either as part of a forward data p acket or a simp le null p acket. The device st art s by setting the BCDR
bit in the data header. If the packet is successfully acknowledged by the bridge then the device
inverts the upper byte of the checksum seed an d the n wait for N ms before tr yin g to receive from th e
bridge for M ms. The bridge also inverts the checksum seed and wait N ms before attempting to
transmit to the device. If the bridge has more data to send then it can also set the BCDR flag and can
then expect the device to receive another packet.
Dynamic data rate and dynamic PA provide the ability to improve the immunity to interferenc e and
reduce power consumption. Dynamic data rate is device be havior based and two d ata mod es, GFSK
and 8DR, are used for the data transmission. Depending on the retry number of prior packets, the
protocol determines whether to stay with the current data mode or change to another data mode.
The dynamic PA relies on both the behavior and the bridge signal strength to the device.
HID
Dynamic Data Rate
If the HID fails to transmit either the application or protocol data to the bridge after
DATA_PACKET_RETRIES of retransmissions, it will toggle data modes and transmit again. If the
HID still fails after DATA_PACKET_RETRIES of retransmissions, it assumes the channel has
become unavailable due to excessive interference and moves to reconnect mode.
If the HID transmits application data successfully, the retries for PKT_NUM packets are summed up
in ‘total_retry’. If the total_retry exceeds the threshold ‘total_retry_threshold’, the HID changes to
another data mode.
The total_retry_threshold is an adaptive number that has a minimum value of
TOTAL_RETRY_THRESHOLD_LOW . The following rules are applied to it:
■ When the data mode is toggled, the total_retry for the previous data mode will be used as current
total_retry_threshold.
■ If the total_retry is zero, the total_retry_threshold will be decreased one until
TOTAL_RETRY_THRESHOLD_LOW.
Dynamic PA
If the total_retry is zero and the RSSI reading for the bridge AutoACK packet is above
PA_RSSI_RX_THRESHOLD, the PA is decreased by one until DATA_MODE_PA_MIN.
When one of the following cases occurs, the PA will be set back to its maximum value of
DATA_MODE_PA_MAX:
■ The data mode is toggled.
■ The RSSI reading for the bridge AutoACK packet is equal to or below
PA_RSSI_RX_THRESHOLD.
■ The retries for any packet exceeds PA_RETRY_THRESHOLD.
Bridge
The bridge does not need to implement the dynamic PA because it is bus powered. Its PA is always
set to the maximum value DATA_MODE_PA_MAX in order to get the highest transmission power.
The dynamic data rate is driven by the devices. When the bridge receives the packet, it sets the
transmission data mode to the data mode of received packet. As a result, when it sends the back
channel data, it uses the same data mode as the device.
The first byte of each packet is the Header byte. Some packets may consist only of the header byte
while other packets may contain up to five bytes.
Byte1
Bits:7:43:0
Field:
Type[7:4]: The following packet types are supported:
Packet
Type
Reserved
BIND_REQ (HID) = 0x0, // Bind Request Packet Type
BIND_RESP (bridge)= 0x0, // Bind Response Packet Type
CONNECT_REQ = 0x1, // Connect Request Packet Type
CONNECT_RESP= 0x2, // Connect Response Packet Type
PING_PACKET = 0x3, // Ping Packet Type
DATA_PACKET = 0x4, // Data Packet Type
WirelessUSB™ Protocol 2.2
BACK_CHANNEL_PACKET= 0x5, // Back Channel Packet Type
NULL_PACKET = 0x7, // Null Packet Type
ENCRYPT_KEY_REQ= 0x8, // Key Packet Type for encryption
ENCRYPT_KEY_RESP= 0x8, // Key Packet Type for encryption
KISS_BIND_REQ= 0xD, // KISSBind request
KISS_BIND_RESP= 0xD, // KISSBind response
Res[3:0]: The lower nibble is used for packet specific information. The packet definitions below
define how these four bits are used in each case.
2.3.1Bind/KISSBind Request Packet (HID)
Byte1
Bits:7:432.10
Field:0/0DReserved
Byte 1
Packet Type: 0 for bind request and 0xD for KISSBind request.
Device Type: This is a 2-bit field that specifies a vendor-defined device type. This allows the bridge
to determine HID type.
Device
Type
Reserved
Currently the following device types have been defined in the PRoC™ LP RDK:
0x0Presenter
Packet Type: 0 for bind request, 0xD for KISSBind request
Device Type: This is a 2-bit field that specifies a vendor-defined device type. This allows the bridge
to determine HID type.
Currently the following device types have been defined in the KBM RDK:
0x0Presenter
0x1Reserved
0x2Keyboard
0x3Mouse
Byte 2-5
ReservedBridge
MID1
Bridge
MID 2
Bridge
MID 3
Bridge
MID 4
Manufacturing ID (MID 1–MID 4): This is the 4-byte manufacturing ID retrieved from the bridge’s
radio and will be used by the HID.
2.3.3Connect Request (HID)
Byte12345
Bits:7:432:107:07:07:07:0
Field:1Reserved
Device
Type
Reserved
Byte 1
Device Type: 0x1
Byte 2-5
Manufacturing ID (MID 1–MID 4): This is the 4-byte MID that was received from the bridge durin g the
bind procedure. This enables the bridge to identify if the HID belongs to its network.
2.3.4Connect Response Packet (Bridge)
Connect response packets are sent from the bridge to the HID in Idle and data mode in response to
valid connect requests.
Byte1
Bits:7:432:0
Field:2FlagReserved
Bridge
MID 1
Bridge
MID 2
Bridge
MID 3
Bridge
MID 4
Byte 1
Packet Type: 2
Flag (F): This is a 1-bit field that specifies a positive or negative connect response packet
Packet Type: 3
Flag (F): This is a 1-bit field that specifies a ping or ping response (0 = Ping, 1 = Ping Response).
2.3.6Data Packet/Back Channel Data Packet (Bridge and HID)
Data packets are sent from the HID to the bridge in connected mode. They are als o sent from the
bridge to the HID in connected mode if there is an asynchronous back channel.
Byte12....N
Bits:7:432107:07:07:07:0
Field:4 / 5BCDRToggleDT0DT1Byte 1Byte N
WirelessUSB™ Protocol 2.2
Byte 1
Data Packet Type:
4 = Data Packet type
5 = Back Channel Packet Type
BCDR: This is a 1-bit field used to request back channel data. Setting this bit indicates to the bridge
that the HID will be listening for data following the transaction.
Data Toggle Bit: This is a 1-bit field that is toggled for each new da ta packet. It is used to distinguish
between new and retransmitted packets.
Data Device Type 0/1: This is a 2-bit field that specifies a vendor-defined device type. This allows the
bridge to determine HID type. The two bits are swapped in order to be backward compatible. In most
cases the data device type is the same as the device type in the bind request and connect request.
However, they may differ when one device tries to simulate the other device, for instance, the keyboard simulates the mouse.
When the bind button on the bridge is pressed, the bridge goes into bind mode. In bind mode, the
bridge uses the bind ID to communicate with any HIDs that want to bind to the system (see section
Button Bind Mode on page 17 for more information on the bind ID). The bridge enables its receiver
and ‘listens’ for any bind request packets from the HID, starting from channel 0. The bridge listens for
approximately 320 ms on the channel, and if there is no bind request packet, it moves to the next
channel in the bind channel subset (the bind channel subset consists of channels 0, 6, 12, 18, 24 …
78). It takes the bridge approximately 4.16 seconds to sequentially ‘listen’ on all 13 channels of the
bind channel subset. The bridge repeats the process for up to five times before it times out and exits
bind mode (time out is approximately 21 seconds). If it receives a valid bind request packet, it immediately responds to the request with a bind response packet and exit the bind mode.
When the bind button on the HID is pressed, the HID goes into bind mode. While in bind mode, the
HID also uses the bind ID to communicate with the bridge. The HID sends a bind request packet and
listens for an AutoACK packet. If the HID does not receive the AutoACK, it moves to the next channel in the bind channel subset and repeats the bind request packet. It takes the HID approximately
23.4 ms to sequentially hop through all 13 channels of the bind channel subset, and the HID repeats
the process for up to 1000 times before it times out. Refer to Figure 2-6 Bind Timing Diagram.
Because the bridge’s and HID’s bind buttons may be pressed at different times, the HID and the
bridge could be on very different chan nels when the two are in bind mode . However, because the
HID ‘hops’ very quickly on all bind channels while the bridge stays relatively long on a channel, the
bridge and HID will have multiple opportunities of being on the same channel. As a result, binding
normally completes very quickly as soon as the bridge and the HID are both in bind mode (at 1.8 ms/
channel ‘hopping’ frequency of the HID and the bridge’s 320 ms/channel, the two will ‘meet’ on the
same channel at least 13 times in any 320 ms period).
The bridge uses the RSSI to determine the noise level on the channel. If the channel has become
noisy, the bridge moves to ping mode to find a quieter channel in its channel subset.
HID sends a connect request packet and liste ns for an AutoACK packet. If the HID receives the
AutoACK, it immediately enables its receiver and listens for the connect response packet from the
bridge. If the HID does not receive the AutoACK it selects the next channel using the channel selec-
When the HID loses connection with the bridge, it moves to reconnect mode to find the bridge. The
tion algorithm and repeats this procedure. As shown in the reconnect timing diagram below, the
reconnect attempt takes approximately 1.76 ms/channel. Th e HID mo ves thr ou gh its channel subset
up to 19 times before it times out and exits reconnect mode. The keyboard tries to send the data for
up to five seconds, and the mouse tries for two seconds, causing the HID to re-enter reconnect
mode multiple times if necessary.
Quiet channel found. Bridge will stay on this channel
Device lost connection .
Search for bridge in
the channel subset
Cycle 1Cycle 2Cycle 3Cycle 19
22 .88 m s
22.88 ms x 19 Cycles ~ 430 ms
1st Channel
in subset
2nd Channel
in subset
3th Channel
in subset
13th Channel
in subset
1 .76 m s1.76 ms1 .76 m s
1.76 ms x 13 Channels = 22.88 ms
Bridge
Device
Figure 2-7. Reconnect Timing Diagram
2.5Signature Byte
The PRoC LP RDK uses the Signature byte to determine if the HID has ever been bound to any
bridge before.
If the HID has never bound to a bridge, the non-volatile memory used to store the signature and the
bridge's MID data remains in its default value. Once the HID has bound to a bridge, the Signature
byte is set to 0x90 and the bridge's MID is also stored.
At power up, the HID reads the Signature and the MID bytes to determine its next action. If the Signature byte is 0x90, the HID uses the retrieved MID to calculate the networkID and moves to Reconnect mode. If the Signature byte is not 0x90, the HID goes to sleep, waiting for the user to initiate
the bind process.
WirelessUSB PRoC LP RDK supports Tiny Encryption Algorithm (TEA) and Advanced Encryption
Standard (AES) 128 to encrypt application data. Data packets may be encrypted for privacy. All
encrypted data packets must have a payload of 8 or 16 bytes depending on the method chosen; this
is the minimum block size for the encryption algorithm.
2.6.1TEA Encryption
Some of the features of TEA are:
■ 128-bit encryption key
■ 8-byte block size
■ Minimal RAM requirements
■ Small code size
■ Highly resistant to differential crypt analysis
In order to use the TEA algorithm both the bridge and HIDs must possess the data encryption key.
The bridge is responsible for creating the key, which is then shared with the HIDs. There are a variety of possible methods to share the key between the two devices. The key may be exchanged over
the WirelessUSB link using the encryption key request and encryption key response packets.
WirelessUSB™ Protocol 2.2
2.6.1.1TEA Key Management over WirelessUSB
After binding and connecting to the bridge, the HID transmits an encryption key request packet and
listens for an AutoACK followed by an encryption key response packet that contains the first half of
the data encryption key. The HID then uses the key encryption key (calculated from the bridge and
the HID MIDs) to decrypt the data encryption key. The HID repeats this process for the second half
of the data encryption key and stores the key in Flash. After rece iving both halves of th e data e ncryption key the HID may begin transmitting encrypted data to the bridge.
AES_Encrypt requires the two variables tx_packet and AES_Key to be set prior to the call. Each
contains a 16 byte (128 bit) value. At the completion of the function tx_packet ha s been encrypted inplace and contains the cipher text. AES_ Key is scheduled in- place during the e ncryption process, so
multiple calls to AES_Encrypt will each need to be proceeded with reloading of AES_Key.
AES_Decrypt is the same as the AES_Encrypt; rx_packet and AES_Key both need to be loaded
prior to each call. However there is one small difference (because the decrypt key schedule is in
reverse order), the decryption key is not the same as the encryption key. The key used by
AES_Decrypt is the same as the key left in the AES_Key field after an execution of AES_Encrypt.
This is the key after it has gone through ten rounds of Key scheduling.