Cypress CY4636 User manual

CY4636
WirelessUSB™ LP Keyboard Mouse
Reference Design Kit User Guide
Doc. # 001-70355 Rev. *A
Cypress Semiconductor
198 Champion Court
San Jose, CA 95134-1709
Phone (USA): 800.858.1810
Phone (Intnl): 408.943.2600
http://www.cypress.com

2 CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
Copyrights
Copyrights
© Cypress Semiconductor Corporation, 2011-2012. The information contained herein is subject to change without notice.
Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a
Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted
nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an
express written agreement with Cypress. Furthermore, 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 products in life-support systems application implies that the manufacturer assumes all risk of such
use and in doing so indemnifies Cypress against all charges.
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, translation, 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 further 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.
NX2LP is a trademark and EZ-USB is a registered trademark of Cypress Semiconductor Corp. All other trademarks or
registered trademarks referenced herein are property of the respective corporations.
Flash Code Protection
Cypress products meet the specifications contained in their particular Cypress PSoC Data Sheets. Cypress believes that its
family of PSoC products is one of the most secure families of its kind on the market today, regardless of how they are used.
There may be methods, unknown to Cypress, that can breach the code protection features. Any of these methods, to our
knowledge, would be dishonest and possibly illegal. Neither Cypress nor any other semiconductor manufacturer can
guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as ‘unbreakable’.
Cypress is willing to work with the customer who is concerned about the integrity of their code. Code protection is constantly
evolving. We at Cypress are committed to continuously improving the code protection features of our products.

CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A 3
Contents
1. Introduction 5
1.1 Kit Contents .................................................................................................................5
1.2 PSoC Designer™ ........................................................................................................5
1.3 PSoC Programmer ......................................................................................................5
1.4 Additional Learning Resources....................................................................................6
1.4.1 References.......................................................................................................6
1.5 Document History ........................................................................................................7
1.6 Documentation Conventions .......................................................................................7
2. Getting Started 9
2.1 Introduction ..................................................................................................................9
2.2 Kit Installation ..............................................................................................................9
2.3 PSoC Designer ..........................................................................................................13
2.4 PSoC Programmer ....................................................................................................14
2.5 Installation of Battery level and Link Quality Application ...........................................15
2.6 Install Hardware.........................................................................................................15
3. Kit Operation 17
3.1 Introduction ................................................................................................................17
3.2 Bridge ........................................................................................................................17
3.3 Mouse ........................................................................................................................19
3.4 Keyboard ...................................................................................................................21
4. Hardware 25
4.1 Bridge ........................................................................................................................25
4.1.1 Functional Description....................................................................................26
4.1.2 Power Supply System ....................................................................................32
4.2 Mouse ........................................................................................................................33
4.2.1 Functional Description....................................................................................34
4.2.2 Power Supply System ....................................................................................39
4.3 Keyboard ...................................................................................................................40
4.3.1 Functional Description....................................................................................41
4.3.2 Power Supply System ....................................................................................46
5. Code Examples 47
5.1 Project1- LP_RDK_Bridge .........................................................................................47
5.1.1 Project Description .........................................................................................47
5.1.2 Device Configurations ....................................................................................47
5.1.3 Firmware Architecture ....................................................................................50
5.1.4 Verify Output ..................................................................................................63
5.2 Project2- LP_RDK_Mouse.........................................................................................64
5.2.1 Project Description .........................................................................................64

4 CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
Contents
5.2.2 Device Configurations....................................................................................64
5.2.3 Firmware Architecture....................................................................................67
5.2.4 Verify Output .................................................................................................. 76
5.3 Project3- LP_RDK_Keyboard.................................................................................... 77
5.3.1 Project Description......................................................................................... 77
5.3.2 Device Configurations....................................................................................78
5.3.3 Firmware Architecture....................................................................................80
5.3.4 Verify Output .................................................................................................. 92
Appendix 93
A.1 Schematic ................................................................................................................. 93
A.2 Board Layout ............................................................................................................ 96
A.3 WirelessUSB 2-Way HID Protocol Overview ............................................................ 99
A.3.1 Radio Channel Management ........................................................................ 99
A.3.2 Pseudo-Noise Codes .................................................................................... 99
A.3.3 Chip Error Correction ....................................................................................99
A.3.4 Automatic Acknowledgment ........................................................................100
A.3.5. Network ID ..................................................................................................100
A.3.6 Manufacturing ID ........................................................................................100
A.3.7 Channel Selection Algorithm .......................................................................100
A.3.8 Protocol Modes ...........................................................................................101
A.3.9 Packet Structures .......................................................................................102
A.3.10 Bind and Reconnect Timing ........................................................................105
A.3.11 Back Channel Support for NumLk/ScrLk/Caps Lock ..................................107
A.3.12 Signature Byte ............................................................................................108
A.3.13 Encryption ...................................................................................................108
A.4 Manufacturing Test Support, MTK ..........................................................................110
A.4.1 Introduction .................................................................................................110
A.4.2 MTK Block Diagram ....................................................................................110
A.4.3 MTK Serial Protocol ....................................................................................110
A.4.4 MTK RF Protocol ........................................................................................112
A.4.5 MTK DUT source Code Porting ..................................................................112
A.4.6 Accessing MTK in the DUT .........................................................................112
A.5 Regulatory Testing Results ....................................................................................113
A.5.1 Introduction .................................................................................................113
A.6 Power Considerations ............................................................................................113
A.6.1 RDK Keyboard ............................................................................................113
A.6.2 RDK Mouse ................................................................................................114
A.7 Software Users Guide ............................................................................................116
A.7.1 Introduction .................................................................................................116
A.7.2 Software Code Modules ..............................................................................116
A.8 Bill of Materials .......................................................................................................123

CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A 5
1. Introduction
Thank you for purchasing the CY4636 WirelessUSB™ LP keyboard-mouse reference design kit
(RDK). The CY4636 WirelessUSB LP RDK is described in the Help guides and code examples are
provided to enable you to immediately use the kit.
The CY4636 kit provides an exemplary implementation of a 2:1, bi-directional wireless desktop
keyboard and mouse to single wireless receiver. The RDK helps jump start your keyboard and
mouse development using the WirelessUSB LP (CYRF6936) radio system-on-chip.
WirelessUSB LP is the next generation WirelessUSB device, with high data throughput and low
power designed to operate in 2.4 GHz ISM band. WirelessUSB LP has many powerful features that
allow users to create unique radio applications.
Schematics, source code, firmware, and RF gerber files are provided as an accelerated starting
point for PC human interface devices (HID) designers wishing to cut the cord on their HID
applications. Getting Started chapter on page 9 describes the installation and configuration of the
CY4636 Reference Design Kit. Kit Operation chapter on page 17 describes the kit operation.
Hardware chapter on page 25 describes the hardware operation. Code Examples chapter on
page 47 describes the code examples provided along with the kit. The Appendix on page 93 section
provides the schematics, bill of materials (BOM), and protocols associated with the CY4636 RDK.
1.1 Kit Contents
This kit provides:
■CYRF6936 WirelessUSB LP transceiver
■ADNS-3040 optical sensor mouse
■WirelessUSB LP 101 multimedia keyboard
■Small form factor bridge
■Batteries - 4 numbers
■CY4636 Reference Design Kit CD/DVD-ROM
Visit http://www.cypress.com/shop for more information. Inspect the contents of the kit. If any parts
are missing, contact your nearest Cypress sales office for further assistance.
1.2 PSoC Designer™
PSoC Designer is the PSoC integrated design environment (IDE) that enables you to customize
your PSoC application. The latest PSoC Designer includes many new features, bug fixes, and
support for new PSoC devices. After installation, you can get more information about PSoC
Designer in the PSoC Designer IDE Guide at:
<Installed_directory>\Cypress\PSoC Designer\<Version>\Documentation

6 CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
Introduction
1.3 PSoC Programmer
PSoC Programmer offers the user a simple GUI that connects to programming hardware to program
and configure PSoC devices.
<Install_directory>:\Cypress\Programmer\<ver>\Documents
1.4 Additional Learning Resources
Visit www.cypress.com for additional learning resources in the form of datasheets, technical
reference manual, and application notes.
1.4.1 References
■CYRF6936 – WirelessUSB™ LP 2.4 GHz Radio SoC:
http://www.cypress.com/?rID=14284
■CY7C601xx, CY7C602xx – enCoRe™ II Low-Voltage Microcontroller:
http://www.cypress.com/?rID=13556
■CY7C63310, CY7C638xx – enCoRe™ II Low Speed USB Peripheral Controller:
http://www.cypress.com/?rID=14212
■CY7C603xx – enCoRe™ III Low Voltage - http://www.cypress.com/?rID=13558
■ADNS-3040 - Ultra Low-Power Optical Mouse Sensor:
http://www.avagotech.com/docs/AV02-0150EN
■CY4636_RDK_Kit Schematic.pdf – http://www.cypress.com/?docID=23090
■MiniProg – http://www.cypress.com/?rID=37459
■PSoC Designer training - This is a web-based course that provides an overview of PSoC and its
design tools. It is the first of a multi-part series of modules designed to provide you with the nec-
essary training to enable you to quickly take advantage of PSoC technology, develop your
embedded applications, and get to market fast.
http://www.cypress.com/?rID=40543

CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A 7
Introduction
1.5 Document History
1.6 Documentation Conventions
Revision PDF Creation
Date Origin of
Change Description of Change
** 07/14/2011 CSAI Initial version of kit guide
*A 04/03/2012 ELIN Updated kit documents for CY4636 with the OOB review
comments.
Table 1-1. Document Conventions for Guides
Convention Usage
Courier New Displays file locations, user entered text, and source code:
C:\ ...cd\icc\
Italics Displays file names and reference documentation:
Read about the sourcefile.hex file in the PSoC Designer User Guide.
[Bracketed, Bold]Displays keyboard commands in procedures:
[Enter] or [Ctrl] [C]
File > Open Represents menu paths:
File > Open > New Project
Bold Displays commands, menu paths, and icon names in procedures:
Click the File icon and then click Open.
Times New Roman Displays an equation:
2 + 2 = 4
Text in gray boxes Describes cautions or unique functionality of the product.

8 CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
Introduction

CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A 9
2. Getting Started
2.1 Introduction
This chapter describes the installation and configuration of the CY4636 WirelessUSB LP RDK.
2.2 Kit Installation
To install the kit software, follow these steps:
1. Insert the kit CD/DVD in the CD/DVD drive of your PC. The CD/DVD is designed to auto-run and
the kit installer startup screen appears.
To download the latest kit installer, go to http://www.cypress.com/go/CY4636. Download the kit
installer ISO file and create an installer CD/DVD or extract the ISO using WinRar and install the
executables.
2. Click Install CY4636 WirelessUSB LP RDK to start the installation.
Figure 2-1. Kit Installer Startup Screen
Note If auto-run does not execute, double click the cyautorun.exe file in the root directory of the CD.

10 CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
Getting Started
Figure 2-2. Root Directory of the CD/DVD
3. The InstallShield Wizard screen appears. The default location for setup is shown on the
InstallShield Wizard screen. You can change the location for setup using Change.
4. Click Next to launch the Kit installer
Figure 2-3. InstallShield Wizard

CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A 11
Getting Started
5. On the Product Installation Overview screen, select the installation type that best suits your
requirement. The drop-down menu has three options - Typical, Complete and Custom.
6. Click Next to start the installation.
Figure 2-4. Installation Type Options

12 CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
Getting Started
7. After installation begins, a list of all packages appears on the installation page.
8. A green check mark appears next to every package that is downloaded and installed.
9. Wait until all the packages are downloaded and installed successfully.
Figure 2-5. Installation Page
10.Click Finish to complete the installation.
Figure 2-6. Installation Completion Page

CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A 13
Getting Started
Note Following the software installation, verify your installation and setup.
2.3 PSoC Designer
1. Click Start > All Programs > Cypress > PSoC Designer <version> > PSoC Designer
<version>
2. Click File > Create New Project, to create a new project on the PSoC Designer 5.2 menu or
click File > Open Project/Workspace on PSoC Designer 5.2 menu to work with the existing
project.
Figure 2-7. PSoC Designer Interconnect View
3. To experiment with the code examples go to Code Examples chapter on page 47.

14 CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
Getting Started
2.4 PSoC Programmer
4. Click Start > All Programs > Cypress > PSoC Programmer <version> > PSoC Programmer
<version>.
5. Select the MiniProg from the port selection.
Figure 2-8. PSoC Programmer Window
6. Click File Load from the Programmer menu bar; navigate and select the hex file to load.
7. Use Program to load the hex file to the chip.
8. Once programming is successful, Programming Succeeded appears in the Actions Pane.
9. Close PSoC Programmer.
Note: For more details on PSoC Programmer, go to the Programmer user guide at:
<Installed_directory>\Cypress\Programmer\<ver>\Documents.

CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A 15
Getting Started
2.5 Installation of Battery level and Link Quality Application
The instructions for installing and uninstalling the battery level and link quality application follow.
To install battery level and link quality application:
1. Copy the WirelessUSB.exe application located at <Installed_Directory>\Cypress\CY4636
WirelessUSB LP RDK\<ver>\Software\Binaries to the desired directory
(C:\Cypress\WirelesUSB).
2. Click Start > Run and manually execute the WirelessUSB.exe application with the setup option.
(C:\Cypress\WirelesUSB\WirelessUSB.exe -setup) or double-click WirelessUSB.exe.
3. The application now runs and registers to auto run at startup.
To uninstall battery level and link quality application:
1. Click Start > Run and manually execute the WirelessUSB.exe application with the remove option.
(C:\Cypress\WirelessUSB\WirelessUSB.exe -remove)
2. The application unloads and does not auto run at startup.
3. Delete the WirelessUSB.exe application.
2.6 Install Hardware
This kit does not require any hardware installation.

16 CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
Getting Started

CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A 17
3. Kit Operation
3.1 Introduction
The main components of the WirelessUSB LP RDK are:
■WirelessUSB RDK bridge/dongle – The RDK bridge supports both the RDK keyboard and
mouse. The RDK uses Cypress's famous KISSBind™ for binding the keyboard and mouse to the
dongle.
■WirelessUSB RDK Mouse – The RDK mouse is a three-button optical mouse with scroll wheel.
The mouse uses Agilent 3040 optical sensor.
■WirelessUSB RDK Keyboard – The RDK keyboard is a 101-key keyboard with multimedia keys
(internet, mail, and so on) and power keys.
3.2 Bridge
The LP RDK Bridge is programmed through the USB connector using a Cypress USB adapter board
PDC-9241.
Figure 3-1. Cypress USB Programming Adapter
1. Connect the LP RDK bridge to the USB adapter board; connect the MiniProg to the ISSP Header
on the USB adapter as shown in Figure 3-2 on page 18. Connect the MiniProg to the PC through
USB A to Mini B cable. Place two jumpers between pins 1 and 3 and pins 2 and 4 on J3 on the
USB adapter.
2. To program the hex file onto the bridge using the MiniProg, open PSoC Programmer and select
the MiniProg from the Port Selection window. Click Open and select the Hex file. Click Program.
While programming is in progress the Target Power LED on the MiniProg is ON.

18 CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
Kit Operation
Figure 3-2. Programming the Bridge
3. Once Programming Succeeded appears in the Actions pane detach the MiniProg.
4. Connect the bridge dongle through the USB port to the PC and wait for the bridge to enumerate.
When the dongle is first plugged in, the red LED turns ON. It turns OFF when the USB enumera-
tion process completes. Note that if the bind button is pushed when the dongle is first plugged in,
the firmware enters the MTK test mode and blinks the red and green LEDs alternately. The LED
blinks continuously until the dongle is removed from the computer.
5. After the bridge is enumerated as HID device in Device Manager, start using the bridge. To bind
the bridge with the mouse/keyboard, press the bind button on the bridge. The bridge then goes
into Bind Mode. In Bind Mode, the bridge uses the Bind ID to communicate with the mouse/key-
board to bind to the system.
6. The red LED blinks ON/OFF when the dongle is in Bind Mode. The ON and OFF time is approxi-
mately 320 ms, which is the rate at which the dongle changes channels during the Bind process.
7. The red LED also blinks ON/OFF when the PC is suspended. The blinking rate is approximately
1 second, which is the frequency of the wakeup interrupts.
8. The green LED turns ON when the dongle receives data from the mouse or keyboard. It remains
on for 250 ms after the last received data packet.
9. The green LED turns ON and remains ON if a key is pressed and held (because the keyboard
sends Keep Alive packets).
10.The green LED turns ON and remains ON during Ping Mode. In normal operation, Ping Mode is a
very short period. The user may not notice this period.
11.The red and green LED blink alternately in the Manufacturing Test mode.

CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A 19
Kit Operation
3.3 Mouse
The RDK mouse is enclosed in a skin designed for the Avago ADNS-3040 Ultra Low-Power mouse
sensor. The mouse features three buttons with one button combined with the scroll wheel function.
There is a connect button at the bottom of the mouse that allows you to perform an explicit bind with
the bridge.
Figure 3-3. Battery Compartment and Bottom View of Bind/Connect Button
Figure 3-4. On-Off Switch and Optics Window
Figure 3-3 and Figure 3-4 show the bottom of the mouse with the Optics window, power switch, and
bind button. J10 is a programming header. You can use either the ICE-Cube or the PSoC MiniProg
to program the mouse microcontroller using this ISSP header.
1. Remove jumper from J1. Connect your computer to the ISSP header (J3) on the mouse using the
PSoC MiniProg and a USB cable (A to Mini B). Programming can be done using PSoC
Programmer. After the programming is complete, place the jumper on J1.

20 CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
Kit Operation
2. To program the hex file to the mouse using the MiniProg, open PSoC Programmer and select the
MiniProg from the Port Selection window, click Program. While programming is in progress the
Target Power LED on the MiniProg is ON.
Figure 3-5. Programming Mouse
3. Once Programming Succeeded appears in the Actions pane detach the MiniProg.
4. Place a 2-pin jumper installed from should be pins 1 and 2 on the mouse “J1” to enable the radio
to power the processor. The mouse is powered using two AA batteries. To start using the mouse
place the batteries in the battery terminal, switch on the mouse, and bind it with the bridge.
5. To bind the mouse with the bridge press the bind button on the bridge. The bridge goes into Bind
Mode. In Bind Mode, the red LED blinks ON/OFF. The bridge uses the Bind ID to communicate
with the mouse to bind to the system and then press the bind/connect button on the mouse.
6. After the mouse is bound with the bridge dongle, it works smoothly with the system. The green
LED turns on when the dongle receives data from mouse. It remains on for 250 ms after the last
received data packet.
Table of contents
Other Cypress Keyboard manuals