CY3271 PSoC FirstTouch Starter Kit with CyFi Low-Power RFSpec. # 001-48286 Rev. ** Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone (USA): 800.858.1810 Phone (Intnl): 408.943.2600 http://www.cypress.com Copyrights Copyrights © Cypress Semiconductor Corporation, 2008. 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 lifesupport 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. FirstTouch™, PSoC Designer™, Programmable System-on-Chip™, and PSoC Express™ are trademarks and PSoC® 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. 2 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF, Spec. # 001-48286 Rev. ** Contents 1. Introduction 1.1 1.2 5 1.3 1.4 Welcome ......................................................................................................................5 CY3271 System Overview...........................................................................................6 1.2.1 CY3271 Hardware Overview ...........................................................................6 1.2.2 CY3271 Software Overview ...........................................................................10 Document Revision History .....................................................................................13 Documentation Conventions .....................................................................................13 2. Installation Guide 2.1 15 CY3271 Installation Instructions ................................................................................15 3. Design Examples 3.1 3.2 21 Design Example Summary Table ...........................................................................21 Out of Box Design Examples.....................................................................................22 3.2.1 CY3271 PSoC FirstTouch MultiFunction Expansion Card CapSense Slider .22 3.2.2 Ultra Low Power Wireless Temperature Sensor ............................................22 3.2.3 Wireless MultiFunction Demonstration...........................................................26 3.2.4 Standalone MultiFunction Demonstrations.....................................................28 4. Firmware 4.1 31 4.2 4.3 4.4 4.5 PC Bridge Wireless Hub ............................................................................................31 4.1.1 Design Features.............................................................................................31 4.1.2 Firmeware Location........................................................................................31 4.1.3 Firmware Architecture ....................................................................................31 4.1.4 Firmware Model .............................................................................................35 RF Expansion Card Ultra Low Power Temperature Sensor .....................................40 4.2.1 Design Features.............................................................................................40 4.2.2 Firmeware Location........................................................................................40 4.2.3 Firmware Architecture ....................................................................................40 4.2.4 User Modules used in the Temperature Sensor PSoC Project ......................45 4.2.5 Firmware Model .............................................................................................51 4.2.6 Architecture ....................................................................................................51 Wireless I2C Bridge for RF Expansion Card .............................................................57 4.3.1 Design Features.............................................................................................57 4.3.2 Firmeware Location........................................................................................57 4.3.3 This section describes....................................................................................58 4.3.4 Firmware Architecture ....................................................................................58 4.3.5 User Modules used in the I2C Bridge PSoC Project......................................61 4.3.6 Firmware Model .............................................................................................67 4.3.7 Architecture ....................................................................................................67 MultiFunction Expansion Card CapSense Slider .......................................................71 MultiFunction Expansion Card Proximity Sensor.......................................................73 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF, Spec. # 001-48286 Rev. ** 3 ............ 88 AAA Power Pack ............................ 93 MultiFunction Expansion Card....4 LED Connections ..1................. 85 5..................................................... 86 5.......................Contents 4........................5 93 General RF ................................1 RF Expansion Card........... Hardware 5..................... 93 PC Bridge .............. 93 Certifications............................................... 91 6.........................................................................................3 5....................................................................2 Programming the RF Expansion Card ...........................6 4.........4 5..... 90 CR2032 Power Pack ....94 7...1 Programming the PC Bridge Application Processor ...................... Frequently Asked Questions 9.............................. Specifications 6........2....................................... 85 5.................. 83 5..........................4 6......................................................................................3 Hardware Design .......... 86 5............1 5...................................................2 83 5.....................................................1 6.............................3 6................ 81 5.................7 MultiFunction Expansion Card Temperature Sensor............... 76 MultiFunction Expansion Card Light Sensor ..................5 PC Bridge ........... ** .....................2..... 87 MultiFunction Card (FTMF Expansion Card) .................................... 93 RF Expansion Card ............... Spec............................................................................................................... Appendix 95 101 4 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF....................2.................................................. 84 RF Expansion Card Overview ............... # 001-48286 Rev..........................................................2 6.....................................................2.............................................................................................................................................. cypress. you can also create common serial interfaces (for example. integration. # 001-48286 Rev.1 Welcome Thank you for purchasing the CY3271 PSoC® FirstTouch™ Starter Kit with CyFi™ Low-Power RF.com/support for support options. SPI and I2C). Introduction 1. ■ ■ You are invited to evaluate the included sample projects. If you have questions about or need help with the CY3271 kit. visit our online support center at http://www. and then experiment with the included hardware and software to create your own designs. simple. The CY3271 is designed to quickly evaluate the flexibility. In addition. ** 5 . PSoC Designer Integrated Development Environment (IDE) to create embedded designs using two methods: traditional chip-level designs that involve writing code. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. and powerefficient wireless connectivity to your embedded designs. This evaluation is aided by a wide variety of sample projects. Spec. and code free system level designs. You can use the sample projects to explore: ■ PSoC's programmable analog and digital blocks to interface to common sensors (such as thermistors) and actuators (such as LEDs).4 GHz CyFi Low-Power RF technology to easily add reliable.1. Cypress 2. and mixed signal capabilities of Cypress Programmable System-on-Chip (PSoC). or contact your local Cypress sales representative or authorized distributor. When this is combined with an onboard PSoC.1 CY3271 System Overview CY3271 Hardware Overview 1. ** .2. using a USB-to-I2C interface Feature a CyFi low-power RF transceiver (with RF output power up to +20 d Bm). ■ 6 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.2.2 1.Introduction 1.1 Hardware Components The CY3271 kit hardware consists of five boards: PC Bridge (FTPC) The PC Bridge (FTPC) can be used to: ■ ■ Program all PSoC devices in the CY3271 kit Act as a bridge between all boards in the CY3271 system and the PC. # 001-48286 Rev. Spec. it acts as the Hub in CyFi wireless networks.1. Its male interface header features an I2C interface and unused GPIOs. FTRF serves the following functions: ■ Combined with one of the power packs. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ■ ■ MultiFunction Expansion Card (FTMF) The MultiFunction Expansion Card (FTMF) features a PSoC device. it can be used as a CyFi low-power RF module to add wireless connectivity to boards that are connected to it.Introduction RF Expansion Card (FTRF) The RF Expansion Card (FTRF) features a PSoC device and a CyFi transceiver (with RF output power up to +20 dBm). ** 7 . # 001-48286 Rev. With its female expansion header. and several sensors and actuators that enable easy experimentation: ■ ■ 7-element CapSense slider CapSense proximity sensor (requires use of the blue proximity antennae. For example. it can act as a standalone CyFi wireless node with an onboard thermistor for temperature measurements. thich is inserted into PRX1) Thermistor Ambient light level sensor Red or green or blue triple LED cluster Speaker ■ ■ ■ ■ The FTMF interface header also features an I2C interface and four unused GPIOs for prototyping in your own system. connecting the MultiFunction Expansion Card (FTMF) into the FTRF Card enables you to wirelessly transmit the values of the sensors on FTMF to the PC. Spec. This enables you to use FTRF as a CyFi low-power RF module for prototyping in your own system. CR2032 Power Pack (CR2032) The CR2032 Power Pack houses a CR2032 coin cell battery. ** . and can be used to power the FTRF for ultra low-power wireless applications.Introduction AAA Power Pack (AAA) The AAA Power Pack houses 2 AAA batteries. and can be used to power either the FTRF. or both of them in series. FTMF. 8 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. # 001-48286 Rev. Spec. Introduction 1. Spec.2.1.2 Hardware Connectivity Scenario PC Side Wireless Link Remote Side Programming the FTMF Not Applicable Not Applicable FTPC ↔ FTMF Programming the FTRF Not Applicable Not Applicable FTPC ↔ FTRF Standalone FTMF Demos Not Applicable None AAA ↔ FTMF Wireless Ultra Low-Power Temperature Sensor Demo ↔ Wireless ↔ CR2032 ↔ FTRF FTPC ↔ FTMF Demos over Wireless Long Range Wireless ↔ AAA ↔ FTRF ↔ FTMF FTPC PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** 9 . # 001-48286 Rev. You can open every firmware example that is included with the CY3271 kit in PSoC Designer.2. ** .1 CY3271 Software Overview PSoC Designer PSoC Designer is the integrated development environment (IDE) where all PSoC projects are created. edited.2. built.Introduction 1. # 001-48286 Rev. 10 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.2.2 1. and debugged. Spec. 5.2. Connect the PC Bridge into an available USB port and make sure it is recognized and selected in the port selection window. Press F5 or Program to start programming.Introduction 1.HEX file from the Firmware directory. Connect the expansion card to the PC Bridge interface connector unless programming the slave processor.2. AutoDetection is set to On. 4. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.2 PSoC Programmer PsoC Programmer recognizes the PC Bridge as a programmer and is used to program all elements of the kit. 3. you must ensure that there is no card connected to the PC Bridge interface connector. Spec. ** 11 . Change the view to "Modern" by clicking View/Modern. Set the programming mode to Reset. and with then select the appropriate . # 001-48286 Rev. To program the slave processor in the PC bridge. To program the RF or Multifunction Expansion card simply connect the card to the PC Bridge interface connector. 1. The PC Bridge master device automatically detects the presence of an external card. 6. 2. In the CY3271. Spec. The features include data logging.2.3 Cypress Sense and Control Dashboard (SCD) SCD enables data logging and monitoring of wired and wireless sensors created using PSoC. calibration. alarms. # 001-48286 Rev. using the FTRF.2. ** . and data aggregation from hundreds of sensors.Introduction 1. 12 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. SCD is used to wirelessly log data from sensors connected to the PC. Introduction 1. Spec.hex file in the PSoC Designer User Guide. menu paths. Document Conventions for Guides Convention Courier New Italics [Bracketed.4 Documentation Conventions Table 1-2. # 001-48286 Rev.cd\icc\ Displays file names and reference documentation: Read about the sourcefile. and icon names in procedures: Click the File icon and then click Open. Bold] File > Open Bold Times New Roman Text in gray boxes Usage Displays file locations. Revision History Revision PDF Creation Date Origin of Change Description of Change 1.3 Document Revision History Table 1-1. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Displays keyboard commands in procedures: [Enter] or [Ctrl] [C] Represents menu paths: File > Open > New Project Displays commands.. user entered text.. Displays an equation: 2+2=4 Describes Cautions or unique functionality of the product. and source code: C:\ . ** 13 . Spec.Introduction 14 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** . # 001-48286 Rev. Installation Guide 2. Figure 2-1. ** 15 . The first option launches the kit installer. If the autorun fails. # 001-48286 Rev.exe The installer presents three options.2. Spec.exe" on the root of the CD. Selecting autorun. then manually choose "autorun.0 PSoC Programmer 3.00 Cypress Sense and Control Dashboard Kit Contents PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. as shown in Figure 2-1.1 CY3271 Installation Instructions Insert the CY3271 kit CD into your CD drive. which installs the following: ■ ■ ■ ■ PSoC Designer 5. This automatically launches the installer. Spec. # 001-48286 Rev. Click Next to start the installer and then choose Install to launch the PSoC Designer installer.Installation Guide Figure 2-2. Click Next through the next several screens. ** . Figure 2-3. Kit Installer Click Install CY3271 Kit and Tools to start the kit installations. Device Driver Screen 16 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. click Next and then Finish. When the Device Driver screen appears. Figure 2-4. Hi-TECH Compiler PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** 17 . Spec. Then select Finish to complete the installation of PSoC Designer 5.Installation Guide Wait for the Setup Status screen to complete. Figure 2-5.0. Setup Status Screen The Hi-TECH compiler for PSoC Designer begins installation. # 001-48286 Rev. The Sense and Control Dashboard Software setup wizard appears. Installing SCD Software 18 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.Installation Guide PSoC Programmer 3. Click Next through the next several screens to install the default configuration. Spec. This installer also installs Microsoft SQL server.0 begins to install. ** . PSoC Programmer Installer Another Device Driver Installation Wizard appears. Click Next through the next several screens. # 001-48286 Rev. Click Next and Finish to complete the installation of PSoC Programmer. Figure 2-6. Figure 2-7. Each project contains the source code as well as the compiled . # 001-48286 Rev. Figure 2-9. The firmware section contains the firmware projects for all of the projects used in this kit.Installation Guide Figure 2-8. Installing Microsoft SQL Server Click Finish to complete installing the CY3271 kit. A directory structure similar to that sown in Figure 2-9 is created during the installation process. Device Templates Directory The device templates directory contains templates for all of the FTRF Design examples as outlined in the Design Example Summary Table on page 21.HEX image enabling you to quickly pro- PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** 19 . Spec. # 001-48286 Rev.Installation Guide gram each application into the hardware. There are also in PDF format for ease of viewing. The Hardware section contains the design files for the schematics and PCB layout. It is advised to generate and build each project before making changes to the project source code. ** . 20 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Spec. and calibrating capabilities of the PSoC device. and blue) blink. CY3271 PSoC FirstTouch MultiFunction Expansion Card CapSense Slider (MF_CS_SLIDE) Ultra Low Power Wireless Temperature Sensor (RF_ULP_TEMP) FTMF Standalone Design Examples Light Sensor(MF_LIGHT) The FTMF is programmed to demonstrate light sensing. This example demonstrates the temperature sensing. green. # 001-48286 Rev. CapSense Proximity Sensor(MF_CS_PROX) Temperature Sensor(MF_TEMP) FTRF Design Examples CapSense Slider (MF_CS_SLIDE) This example demonstrates the capacitive sensing capability of PSoC. The CY8C21434 PSoC that resides on the FTMF Expansion Card detects your finger's position on the CapSense Touch Sensing slider and controls the LEDs output. and a buzzer is sounded out as an alert mechanism. You can change the color of the LED array by moving your finger across the CapSense slider. ** 21 . The on board light sensor is used to alter the brightness of the LED based on the amount of light being detected. When the temperature goes above or below a certain threshold. In this example. The RF Expansion Board transmits temperature data acquired from an onboard thermistor. the hub board talks to a RF Expansion Board driven by AAA/CR-2032 coin cell. The FTMF is programmed to demonstrate proximity detection. The FTMF is programmed to demonstrate a temperature sensor. which displays the temperature data in text or graph form in the SCD dashboard. Run your finger across the CapSense Touch Sensing slider and notice how the color of the LED changes. The measured temperature alters the LED display. This example demonstrates how to control the brightness of an LED array. CapSense Proximity Sensor(MF_CS_PROX) Temperature Sensor(MF_TEMP) Light Sensor(MF_LIGHT) PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. the red and green LED turn ON and OFF. Spec. The hub receives this data and sends it to the host PC. As you move your finger near and far from the proximity detection antenna.3. This example demonstrates the capacitive sensing and proximity detection capability of the Cypress PSoC device. thermistor reading.1 Design Example Summary Table Design Example Overview The preprogrammed CapSense Touch Sensing demonstration shows how to use the CapSense Touch Sensing slider to control LED color. different colored LED (red. Design Examples 3. 2 CY3271 Software Overview.Design Examples 3. Follow the instructions in the installation section before proceeding to these steps. When you are finished with the demonstration. 3. It operates at 0 dBm RF power output. 3. 5. as shown in Figure 3-1. Spec.1 Out of Box Design Examples CY3271 PSoC FirstTouch MultiFunction Expansion Card CapSense Slider 1. 5. 7.2. Install the software provided on the CD. Program the PC Bridge slave processor with the latest installed FW. Program the RF Expansion board with the latest installed FW. See Figure 2-9 on page 19 for the file location. The blue LED should start flashing indicating that the PC Bridge is enumerated on the USB bus 3. Ensure that jumper J1 on the battery board is connected across pins 1and 2. Make certain that the power is off when inserting any expansion card. Close PSoC Programmer.2. move the power switch to the OFF position. Select the . ** . Connect the MultiFunction board to the AAA battery board as shown in Figure 3-1. Before programming be sure to connect the RF Expansion card into the PC Bridge interface connector. 6. # 001-48286 Rev. Connect the RF PC Bridge into any free USB port on your computer. Move the switch to the ON position or away from the batteries. Select the .Hex file RF_ULP_TEMP located in the C:\Cypress\CY3271\Firmware\RF_HUB\RF_HUB\output directory. 2. 22 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. 4. Follow the steps outlined in 1.2. 4. Move your finger along the slider at the end of the MultiFunction board and observe how the LED changes color.2.Hex file RF_HUB located in the C:\Cypress\CY3271Firmware\RF_HUB\RF_HUB\output directory.2 3. Click Continue to Load the last configuration. Connecting the MultiFunction Board to the AAA Battery Board 2. Again.2 Ultra Low Power Wireless Temperature Sensor This demonstration showcases a low power RF solution that runs on a coin cell. go to: Start > Programs > Cypress > Cypress Sense and Control Dashboard > Cypress Sense and Control Dashboard. Figure 3-1. 1. Open the SCD Dashboard software GUI that is installed with the installation pack. The red LED should start blinking on the PC Bridge indicating that there is I2C activity between the SCD software and the PC Bridge slave RF Hub application. follow the steps outlined in 1. To access the SCD Dashboard software.2 CY3271 Software Overview. Insert the coin cell into the battery board + side up. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Switch on power to the RF Expansion Board by placing the position of the switch to ON position.Design Examples Figure 3-2. Spec. Figure 3-3. Connect the RF Expansion Board into the CR-2032 coin cell battery pack.Place the PC Bridge in Bind mode using the SCD Dashboard. as shown in Figure 3-3. RF Expansion Board into the CR-2032 Coin Cell Battery 9. # 001-48286 Rev. 10. This is described in the following method: ■ Click the Manage Network button to add a new node. Coin Cell into the Battery Board 8. ** OFF ON 23 . # 001-48286 Rev.Design Examples Figure 3-4. Figure 3-5. When the green LED on the bridge lights up. Place the RF Expansion Board in Bind mode.fAter it is bound. Figure 3-6.. click Add. . the bridge is in bind mode (there is no need to press the button). Verify the success of the bind and click Next. RF Expansion Mode (Bind Button) Bind button 9. Manage Network Button in the SCD Dashboard “Manage Network “ button ■ ■ In the Manage Network screen. ** . 24 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Then name the node and click Finish. by pressing the Bind button on the board when instructed by the GUI. Spec. Node Binding Screen 8. 10. On the Node Binding screen. click Begin Binding. click Next. to add a new node. Spec. For additional features and options see the SCD documentation. Figure 3-7. click Add. Define Sensors in the Configure Node Screen PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. In the Configure Node screen. For this example you learn how to configure a sensor from scratch.Design Examples 11. # 001-48286 Rev. to define the sensors for this node. ** 25 . Configure Node Screen Configure the sensor as shown in Figure 3-8. Figure 3-8.. RF Expansion Board into the 2x AAA Alkaline Cell Battery and MultiFunction Board 7. When SW2 is released the red LED flashes according to the selected interval: ■ ■ ■ ■ ■ 1 = 1second 2 = 5 seconds 3 = 30 seconds 4 = 1 minute 5 = 5 minutes The power on default is five seconds. Program the MultiFunction board with the MF_LIGHT. 5. The red LED illuminates solid indicating that the report interval was advanced to the next interval. Spec. Follow the instruction in the installation section before proceeding to the following steps.2. Figure 3-9. 6. # 001-48286 Rev. Open the SCD Dashboard software GUI that is installed with the installation pack.2 CY3271 Software Overview. Before programming be sure to connect the RF Expansion card into the PC Bridge interface connector. The red LED blinks at a five second interval when bound.Hex file RF_I2C_BRIDGE located in the C:\Cypress/CY3271\Firmware\RF_I2C_BRIDGE\RF_I2C_BRIDGE\output directory. 26 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Connect the RF PC Bridge into any free USB port of your PC/Laptop. 2. This is described in the following method: ■ Click the Manage Network button to add a new node. 13. ** . Switch on power to the RF Expansion Board by placing the position of the switch to ON position. 1. Follow the instructions outlined in 1.Select graphical or textual mode of data display. Program the RF Expansion board with the latest installed FW. 3. a similar approach can be used for the other MultiFunction demonstrations.2.2 CY3271 Software Overview for details on programming. follow the steps outlined in 1. 8. However. Install the software provided on the CD.3 Wireless MultiFunction Demonstration The MultiFunction demonstrations can be operated by programming the corresponding .Design Examples 12. Again. Light Sensor. Proximity Sensor. Place the PC Bridge in Bind mode using the SCD Dashboard. 4. Select the . 3. The data is displayed in graphical or text format on the SCD screen.hex image located at C:\Cypress\CY3271\Firmware\MF_LIGHT.2. Connect the RF Expansion Board into the 2x AAA alkaline cell battery pack and the MultiFunction board as shown in Figure 3-9. The example described in this section is specific for the Light Sensor.hex file (CapSense. and Temperature Sensor) onto the MultiFunction board. Modily the report interval as indicated by the green LED by pressing SW2 for more than two seconds. Click Apply on all successive dialog boxes until the main SCD window reappears. by clicking Bind on the board when instructed by the GUI. to add a new node. RF Expansion Mode (Bind Button) Bind button PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.. When the red LED on the bridge lights up.Design Examples Figure 3-10. Node Binding Screen 8. click Add. On the Node Binding screen. click the Begin Binding. Figure 3-12. Spec. ** 27 . Manage Network button in the SCD Dashboard “Manage Network “ button ■ ■ In the Manage Network screen. Figure 3-11. the bridge is in bind mode (there is no need to click the button). # 001-48286 Rev. Place the RF Expansion Board in Bind mode. click Load Node Configuration radio button to load the stored configuration. This file is located in Cypress/CY3271/Device Templates. Type ‘Light Sensor’ as the Node Name and click Finish. You need to program the FTMF card with the appropriate firmware to operate the demonstrations.hex file on PSoC Programmer software.Click Apply on all successive dialog boxes until the main SCD window appears again.7. Figure 2-9 on page 19 is an illustration of where to locate the files.hex file. 28 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. 4.After it is bound. Click Browse and load the ‘Template Temperature Sensor. Configure Node Screen 11. Spec. Each demonstration has an associated PSoC Express project and is described in detail in sections 4. 4.6 and 4. The data is displayed in graphical or text format on the SCD screen. ■ In the Configure Node screen.1 CY3271 PSoC FirstTouch MultiFunction Expansion Card CapSense Slider. 10. ** . ■ Figure 3-13.4. Light Sensor. # 001-48286 Rev. name the node and the sensor. Follow the binding method described for the Light Sensor.2. In Step 10. 3. Program the MultiFunction board with the appropriate . 12.xml’ file. selecting the appropriate . the report interval can be modified as noted at the end of section 3. Programming is affected by connecting the FTMF card to the FTPC bridge. Also. The graph displays values close to 0 when your finger is covering the light detector PR1 and values in the range of 20 for room lighting. and programming the CY8C21434 chip on board. load the corresponding template from the ‘Device Templates folder’ and click Finish. and Temperature Sensor). Verify the success of the bind and click Next. Use a similar approach for the other MultiFunction demonstrations.2.Design Examples 9. Select graphical or textual mode of data display.5. Proximity Sensor. Then configure the data format as discussed in the following steps.4 Standalone MultiFunction Demonstrations The First Touch MultifFnction (FTMF) Card provided with the CY3271 First Touch RF kit is able to support four stand alone demonstrations (CapSense Slider. 3 MultiFunction Expansion Card Temperature Sensor This project demonstrates the temperature sensing. For all other slider positions. and calibrating capabilities of the PSoC device. the LED emits the color red. the red LED turns back ON and the green LED turns OFF. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.Design Examples These demonstrations are made possible by simply powering the FTMF card using the 2x AAA battery board.1°C ■ ■ ■ ■ The Red LED is ON only if the temperature is between 26.2 MultiFunction Expansion Card Proximity Sensor This project demonstrates the capacitive sensing and proximity detection capability of Cypress' PSoC technology. When the finger position is in between the origin and the 1/3 mark of the width of the Capsense slider.7°C and 55. LEDs blink only if the Blink Timer is triggered. You can change the color of the LED array by moving your finger across the CapSense slider. the red LED turns OFF and the green LED turns ON. 2.2. The Green LED is ON only when the temperature is between 21. the red and green LED turn ON and OFF. This includes the absence of a finger on the slider.1 MultiFunction Expansion Card CapSense Slider This project demonstrates PSoC capacitive sensing capabilities. The Blue LED is ON only when the temperature is between -10. Depending upon the temperature range within which a particular temperature reading is recorded. # 001-48286 Rev. When the finger position is between the far end and the 2/3 mark of the width of the capsense slider.2. ■ ■ ■ 3. ■ ■ 3. Spec.9°C. 3. This project consists of these driver elements: ■ When the finger is not close enough to the proximity antenna. and blue).4°C. green. Connect the FTMF board to the 2x AAA battery board as shown in Figure 3-1. 1. the LED emits the color green. different colored LED blink (red.4.6°C. Insert the bare end of the wire in the PRX1 connector located in the middle of the board. ** 29 . As you move your finger near and far from the proximity detection antenna. the red LED is ON and the green LED is OFF. As the finger is brought closer and crosses the proximity threshold of the proximity antenna. When the finger is gradually taken away again as it moves further than the proximity threshold.1°C and 23. 3. Proximity detection requires that you use the supplied blue proximity antenna. When the finger position on the slider is between the 1/3 and 2/3 marks of the width of the Capsense slider.0°C and 55. What to observe: The Buzzer is sounded only when the temperature is between -10. What to observe: ■ ■ When the finger position on the slider is at the origin.1°C and 15. the LED is OFF.2. Ensure that jumper J1 on the battery board is connected across pins 1 and 2. When the temperature goes above or below a certain threshold. and also when the temperature is between 35. thermistor reading.1°C.4. The following sections explains the purpose and output for each of the FTMF demonstrations. a Buzzer is sounded out as an alert mechanism. Move the switch SW1 to the ON position or towards the FTMF board. the LED emits the color blue. the LED is OFF.1°C and 29.4. 4.2. the light sensor controls the brightness of the LED array. ** .Design Examples 3. # 001-48286 Rev.4 CY3271 PSoC FirstTouch MultiFunction Expansion Card Light Sensor This project demonstrates a light sensor. What to observe: ■ ■ The shadow cast by the palm of your hand diminishes the LED intensity Removing your palm leads to returns the LED intensity to its initial state 30 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Spec. In this project. 1 Design Features The Wireless Hub application uss the CyFiSNP user module configured as a hub to communicate with the wireless nodes. Firmware 4. Device Configuration for Slave CY8C24894 The slave CY8C24894 is configured using the Device Editor in PSoC Designer 5. For this project.1 PC Bridge Wireless Hub The PC Bridge consists of two CY8C28494 processors. ROM/RAM Usage Total ROM (Bytes) Hub functionality with Debug enabled 13116 Total RAM (Bytes) 703 There may be future extra build options. the files you need are in RF_HUB folder. All configuration and node data is communicated over a I2C interface. The application firmware can just call simple APIs to manipulate the LEDs. LED (Red and Green). EzI2Cs. and TX8 user modules.3 Firmware Architecture ROM/RAM Usage Table 4-1. The usage of each user module in the application is described: ■ CYFISNP. One device is used for the Master microporcessor that provides USB to I2C bridge functionality in addition to programming support for all kit elements. in which case this document will be updated. firmware source code modules. Spec. ■ ■ PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. and configuration options for the slave process or the wireless hub application processor. The second CY8C28494 processor acts as the wireless hub and communicates with the SCD SW application via an I2C interface to the master processor USB/I2C bridge.0. The bridge uses the CYFISNP. 4. EzI2Cs.2 Firmeware Location The project files are located in the firmware directory as illustrated in Figure 2-9 on page 19. 4. This user module implements the I2C slave functionality and takes care of data communication through the I2C interface with the master CY8C24894.1. architecture. LED. These implement the API to turn ON/OFF the LEDs according to the needs of the application. ** 31 . 4. in addition to low level radio communication and radio control by the MCU. # 001-48286 Rev. This user module implements the entire Star network wireless protocol and all protocol modes.1.4. There are two instances of this user module: one is configured as RED and the other as GREEN. This section discusses the design goals.1. 2. the CPU Clock/N must be set to '2'. ■ ■ Power Setting. These values must be modified with care because they affect the user modules discussed in later sections. To run the CPU at 12 MHz. So VC1 = SysClk/N is chosen as 4. SysClk/1 VC3 Divider. This operating frequency provides faster code execution. Figure 4-1 shows the Device Editor with user module mapping. Figure 4-1. Low Trip Voltage [LVD]. SC On/Ref Low Ref Mux. VC2 = VC1/N is chosen as 1 VC3 Source. VC1.3V/24 MHz operation CPU Clock. 26 SysClk Source. VC2. Spec.Firmware The following sections describe how to configure these individual user modules. 3. ** . Disable OpAmp Bias. This clock is chosen as 6 MHz. # 001-48286 Rev. Internal SysClk*2 Disable. This parameter is set to Internal (24 MHz).1 Global Configuration This section describes the global resources that are configured for the slave CY8C24894 running the hub application. (Vdd/2)+/.3.92 V ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 32 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. No Analog Power. Low A_Buff_Power.Bandgap AGndBypass. Device Editor with User Module Mapping 4.1. Disable 4. and so on. All I2C communication is initiated by the master. Then there is a lower level radio driver firmware that allows the microcontroller to control the CYRF7936 2. and the IRQ and nSS lines are properly configured.3 EzI2Cs User Module The EzI2Cs user module takes care of I2C communication with the master CY8C24894 device on the bridge. Figure 4-2. However. The SPI lines of MOSI.1.7 of the slave CY8C24894. All wireless communication with the remote nodes is taken care of by this user module.Firmware ■ ■ LVD Throttleback. A higher level of medium access protocol firmware controls the network level details. The user module also has a E2PROM component of 252 bytes that stores the node records such as MID. the EzI2Cs. The CYFISNP is actually comprised of two components. Disable Watchdog Enable. ** 33 . MISO. SCLK. according to the nature of the request. Whenever the master polls for data. In the default configuration of this module. data communication with nodes. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.5 and P1. It also uses the fast I2C clock option of 400 kHz and is configured on P1. and others.1. The master comes and reads from that location without application firmware intervention. place the data that need to go upstream on the specified memory location. Spec. finding a quiet channel.2 CYFISNP User Module The CYFISNP user module is at the core of the hub application firmware. The user module has API which specifies the memory location and size which is accessed by the master. # 001-48286 Rev.3. the node ID is assigned automatically (on the fly assignment) by the Hub. CYFISNP User Module This user module supports up to 32 nodes.4 GHz CyFi transceiver radio over SPI. such as node binding. The default I2C slave address for this hub application is 8-bit slave address of 4. Node ID. there is provision when nodes may ask for specific IDs. You must include this user module firmware in the application and make API calls to this user module from the main application.3. 4. Spec. Refer to LED usage for more information on how application firmware handles the LEDs. Toggle. The application firmware simply needs to make API calls to these user modules. ** .0 and P3. turning On/Off. and so on.4 LED_x User Module There are two instances of this user module: one is configured as the Red LED and the other as Green LED.1 of the slave CY8C24894. The LEDs are configured to P3.3. These modules implement LED switching states.1. 34 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. They have a Drive of Active HIGH. # 001-48286 Rev.Firmware 4. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** 35 .1. # 001-48286 Rev. Figure 4-4. the main application firmware would have an architecture based on the following state machine shown in Figure 4-4.Firmware 4. State Machine Architecture Start Poll SNP SNP Data? N Y SNP Communication Poll I2C for Read/Write Read Read? Memory Management Write Memory Management The separate threads that handle the different functionalities are discussed in the following sections.4 Firmware Model Figure 4-3. Spec. Functional Block Diagram for the Hub Application HUB APPLICATION I2C Application Interface + Memory Management I2C Slave Interface Data buffer Back Channel Data buffer SNP It is evident that the Hub application requires three distinct blocks: ■ ■ ■ Communication with SNP Memory and Buffer Management I2C Application Interface Management As a result. This is implemented in the protocol by an API function call ServeSNPPackets ().Firmware 4. The Data buffer and the back channel Data buffer are implemented as circular buffers.1. The function first polls the SNP for data through and CYFISNP API calls CYFISNP_RxDataPend.2 Memory Management This function manages the data movement between the protocol data buffers.1.1 Communication with SNP The main function calls this function to communicate with the star network protocol. This management algorithm prevents buffer overflows and prevents the I2C master bridge from receiving junk data when it polls the slave hub. If a data packet is successfully written in the Application Buffer. ** . This guarantees that data is read and written in an efficient manner that saves latency. Spec. 4. and also data is not overwritten or lost due to Buffer overflow error. These two are implemented in an API called WriteBufferManager(). is also incremented. The count value indicating number of packets in the buffer. If the packet is of data type. numberOfPacketsInBuffer. Data buffer = 252 bytes (18 bytes X 14) Back channel Data buffer = 128 bytes (16 bytes X 8) Figure 4-5 on page 37 shows the framework of the two functions that implement memory management. 36 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. If data is pending. then different tasks are performed depending on the received packet type. when there are no packets in the buffer. then it is written into an Application Buffer.4. and the Memory management section is called which handles the packets in the buffer. then the Write pointer pNextWrite is incremented to point to the next location in the application buffer. including the back channel data buffer and the Application firmware. The framework of this part of the firmware is based on the following pseudocode: void Serve SNP Protocol if SNP Packet pending Put all packets in Data Buffer Process packets after SNP Buffer is emptied based on Packet type in packet header Process packets that don't need to be sent to host and delete to free up buffer Call memory management if Back Channel data requested by SNP Poll host GUI for back channel data Load back channel data buffer Call memory management else Release SNP packet buffer and exit Keep polling the SNP at regular intervals to check if it contains data that needs servicing. # 001-48286 Rev.4. ** 37 .Firmware Figure 4-5. This API is called immediately after the APIs WriteBufferManager() and ReadBufferManager(). # 001-48286 Rev. Spec. The conditions are: ■ ■ ■ ■ Buffer Full Buffer Empty Read pointer has reached the last location in the buffer Write pointer has reached the last location in the buffer and the buffer is full or not PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. State Machine Start Write Read/Write? Read Write Data Y Is numberOfPacketsinBu ffer ==0x00? N Increment Write pointer Read Out content of Application Buffer Is numberOfPacketsinBu ffer ==0x0E? N Decrement Number of packets in buffer Y Buffer is Empty Buffer is Full Decrement Read pointer Memory management is implemented by the function BufferManagement() in the hub firmware. This function checks for four important conditions and takes actions based on these conditions. However. Spec. As a result. depending upon the command byte. after the data starts getting polled out by I2C master. devId = pNextRead->devId. executes several functions: for example. The top level function call that initiates I2C communication between the master CY8C24894 and the slave CY8C24894 is CheckHostRequest(). //stuff I2C buffer with data I2CBuffer[1] = numberOfPacketsInBuffer. Similarly. index++) { I2CBuffer[index] = pNextRead->payload[payloadIndex]. switch (I2CBuffer[COMMAND_BYTE]) //numberOfPacketsInBuffer--. getting the node configuration of a specific node. index < (length+5). I2CBuffer[4] = pNextRead->rssi. when the write pointer referencing the application buffer pNextWrite reaches the last location of the buffer pEnd. EzI2Cs_SetRamBuffer (sizeof(I2CBuffer). reading out data from the application buffer and freeing up buffer space. 38 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. if the read pointer has not moved it implies that the buffer is full). The following code snippet illustrates the API call. sending back channel data to a particular node. # 001-48286 Rev. The address and size of the command is specified by the user module API call. and others. sizeof(I2CBuffer). pI2C). For details about the user module. payloadIndex++. These functionalities are implemented using switch statements based on the first command byte.// decrement number of packets so we can keep track of how many packets are left in the buffer length = pNextRead->length. and the buffer is not full.1. ■ If this count equals zero.3 I2C Interface Management The I2C is implemented using the EzI2Cs user module available in PSoC Designer 5. After this API is called.0. ** . 4. I2CBuffer[3] = length. } ReadBufferManager(). then the buffer is empty and in such a condition all pointers are reset to the initial base location of the buffer. This ensures the pointer never drifts off into random regions of the RAM. ■ The buffer is designed as a circular buffer. the pointer is reset to the base address of the buffer pBeg. and there are no reads from the I2C master (that is. this condition is immediately cleared and the buffer accepts data from SNP again.Firmware The first two conditions are checked by checking the count value of the number of packets in the buffer numberOfPacketsInBuffer. the master CY8C24894 writes a command into the RAM buffer of the slave. The firmware checks the first byte of the command byte and. An LED lights up and the buffer is no longer written with a packet from the SNP. Whenever one packet is read from this condition by the I2C master. no more writes are allowed and pNextWrite is stuck at the last location. then the buffer is full. if the read pointer referencing the application buffer pNextRead reaches the last location of the buffer pEnd (third condition is met). for(index=5. at the beginning of the application firmware.4. refer to the EzI2Cs user module data sheet. then immediately after the current read. If this count equals MAX_BUFF_PKTS. and always initializes read from the base address of the Application Buffer. I2CBuffer[2] = devId. by setting BCDR bit when the host GUI has no data to send. Note that FETCH_NXT_PKT (when a data packet is read by the I2C master and sent up to the host GUI) occurs only when the application buffer is not empty.h.Firmware } else { I2CBuffer[1] = 0xFF. buffer return 0xFF } // if no more messages are in the I2CBuffer[RESPONSE_BYTE] = FETCH_NXT_PKT_RSP. and these are defined in the application header file FTRFHub. #endif break.1. numberOfPacketsInBuffer is immediately decremented and BufferManagement() is called through the API ReadBufferManager(). After FETCH_NXT_PKT occurs. where each case statement implements a different functionality.h.4 Secondary Application Implementations Apart from the above three fundamental and major tasks. # 001-48286 Rev. and are also defined in the application header file FTRFHub. All the mentioned master I2C requests have a response from the slave. ** 39 . There are seven similar case statements. The case statements are: ■ ■ ■ ■ ■ ■ ■ FETCH_NXT_PKT SEND_PKT GET_NODE_CFG UNBIND_NODE ENTER_BIND_MODE GET_PROTOCOL_STATE GET_LAST_BIND_RESULT Each case has individual hex values 0x01 to 0x07 assigned. ❐ Implemented by the API SendBackChannelData(BYTE devID) PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. 4. #if defined(DEBUG) LED_RED_Invert().4. ❐ Implemented by the API checkBindButton() ■ A test back channel data packet is sent if a device requests a back channel data packet. Spec. These responses also have hex values 0x81 to 0x87 assigned to them. the hub application firmware also performs the following tasks to ensure proper functioning of the hub: ■ The bind button is scanned continuously to detect a button bind request from the user. CYFISNP 40 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. architecture. Temperature Sensor Node Block Diagram PSoC Device P2. you can also operate it by removing it from the battery pack and inserting it into your target hardware or other development platforms. which controls the CyFi Radio and other components on the board.1 Firmware Architecture ROM/RAM Usage Table 4-2.2 Firmeware Location The project files are located in the firmware directory as illustrated in Figure 2-9 on page 19.3 4.2 [3. 4.1 PGA 10K ohms P 0. # 001-48286 Rev. ROM/RAM Usage Total ROM (Bytes) Node functionality with TX8 Debug enabled 11051 Total RAM (Bytes) 162 4. the files you need are in RF_ULP_TEMP folder.0 Thermistor Report Rate Timer 2:1 MUX Gain =1 12 Bit ADC PSoC SPI Radio The Temperature Sensor node design consists of the following modules: 1.Firmware 4.2 Functional Block Diagram of the Temperature Sensor Node Figure 4-6. and configuration options of the FTRF Temperature Sensor Node.2. ** . Incremental ADC 4.2. 4.2. firmware source code modules. 4.3. This section describes the firmware implementation of using a temperature sensor on the remote node to transmit temperature data back to the host or hub. Analog Input Routing 2. Spec.1 Design Features The CY3271 FTRF Kit uses a PSoC CY8C27443 on the RF Expansion Board.2. PGA 3.2. This is the application processor.3.2 RF Expansion Card Ultra Low Power Temperature Sensor This section discusses the design goals. Since the FTRF expansion card has its own PSoC.3 volts] 390 ohms P 0. For this project. Spec. Timers for Report Rate PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** 41 .Firmware 5. # 001-48286 Rev. # 001-48286 Rev. The following section discusses the configuration of global resources and user module parameters for every user module used.3.3 Device Configuration for CY8C27443 in the RF Expansion Board The CY8C27443 is configured using the Device Editor in PSoC Designer 5. Chip Layout View Showing User Modules Placement and Routing 42 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Spec.Firmware 4. and TX8 User Modules. ** . ADCINC.0. PGA. Figure 4-7. The node uses the CYFISNP.2. Timer8. Firmware 4.2.3.4 Global Configuration This section describes the global resources available for configuring the CY8C27443, which runs the Node application. Modify these values carefully because they may affect the User Modules discussed in later sections. ■ ■ Power Setting. 3.3V/24 MHz operation. Supply voltage at 24 MHz. CPU Clock. This parameter is set to SysClk/2. To run the CPU at 12 MHz, SysClk/N must be set to '2'. VC1. This clock is set at 6 MHz. As a result, VC1= SysClk/N set as 4. The SPI block in the CYFISNP user module is clocked with VC1. When the SPI clock in PSoC is set at 2 MHz or higher, the MOSI input must be selected as 'Asynchronous' as shown in Figure 4-8 on page 43. ■ Figure 4-8. Global Configuration ■ VC2. VC2=VC1/N is selected as 3. As a result, VC2 outputs 2 MHz and is provided as the clock to the incremental ADC. VC3 Source. SysClk VC3 Divider. 26 - Clocks the TX8 block. SysClk Source. Internal (Internal Main Oscillator) SysClk*2 Disable. Yes - Power savings Analog Power. All Off - Analog circuitry is powered using firmware during readings. Ref Mux. (Vdd/2)+/- (Vdd/2) AGndBypass. Disable OpAmp Bias. Low A_Buff_Power. Low Switch Mode Pump. OFF, not used in design. Saves power when OFF. Trip Voltage [LVD]. 2.92 V LVD Throttleback. Disable Watchdog Enable. Enable ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF, Spec. # 001-48286 Rev. ** 43 Firmware 4.2.3.5 Chip Layout Configuration Figure 4-9. Configuration of Input Muxes to Route Pins P0.0 and P0.1 Select pins P0.0 and P0.1 as the default pins to the input muxes as shown in Figure 4-9. 44 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF, Spec. # 001-48286 Rev. ** Firmware 4.2.4 4.2.4.1 User Modules used in the Temperature Sensor PSoC Project CYFISNP User Module The CYFISNP user module is at the core of the node application firmware. This user module controls all wireless communication with the hub. In addition, this user module also implements the entire Star network wireless protocol, its modes, and the low level communication between the radio and the MCU. API calls to the CYFISNP user module affect control. The CYFISNP consists of the following components: ■ A higher level of medium access protocol firmware that takes care of the network level details, such as node binding, finding a quiet channel, data communication with nodes, and others. A lower level radio driver firmware that allows the microcontroller (CY8C27443) to control the CYRF6936 radio over SPI. The user module contains an E2PROM component to write the parameters of the Hub to the node's flash. The user module also consists of the Sleep timer configured at 64 Hz. This is required for timing the various events and modes in the protocol. ■ ■ ■ The SPI lines of MOSI, MISO, SCLK, and the IRQ and nSS lines are correctly configured according to the PSoC drive configurations. Figure 4-10. CYFISNP User Module Node Power Supply The node is powered by Alkaline cells that have low internal resistance. 'High Impedance Battery' is selected. EEPROM Block This parameter defines the EEPROM block number used to store network parameters. The last block in the flash is selected to write and store the parameters. This block must be marked as unprotected in the flashsecurity.txt file. External PA PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF, Spec. # 001-48286 Rev. ** 45 external PAs are not recommended for such applications. Coin-cell batteries cannot supply high peak current for operation required by external PAs. MUX IRQ on MOSI The CYRF793x device IRQ pin may be multiplexed onto the MOSI pin. and is Routed to Row_0_Output_3 net. Clock MISO The Master-In-Slave-Out input (MISO) signal is routed to Row_0_Input_0 net.6 for the IRQ pin because muxing with MOSI is not opted.h on page 47. Clock Selects the SPIM Block Clocking source. Next. As a result. The clock rate is set to 6 MHz and the 'Async' option is selected for the line going to the SPI clock. the Config. Figure 4-11. IRQ_Port. The temperature sensor project does not use the multiplexing option. option 'YES' must be selected in the case of the Ultra low-power Temperature Sensor project in FTRF because the PA must be bypassed on the RF Expansion Board for a coin-cell application. SClk This output clock is generated by the SPI Master. nSS_Port. However. MOSI The Master-Out-Slave-In (MOSI) output signal is routed to Row_0_Output_1 net. ** . This is discussed in the section Config. Choose Pin P2. nSS_Pin 46 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. IRQ_Pin Selects the IRQ pin.Firmware This parameter controls the operation of the external Power Amplifier. # 001-48286 Rev.h file must be modified to limit the PA to less than 0 dBm. Spec. h The CYFISNP User Module generates a file named CYFISNP_Config. The exceptions to this rule are sections of code contained between @PSoC_UserCode_name@ and @
[email protected] The SlaveSelect pin is selected. This table provides the configuration for the following three options: FTRF Coin-cell Application For FTRF coin-cell application. if the hub uses the external PA. Pin P2. This is an important consideration when seeking FCC or similar RF certification. the node must use the same first and last channels.h that contains tables and variables that you can configure for your project. when the Internal PA is used.7 is selected to route the nSS signal. For coin-cell applications. For FTRF coin-cell applications. and as a result has restricted channel subset. This list must be monotonic for proper operation. However. The table stops with PA6 because the maximum internal PA is PA6. Ensure that the table that is uncommented goes only up to PA6. and as a result has restricted channel subset. You can change the following items in CYFISNP_Config. This avoids spilling over to other channels. This option with the External PA table setting is required to effectively disable the PA on the board. the external PA option is not selected. However. # 001-48286 Rev. For coin-cell applications. When a PA option is selected in the user module configuration. This list must be monotonic for proper operation. Spec. the First Channel defaults to Channel 10 (changeable by the developer). This is an important consideration when seeking FCC or similar RF certification. Config. This table starts at PA4 since there are no significant current savings below PA4. Default Option with External PA up to +10 dBm This is the default setting or table (Table 2) when external PA is chosen in the User Module parameters. the ‘External PA’ option must be set to ‘YES’ in the User Module parameter setting. the Last Channel defaults to Channel 58 (changeable by the developer). this table must be commented out and the first table must be uncommented. Last Channel This parameter controls the high limit of channel range of CYFISNP protocol. ■ @PSoC_UserCode_PaPhyTblExternal This table allows you to customize the eight possible RF power steps for the Dynamic PA feature. the external PA up to +10 dBm is chosen (second table under External PA). any changes that you make to this code are lost. By default. especially when using external PA. As a result. Most of the code in the generated header and source files in your project is regenerated each time your project is built. The external PA is configured such that the RF output power can only go up as high PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. First Channel This parameter controls the low limit of the channel range of CYFISNP protocol. This avoids spilling over to other channels. the external PA option is not selected.h: ■ @PSoC_UserCode_PaPhyTblInternal This table allows you to customize the eight possible RF power steps for the Dynamic PA feature. if the hub uses the external PA. ** 47 . especially when using external PA. the node must use the same first and last channels. This table is used only if the External PA option is set to ‘YES’. When a PA option is selected in the user module configuration. 4. This mux is used to switch between P0. The PGA block exists only to ease routability of the input signals P0. This variable allows you to change the PA level used during binding.0 and P0. Input.1 to the ADC block. The default value of PA4 is good for short distances (within a few feet).Firmware as +10 dBm in this case. The power can be increased to +20 dBm only in the United States and Canada.The P0. PGA User Module The input to the PGA is the output of the Analog Column Select Mux. This is due to the RF power restrictions imposed by Europe and Japan. Changing the PA level influences the binding distance. ** . register ABF_CR0 is configured to route the odd column in Port0 to the input of the PGA block. higher PA can be used with agreement to the names and definitions in the PA_PHY_TBL[ ] table.No signal attenuation or gain through the PGA block. Figure 4-12. ■ PA_LEVEL_BIND This section helps you to set the PA_LEVEL_BIND variable. When P0. This is the reference to the PGA block and must be chosen as Vss. Reference. AnalogColumn_InputSelect_1 . 4. This user module can be exercised to amplify low-power signals or to also attenuate high power signals. Option with External PA up to +20 dBm RF Applications in most countries other than Europe and Japan (unless there are regional or other restrictions) can go up to +20 dBm.1 is to be read. ■ ■ 48 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. the PGA gain is selected as '1'.0 input is routed to the input of the PGA block by default.2. ■ Gain. # 001-48286 Rev. For the same purpose. 1 . The default table (Table 2) must be commented out and the +20 dBm table (Table 3) must be uncommented for the +20 dBm RF power to be output by the external PA. For coin-cell applications this parameter is not recommended to be set higher than PA6.2 PGA User Module The PGA user module does not serve the traditional purpose in this design.1 inputs (or) the odd and even Port0 inputs.0 and P0. Spec. It exists to facilitate the rout ability of the analog inputs to the ADC analog block. If the devices that are to be bound are across a room from each other. PosInput. 12-bits: Sufficient for temperature sensor application. 2 MHz: 2 MHz is used for sample rate and good linearity.0 and P0. The differential signal is not measured in this case.1 on the PsoC device. Figure 4-13. NegInputGain. These values are used in calculations to measure the ambient temperature. ACB00: This input can be anything. Data format.2. ACB01: Input to the ADC block is actually the output from the PGA. The incremental ADC is used to calculate counts proportional to the voltages at P0. but 2 MHz is the maximum frequency recommended for improved linearity.0 and P0. The PGA block is placed in analog block ACB01. ADCINC User Module The incremental ADC is placed in ASD11 block. due to its implementation which uses the hardware decimator rather than a digital block. Spec. ■ ■ ■ ■ PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. This is done to ease routability of the two input signals from P0. The maximum DataClock frequency is 8 MHz. This ADC may be placed only once. ** 49 .1 inputs. This mux is used to switch between P0. # 001-48286 Rev. NegInput. The input to the PGA is the output of the Analog Column Select Mux. Disconnected: This disconnects the negative input to the device. Data Clock.4. Unsigned: Calculates max counts (4096) when the input equals the reference voltage and min count.0 and P0. ■ ■ Resolution.Firmware 4.1.3 ADCINC User Module The ADCINC is a differential or single input ADC that returns a 6 to 14-bit result. This value is loaded into the Period register. ■ TerminalCountOut The terminal count output is an auxiliary Counter output. # 001-48286 Rev. ■ Period This parameter sets the period of the timer. Timer8 User Module ■ Capture This parameter is selected from one of the available sources. It is always available as an input to the next higher digital PSoC block and to the analog column clock selection multiplexers. but the sleep counts or number of sleep timer expirations. and is set to 255.Firmware 4.2. This parameter is not used in this configuration. The 32 kHz oscillator provides very low accuracy in the order of 18-50% worst case. This is used to calibrate the sleep timer that is clocked by the 32 kHz system oscillator. regardless of the setting of this parameter. This parameter is not used in this configuration. The Timer8 User Module is clocked by the 32 kHz oscillator and is used to calibrate the Sleep Timer (counts) against CPU execution time (1 ms) for better accuracy.4 Timer8 User Module This user module implements an 8-bit timer that is clocked by a divider of SysClk. This parameter is also disabled. Spec. ** . The 32 kHz oscillator or the sleep timer interval is not changed here. The period is automatically reloaded when the counter reaches zero or the timer is enabled from the disabled state.4. ■ CompareOut The compare output may be disabled (without interfering with interrupt operations) or connected to any of the row output buses. ■ CompareValue This parameter sets the count point in the timer period when a compare event is triggered. This value may be modified using the API. The software capture mechanism cannot operate correctly if this parameter is set to a value of one or is held high externally. Figure 4-14. For an 8-bit timer allowed values are between 0 and 255. This is set to LOW. 50 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. This parameter appears only for members of the CY8C29/27/24/22/21xxx and CY8CLED04/08/16 families of PSoC devices. The Sleep Timer included as a part of the CYFISNP user module is clocked by the 32 kHz oscillator. ■ CompareType This parameter sets the compare function type "less than" or "less than or equal". This parameter allows it to be disabled or connected to any of the row output buses. A rising edge on this input causes the Count register to be transferred to the Compare register. The interrupt is not used in this configuration.2. ■ ClockSync Sync to SysClk option to synchronize to SysClk.2.5 Firmware Model Header file main. Port 0. # 001-48286 Rev. ** 51 . The interrupt is enabled using the API.h contains the following components: ■ ■ ■ ■ Macro defines Global variables Thermistor Table Function Prototypes 4.1 Architecture Firmware Layering Figure 4-15. Figure 4-16 on page 52 shows the flowchart. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Spec.6 4.Firmware ■ InterruptType This parameter specifies whether the terminal count event or the compare event triggers the interrupt.2.6. This module is present for debugging purposes. ■ TX8 User Module This module is used for serial communication with host. This option is selected because there could be propagation delays and skew when routing the main system clock through the clock dividers. 4.2 is chosen to output the TX8 data and clock selected is VC3 at approximately 920 kHz clock (VC3 clock = SysClk/1 & VC3 divider = 26). Firmware Layering Node Application Firmware Star Network Protocol User Module Includes CYFISPI & Sleep Timer IO Hardware Layer SPI Interface CyFi Radio The main application firmware architecture is based on the functional block diagram. Calculate Temperature. ** . Stop ADC. Functional Block Diagram Power Up Enable Global Interrupts CYFISNP_Start() Disable CYFI Radio PMU Unit Set Timers – Report Rate & Coincell Is Bind Button Pressed? Yes CYFISNP_BindStart(DevId) Red LED ON No Is Wake Button Pressed? Yes Set ‘SendData_Flag’ No New Temperature Reading Is Yes Report Timer Expired or ‘SendData_Flag’ set? No Is DATA MODE & !CYFISNP_TxDataPend() No CYFISNP_Jog() Yes Turn Analog blocks ON. # 001-48286 Rev.Firmware Figure 4-16. Create App Data Packet. Get Samples. Start ADC. Turn Analog blocks OFF. Spec. CYFISNP_TxDataPut() If requesting Back Channel Data (or) Wall Powered Is CYFISNP_RxDataPend() Yes CYFISNP_RxDataGet() No CYFISNP_Run() CYFISNP_RxDataRelease() 52 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. CYFISNP_Jog API is called to rouse the radio of any connect or ping mode timeouts CYFISNP_eProtState == CYFISNP_DATA_MODE && CYFISNP_TxDataPend() == FALSE The temperature reading takes place only if this condition is true. The serial port pin is inverted and is fed to Port 0. Temperature Readings 3.6. The sleep timer is built into the CYFISNP protocol. These timers are dependent on sleep timer counts. 2. The API starts and initializes the radio.2. 4. if ((!CYFISNP_TimeExpired(&reportTimer))&&(!SendData_Flag)) { return. If this condition is not satisfied. 4. Calibration routine for the timer Low-power considerations are done where applicable in the temperature sensor code. ** 53 . Main loop of the application with general tasks 4. This is set to a default of 0x05.c houses all the firmware for the Temperature Sensor application. Spec. This step is mandatory before the CYFISNP protocol is invoked.2. Turn the CYFISNP Protocol ON. 1. Turn red and green LEDs ON for visual debug. 4. This can be configured for the desired report time in seconds. # 001-48286 Rev.6. Power up initialization and setup 2. Timer Calibration routine is also called here. the application must ensure that it is residing in the 'DATA MODE'. This protocol provides the CYFISNP_TimeSet API for developers to start and enable timers. the hardware block diagram shown in Figure 5-5 on page 86 is implemented in firmware.2 Main.c Main. The firmware can be broken into the following parts: 1. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Ensure global interrupts are enabled. CYFISNP_Start().Firmware 4. The temperature readings are done only if there is a 'Wake button' press or if the report timer expires. Turn TX8 ON for debug purposes. 5.h file. } 2.4 Temperature Readings In this section. In addition.2. 3. Debug functionality is achieved by using a serial TX8 interface and is included in the firmware code where necessary. Disable the CyFi Radio power management unit. 6. or 5 seconds. ❐ Report Time Interval: The Report time is configured by the ‘NewTime’ variable in the main. Enable global interrupts by calling the 'M8C_EnableGInt' macro.2.3 Power Up Initialization and Setup This procedure requires the following steps: 1. Timer Calibration is explained in detail in a later section.6. Savings of around 32 uA are observed. Confirm that the Tx data buffer is empty before starting with the temperature measurement process. Configure Tx Buffer payload bytes. Calculate Temperature based on the two values lVtemp and iVexc. 5. 'odd' inputs are connected by setting bit[1] of the ABF_CR0 register.1 to the PGA input and take another reading and store the value in iVexc.2 is driven a 'high' when the temperature needs to be calculated.Firmware The following steps account for low-power considerations for temperature measurement. 4. Turn Analog OFF and disable the strong drive to the thermistor at P2. 4. #define Vtherm_div_OFF (Vtherm_div_Data_ADDR = Port2_DataShade_OFF) #define Vtherm_div_ON (Vtherm_div_Data_ADDR = Port2_DataShade_ON) 2.2. This essentially turns on the analog SC and CT blocks. The port pin P2. Spec. Then change the analog mux setting to connect P0. 7. Port0. 1.6. This is done using the Vtherm_div_ON define.2. Turn the analog power ON. Disable global interrupts. 54 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Turn ADC and PGA OFF. See AN14278 for an alternate implementation of sleep timer calibration.0 (as shown in Figure 4-16 on page 52) to the input of the PGA. 6. The 32 kHz LPO is not very accurate and its accuracy can change as much as 50%. the thermistor resistor network is not powered continuously. Create an 8-bit timer clocked by the 32 kHz source.0 as the input and store it in lVtemp. ** . CYFISNP_TxDataPut(&txApiPkt). Read the timer value and store it to a variable and stop timer counts. Load the Tx data to be transmitted. Start timer after loading maximum period value (255). #define ReadVTEMPInput (ABF_CR0 = 0x00) #define ReadVTEMP_EXCInput (ABF_CR0 = 0x80) Take an ADC reading with P0. Create a 1 ms delay loop based on CPU cycles. 8. loadTxData(). you can improve this accuracy by calibrating the sleep timer (and indirectly the 32 kHz oscillator) against the internal main oscillator (IMO) running at 24 MHz. Since this design in based on low-power implementation. Call the 1 ms delay loop. Port0. Turn ON the ADC and PGA at medium power. This powers the thermistor/resistor network. 5. 7. This is effected by configuring register ARF_CR. 4. 3. However. #define Analog_ON (ARF_CR = 0x16) #define Analog_OFF (ARF_CR = 0x10) 3. The steps for calibration are: 1. 'even' inputs are connected by clearing bit[0] of the ABF_CR0 register. 2. 6. The output of the PGA is fed to the incremental ADC. This calibration routine can be called every Report Timer expiration or as required. The sleep timer is clocked by the 32 kHz internal low-power oscillator. # 001-48286 Rev. Configure the input mux to connect P0. lVtemp).5 Timer Calibration Routine The sleep timer is a part of the CYFISNP user module and is used to time various events in the protocol. iTemp = CalculateThermData(iVexc. Reenable global interrupts. 6 Temperature Conversion Algorithm One of the tasks required of the Temperature sensor node is calculation of absolute temperature from the ADC readings. 7557. fix those as the upper and lower limits and exit the temperature conversion algorithm. } else {// Scan through the voltage ratio values in the piecewise linear curve fit data to find // the appropriate line to interpolate for(bPointIndex = 0. This is the value that is calibrated depending on the difference in counts of the 8-bit timer. If it exceeds 55°C or 10°C temperature. if ((int)Vtemp < ThermTable[0][0]) {// The voltage ratio is too low. This table has temperature readings corresponding to voltages (ADC readings) at Vtemp(P0.00 in 3C increments. 2500. 5000. A temperature table is created that depends on Steinhart's coefficient for the thermistor used on the FTRF Expansion Board. 4300. A ratio metric value is obtained from the two ADC readings: Ratio = (Vtemp*10000)/Vexc This metric ensures that there is no voltage dependency on the ADC readings and the temperature calculations. there are two temperature values between where the ratio resides.2. This table has values starting from temperature 55. After retrieving these two values. check through the tables to find the two temperatures between where the reading is. 2505. 6328. 3477. 4675. -800. The sleep timer expires every 16 ms.Firmware The number of 32 kHz counts for 1 ms must be 32. 8317.0) and Vexc(P0. 1600. } At the end of this step. 2960. 1900. So. 2200. the counts are changed for the sleep timer. 1000. After the ratio is calculated. Vtemp = MIN. ** 55 . 400. 4900. # 001-48286 Rev. 7269. 700. 4358. -1000} }. } else if((int)Vtemp > ThermTable[0][COUNT_VALUES-1]) {// The voltage ratio is too high. 4. 4000. 3400. so the temperature is less than what can be measured. 4600. The table exists in main. -200. 8463}. the same time period is maintained.6. bPointIndex++) { if (Vtemp < ThermTable[0][bPointIndex+1]) break. The timer counts value is compared to 32. 2725.h: const int ThermTable[2][COUNT_VALUES] = { {2301. If there is no count difference. 7829. 3757. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. bPointIndex < (COUNT_VALUES-2). 8083. interpolate to find the actual temperature. 5998. 1300. 4051. 5331. 100. 3211.00 to 10. 6652. Spec. 5200. 3100. 3700. 5664. 2800.1) inputs. -500. {5500. 6967. so the temperature is greater than what can be measured Vtemp = MAX. If there is a difference. for 5 seconds the sleep timer must expire (5000/16) times. Vtemp) * (itemp1 . This exercises the protocol and must be called for Bind.itemp2)) / (ivalue2 ivalue1) + itemp2. connect. All memory allocation in the Node firmware uses the same 256 bytes of RAM. Check for Bind button press. It is the firmware developer's responsibility to ensure the stack does not overlap with user-defined variables in RAM. The Node firmware is stored and executed out of flash memory. Implemented by the API checkBindButton() 2. This conserves power. because the hardware automatically increments the 16-bit program counter on every instruction making the block boundaries invisible to user code. long Vtemp) 4. Check for Test button press. The accuracy of the temperature reading obtained is two decimal places.Firmware ivalue1 = ThermTable[0][bPointIndex]. Implemented by the API CheckWakeButtion() 3. 4. Call the CYFISNP_Run() API. Scan the bind button every cycle through the main application loop to detect a button bind request from the user. get the temperature value as an integer ivalue1 = Vtemp. The Flash is organized into 2 banks with 64-byte blocks making up 8K in each bank. # 001-48286 Rev. Upon reset. Call the ReadNewTemperature() function. The integer value is then returned back by: CalculateThermData(int Vexc. The micro comes out of sleep when there is a sleep timer interrupt.6. ivalue2 = ThermTable[0][bPointIndex + 1]. determine if the 2nd decimal is >5 and if yes. ** . The accuracy requirement is one decimal place. //Interpolate to find the temperature in hundredths of a deg C Vtemp = (((long) ivalue2 .8 Memory Management: The PSoC 27K parts have 16K of Flash memory. If the last byte in the stack is at address 0xFF the Stack Pointer will wrap RAM address 0x00.7 Main Application loop tasks 1. 56 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.2. The PSoC 27K parts have 256 bytes of RAM. Spec. itemp2 = ThermTable[1][bPointIndex + 1].2. Call M8C_Sleep macro to put the microcontroller in a sleep state. 4. and data modes. As a result. the program counter is reset to 0x00. 5. // First. It is very important for maintaining the RF link between the nodes and the hub. Scan the wake button every cycle through the main application loop to detect a wake event by the user. The user need not be concerned with program store page boundaries. increment the 1st decimal space value by 'one'.6. This is explained in detail in the section Temperature Readings on page 53. ping. // Retrieve the temperatures for interpolation itemp1 = ThermTable[1][bPointIndex]. 3 Wireless I2C Bridge for RF Expansion Card This section discusses the design goals. For this project. you can also operate it by removing it from the battery pack and inserting it into your target hardware or other development platform. This is the application processor that controls the CyFi Radio and the other components on the board. firmware source code modules.2 Firmeware Location The project files are located in the firmware directory as illustrated in Figure 2-9 on page 19. As a result. and configuration options for the FTRF I2C Bridge Node. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. All discussed is the firmware implementation of using the RF Expansion Board as an I2C Bridge to retrieve data packets from an external board through I2C.3. # 001-48286 Rev. ** 57 .3. and transmit the data back to the central hub.Firmware 4.1 Design Features The CY3271 FTRF Kit uses a PSoC CY8C27443 on the RF Expansion Board. architecture. this implementation can be used to 'cut the cord' (within limits) in a wired monitoring application. 4. 4. Spec. Since the FTRF expansion card has its own PSoC. the files you need are in RF_I2C_BRIDGE folder. 3.3 This section describes 4. ** .3.4 4.3. Spec. Functional block diagram for I2C Bridge Node Application Data Ready Chip Select PSoC GPIO PSoC Device H E A D E R SCL SDA PSoC I2C HW PSoC SPI Radio Report Rate Timer RF Expansion board 58 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. # 001-48286 Rev.2 Functional Block Diagram of the Temperature Sensor Node Figure 4-17.4. ROM/RAM Usage Total ROM (Bytes) Node functionality with TX8 Debug enabled 9499 Total RAM (Bytes) 140 4.Firmware 4.3.4.1 Firmware Architecture ROM/RAM Usage Table 4-3. 3.HW and TX8 user modules.3 Device Configuration for CY8C27443 in the RF Expansion Board The CY8C27443 is configured using the Device Editor in PSoC Designer 5.0. Spec. The following section discusses the configuration of global resources and user module parameters for every user modules used. I2C Master .Firmware The FTRF I2C Bridge design consists of the following modules: 1. # 001-48286 Rev.4. Timers for Report Rate 4. I2C Master 2. ** 59 . The node uses the CYFISNP. CYFISNP 3. Timer8. Figure 4-18. Chip Layout View Showing User Modules Placement and Routing PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** .3. Saves power when OFF.92 V LVD Throttleback. VC1= SysClk/N is set as 4. ■ ■ Power Setting. Low A_Buff_Power.4 Global Configuration This section describes the global resources available for configuring the CY8C27443.3V / 24 MHz operation. 3. Trip Voltage [LVD].Analog circuitry is powered using firmware during readings Ref Mux. Yes . Modify these values carefully because they may affect the user modules discussed in later sections. The SPI block in the CYFISNP User Module is clocked with VC1. SysClk/N must be set to '2'. All Off . # 001-48286 Rev. SysClk VC3 Divider. Internal (Internal Main Oscillator) SysClk*2 Disable. This is not used in the configuration settings. which runs the Node application. (Vdd/2)+/.Clocks the TX8 block SysClk Source. Disable Watchdog Enable. not used in design. VC2=VC1/N.Firmware 4. VC1. Global Configuration ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ VC2. Supply voltage at 24 MHz. ■ Figure 4-19. Low Switch Mode Pump. When the SPI clock in PSoC is set at 2 MHz or higher.Power savings Analog Power. the MOSI input must be selected as 'Asynchronous' as shown in Figure 4-19 on page 60. VC3 Source. OFF. This parameter is set to SysClk/2. This clock is set at 6 MHz.(Vdd/2) AGndBypass. Enable 60 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. To run the CPU at 12 MHz. CPU Clock.4. 26 . As a result. 2. Spec. Disable OpAmp Bias. MISO. CYFISNP User Module Node Power Supply This node is powered by Alkaline cells that have low internal resistance. SCLK. and also the low level communication between the radio and the MCU. like node binding.5. and others. External PA PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.txt file. A lower level radio driver firmware that lets the microcontroller (CY8C27443) control the CYRF6936 radio over SPI. This user module controls all wireless communication with the hub. The user module contains an E2PROM component to write the parameters of the Hub to the node's flash. EEPROM Block This parameter defines the EEPROM block number used to store network parameters.3.3. finding a quiet channel. data communication with nodes.5 4. Figure 4-20.1 User Modules used in the I2C Bridge PSoC Project CYFISNP User Module The CYFISNP user module is at the core of the node application firmware. This is required for timing the various events and modes in the protocol. This block must be marked as unprotected in the flashsecurity. ** 61 . The last block in the flash is chosen to write or store the parameters. and the IRQ and nSS lines are correctly configured according to the PSoC drive configurations. In addition. Spec. API calls to the CYFISNP user module affect control. The user module also consists of the Sleep timer configured at 64Hz. this user module also implements the entire Star network wireless protocol. 'Low Impedance Battery' is chosen.Firmware 4. its modes. # 001-48286 Rev. ■ ■ ■ The SPI lines of MOSI. The CYFISNP consists of the following components: ■ A higher level of medium access protocol firmware that takes care of the network level details. Option ‘NO’ must be selected because there is no an external PA. 62 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.Firmware This parameter controls the operation of the external Power Amplifier. Spec. ** . # 001-48286 Rev. Figure 4-21. The clock rate is set to 6 MHz and the 'Async' option is chosen for the line going to the SPI clock. ** 63 .Firmware MUX IRQ on MOSI The CYRF793x device IRQ pin may be multiplexed onto the MOSI pin. The temperature sensor project does not use the multiplexing option. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. because muxing with MOSI is not opted. MOSI The Master-Out-Slave-In (MOSI) output signal is routed to Row_0_Output_1 net. Clock MISO The Master-In-Slave-Out (MISO) input signal is routed to Row_0_Input_0 net. Spec. SClk This output clock is generated by the SPI Master. nSS_Port. nSS_Pin Selects the SlaveSelect pin. and is routed to Row_0_Output_3 net. Pin P2. IRQ_Pin Selects the IRQ pin.6 for the IRQ pin. Choose Pin P2. Clock Selects the SPIM Block Clocking source. IRQ_Port. # 001-48286 Rev.7 is selected to route the nSS signal. Most of the code in the generated header and source files in your project is regenerated each time your project is built. then the node must use the same first and last channels to comply with the hub’s restricted channel subset. This list must be monotonic for proper operation. but the hub does.h that contains tables and variables that you can configure for your project. Default Option with External PA up to +10 dBm This is the default setting or table (Table 2) when external PA is chosen in the User Module parameters.Firmware First Channel This parameter controls the low limit of the channel range of CYFISNP protocol. Config. This is an important consideration when seeking FCC or similar RF certification. Last Channel This parameter controls the high limit of channel range of CYFISNP protocol. This avoids spilling over to other channels. The power can be increased to +20 dBm only in the United States and Canada. # 001-48286 Rev. This table is used only if the External PA option is set to Yes. If the Node application does not use the external PA. You can change the following items in CYFISNP_Config. then the node must use the same first and last channels to comply with the hub’s restricted channel subset. This is an important consideration when seeking FCC or similar RF certification. The external PA is configured such that the RF output power can only go up as high as +10 dBm with this table. This table provides configuration for the following three options: FTRF Coin-cell Application Not applicable for this application because alkaline-cell or low impedance battery is chosen. but the hub does. ** . This list must be monotonic for proper operation. Spec. As a result. the First Channel defaults to Channel 10 (changeable by the developer). the Last Channel defaults to Channel 58 (changeable by the developer).h The CYFISNP User Module generates a file named CYFISNP_Config. especially when using external PA. Option with External PA up to +20 dBm RF Applications in most countries other than Europe and Japan (unless there are regional or other restrictions) can go up to +20 dBm. The exceptions to this rule are sections of code contained between @PSoC_UserCode_name@ and @PSoC_UserCode_END@. The table stops with PA6 because the maximum internal PA is PA6. any changes that you make to this code are lost. If the Node application does not use the external PA. This limitation is due to the RF power restrictions imposed by Europe and Japan. When a PA option is selected in the user module configuration. when the Internal PA is used. This avoids spilling over to other channels. especially when using external PA. 64 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. The default table (Table 2) must be commented out and the +20 dBm table (Table 3) must be uncommented for the +20 dBm RF power to be output by the external PA. ■ @PSoC_UserCode_PaPhyTblExternal_00 This table allows you to customize the eight possible RF power steps for the Dynamic PA feature. This table starts at PA4 since there are no significant current savings below PA4. When a PA option is selected in the user module configuration.h: ■ @PSoC_UserCode_PaPhyTblInternal_00 This table allows you to customize the eight possible RF power steps for the Dynamic PA feature. 4. I2C_Pin Selects the pins from Port 1 to be used for I2C signals.3. The NOT CY8C27xA option is chosen. without using the interrupt or supplied ISR. CY8C27xxx silicon revision A is not used in our design.Firmware ■ PA_LEVEL_BIND This section helps you to set the PA_LEVEL_BIND variable. Two selections are available: RAM ONLY or RAM OR FLASH. In the Node I2C Bridge design. these pins are routed from the PSoC to the female header. only RAM is used for data reads and writes RAM ONLY. the status is reported or a dedicated interrupt may be triggered. The I2C resource supports data transfer at a byte by byte level. and 400K Fast. I2C Master Hardware User Module I2C_Clock Specifies the desired clock speed at which to run the I2C interface. Interrupts may be configured to occur on byte-complete. For the Node I2C Bridge. You do not have to select the proper drive mode for these pins. This module is responsible for transferring data between the RF Expansion Board and the add-on board connected externally. ** 65 . Figure 4-22. This variable allows you to change the PA level used during binding.5. higher PA can be used with agreement to the names and definitions in the PA_PHY_TBL[ ] table. Changing the PA level influences the binding distance. because PSoC Designer does this automatically. There are three possible clock rates available: 50K Standard.2 I2C Master Hardware User Module This user module provides support for the I2C hardware resource on the CY8C27443 PSoC device. It is capable of transferring data at 50/100/400 kbps when the CPU clock is configured to run at 12 MHz. 100K Standard. At the end of each address or data transmission or reception. bus-error detection and arbitration loss. Status reports and interrupt generation depend on the direction of data transfer and the condition of the I2C bus as detected by the hardware. CPU_Clk_speed_(CY8C27xA) The CY8C27xA refers to older CY27xxx devices that are no longer recommended for new designs. Read_Buffer_Types Selects what types of buffers are supported for data reads. P[1]5 and P[1]7 are selected. The I2C master User Module supports polled data transfers on a byte by byte basis. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Spec. 50K Standard I2C clock is selected. The default value of PA4 is good for short distances (within a few feet). On the RF Expansion Board. If the devices that are to be bound are across a room from each other. There are two different selections for SDA and SCL providing direct access to the hardware resource. # 001-48286 Rev. # 001-48286 Rev. regardless of the setting of this parameter. This parameter is also disabled.3 Timer8 User Module This user module implements an 8-bit timer that is clocked by a divider of SysClk.5. The 32 kHz oscillator or the sleep timer interval is not changed here.Firmware 4. For an 8-bit timer. and is set to 255. This value is loaded into the Period register. Period This parameter sets the period of the timer. The Sleep Timer included as a part of the CYFISNP user module is clocked by the 32KHz oscillator. This value may be modified using the API. TerminalCountOut The terminal count output is an auxiliary Counter output. The software capture mechanism cannot operate correctly if this parameter is set to a value of one or is held high externally. A rising edge on this input causes the Count register to be transferred to the Compare register. CompareValue This parameter sets the count point in the timer period when a compare event is triggered. Spec. CompareOut The compare output may be disabled (without interfering with interrupt operations) or connected to any of the row output buses. It is always available as an input to the next higher digital PSoC block and to the analog column clock selection multiplexers. but the sleep counts or number of sleep timer expirations. Timer8 User Module Capture This parameter is selected from one of the available sources. This parameter is not used in this configuration. ** . The period is automatically reloaded when the counter reaches zero or the timer is enabled from the disabled state. the allowed values are between 0 and 255. The Timer8 User Module is clocked by the 32 kHz oscillator and is used to calibrate the Sleep Timer (counts) against CPU execution time (1 ms) for better accuracy.3. This parameter appears only for members of the CY8C29/27/24/22/21xxx and CY8CLED04/08/16 families of PSoC devices. The 32 kHz oscillator provides very low accuracy in the order of 18-50% worst case. This is used to calibrate the sleep timer that is clocked by the 32 kHz system oscillator. Figure 4-23. This is set to LOW. This parameter allows it to be disabled or connected to any of the row output buses. 66 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. 3.5. The interrupt is enabled using the API. This option is chosen because there could be propagation delays and skew when routing the main system clock through the clock dividers. I2C Slave Address. ClockSync Sync to SysClk option to synchronize to SysClk. This parameter is not used in this configuration. # 001-48286 Rev.4 TX8 User Module Used for serial communication with host.6 Firmware Model Header file main. Port 0.h contains the following components: ■ ■ ■ ■ Macro Defines Global Variables Defines for I2C Maximum Payload.1 Architecture Firmware Layering Figure 4-24.7.Firmware CompareType This parameter sets the compare function type "less than" or "less than or equal".3.1 (which is about 920K/8) 4. and others Function Prototypes 4. 4.3. Firmware Layering Node I2C Bridge Application Firmware Star Network Protocol User Module Includes CYFISPI & Sleep Timer IO Hardware Layer SPI Interface CyFi Radio PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. The interrupt is not used in this configuration.n. The purpose is to set the serial port to 115200.3. This module is present for debugging purposes.8. ** 67 . Spec.7 4. InterruptType This parameter specifies whether the terminal count event or the compare event triggers the interrupt.2 is chosen to output the TX8 data and the clock selected is VC3 at approximately 920 kHz clock (VC3 clock = SysClk/1 & VC3 divider = 26). Firmware The main application firmware architecture is based on the functional block diagram. Functional Block Diagram Power Up Enable Global Interrupts CYFISNP_Start() Disable CyFi Radio PMU Unit Set Timers – Report Rate & Coincell Is Bind Button Pressed? Yes CYFISNP_BindStart(DevId) Red LED ON No Is Wake Button Pressed? Yes Set ‘SendData_Flag’ No New I2C Reading Is Yes Report Timer Expired or ‘SendData_Flag’ set? No Is DATA MODE & !CYFISNP_TxDataPend() No CYFISNP_Jog() Yes Turn Chip Select ON. Figure 4-25 on page 68 shows the flowchart. Read 8 bytes from the weather station board (slave) using the I2C interface. Figure 4-25. Wait for 10ms or the Data Ready line to go high. CYFISNP_TxDataPut() If requesting Back Channel Data (or) Wall Powered Is CYFISNP_RxDataPend() Yes CYFISNP_RxDataGet() No CYFISNP_Run() CYFISNP_RxDataRelease() 68 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Spec. ** . Packetize the I2C data in SNP format. # 001-48286 Rev. Disable the CyFi Radio power management unit. DATA_READY_TIME).3.h file. Main loop of the application with general tasks Low-power considerations are done where applicable in the temperature sensor code. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ❐ Report time interval: The Report time is configured by the ‘NewTime’ variable in the main. The Timer Calibration is explained in detail in a later section.7. Ensure global interrupts are enabled. } 2. # 001-48286 Rev.7. 4. Turn TX8 ON for debug purposes. Debug functionality is achieved by using a serial TX8 interface and is included in the firmware code where necessary.c Main.3. Further. the hardware block diagram (Figure 5-5 on page 86) is implemented in the firmware.4 SendNewTxMsg .2. The firmware can be broken into three main parts: 1. 3. Power up initialization and setup 2. or 5 seconds. This step is mandatory before the CYFISNP protocol is invoked. 2. 4. Turn the CYFISNP Protocol ON. if ((!CYFISNP_TimeExpired(&reportTimer))&&(!SendData_Flag)) { return. This API starts an initializes the radio. ** 69 . Calibration routine for the timer 4. Starts a timer for 10 ms CYFISNP_TimeSet(&dataDelay. This can be configured for the desired report time in seconds. This is set to a default of 0x05. The serial port pin is inverted and is connected to Port 0.Firmware 4. a.3. 1.I2C values In this section.3 Power Up Initialization and Setup This involves the following steps: 1.7. By calling the set of CYFISNP_TimeSet. If this condition is not satisfied. 6. the application must ensure that it resides in the 'DATA MODE' and also ensure that the Tx data buffer is empty before starting with the temperature measurement process. Timer Calibration routine is also called here.c houses all the firmware for the I2C Bridge application. Enables the Chip Select b. Savings of around 32 uA are observed. Spec. CYFISNP_Start(). CYFISNP_Jog API is called to rouse the radio of any connect or ping mode timeouts CYFISNP_eProtState == CYFISNP_DATA_MODE && CYFISNP_TxDataPend() == FALSE I2C reading takes place only if this condition is true. I2C Readings 3. 3. Call GetI2CData(). The I2C readings from the MultiFunction board are made only if there is a 'Wake button' press or if the report timer expires. 5. timers can be set for events. Enable global interrupts by calling the 'M8C_EnableGInt' macro.2 Main. 4. Turn the red and green LEDs ON for visual debug.The CYFISNP protocol has the sleep timer built into it. Re-enable global interrupts.loadTxData(). the counts for the sleep timer are changed. Read the timer value and store it to a variable and stop timer counts. ** . Sleep timer expires every 16 ms. I2C_CompleteXfer). Configure Tx Buffer payload bytes . This is the value that is calibrated depending on the difference in counts of the 8-bit timer. The sleep timer is clocked by the 32 kHz internal low-power oscillator.3. e. 4. for 5 seconds. The number of 32 kHz counts for 1 ms must be 32. 2. 8.Firmware c. Create a 1 ms delay loop based on CPU cycles. 6.5 Timer Calibration Routine The sleep timer is a part of the CYFISNP user module and is used to time various events in the protocol. 7. } d.255. Start timer after loading max period value . Waits for timer to expire or Data Ready pin to go high while (CYFISNP_TimeExpired(&dataDelay) == 0) { if(IS_DataReady_ON) break. the sleep timer must expire (5000/16) times. This calibration routine can be called every Report Timer expiration or as required.7. the same time period is maintained. Disable global interrupts. rxBuffer. If there is a difference. Reads the I2C Data and stores it in rxBuffer I2C_fReadBytes(SLAVE_ADDRESS. Call the 1 ms delay loop. It is desired to calibrate the sleep timer (counts of 32 kHz oscillator) against the internal main oscillator (IMO) running at 24 MHz. Spec. 3. If there is no count difference. 4. Disables Chip Select 4. 5. So. Create an 8-bit timer clocked by the 32KHz source. Load the Tx data to be transmitted. 5. # 001-48286 Rev. CYFISNP_TxDataPut(&txApiPkt). 70 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. The steps for calibration are: 1. The 32 kHz LPO is not very accurate and its accuracy can change as much as 50%. Move I2C data from rxBuffer to SNP data packet. The timer counts value is compared to 32. Implemented by the API checkBindButton() 2. Call M8C_Sleep macro followed by 2 nops to put the microcontroller in a sleep state. The user need not be concerned with program store page boundaries.3. The project files are located in the firmware directory as illustrated in Figure 2-9 on page 19. 4. Call the SendNewTxMsg function. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Spec. If the last byte in the stack is at address 0xFF. Call the CYFISNP_Run() API.7 Memory Management: The PSoC 27K parts have 16K of Flash memory. because the hardware automatically increments the 16-bit program counter on every instruction making the block boundaries invisible to user code. Upon reset.Firmware 4. ** 71 . The Node firmware is stored and executed out of flash memory.4 MultiFunction Expansion Card CapSense Slider The purpose of this project is to demonstrate the capacitive sensing capability of PSoC. the program counter is reset to 0x00.3. the files you need are in MF_CD_SLIDE folder. The Flash is organized into 2 banks with 64-byte blocks making up 8K in each bank. and data modes and is very important for maintaining the RF link between the nodes and the hub. The micro comes out of sleep when there is a sleep timer interrupt. It is the firmware developer's responsibility to ensure the stack does not overlap with user-defined variables in RAM. # 001-48286 Rev. 4. Scan the wake button every cycle through the main application loop to detect a wake event by the user. You can change the color of the LED array by moving your finger across the CapSense slider. the Stack Pointer wraps RAM address 0x00. Check for Bind button press.7.6 Main Application loop Tasks 1.I2C values on page 69. This is explained in detail in the section SendNewTxMsg . This exercises the protocol and must be called for Bind. This conserves power.7. ping. This project contains these driver elements: ■ ■ ■ CSD Properties Slider LED Figure 4-26. 5. Check for Wake button press. Scan the bind button every cycle through the main application loop to detect a button bind request from the user. The drivers are configured with the properties shown in Figure 4-27 to Figure 4-30 on page 73. Implemented by the API checkTestButton() 3. All memory allocation in the Node firmware uses the same 256 bytes of RAM. 4. The PSoC 27K parts have 256 bytes of RAM. For this project. Driver Elements Configure the driver elements to control the color of the multicolor LED array. connect. select the Current Mode as "Sourcing". ** . Figure 4-29. Slider Properties In the LED Properties screen. Spec.Firmware Figure 4-27. LED Properties 72 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. CSD Properties Figure 4-28. # 001-48286 Rev. Spec. For all other slider positions. the files you need are in in the MF_CS_SLIDE folder.Firmware Figure 4-30. LED Transfer Function This project can be explained through the following statements: ■ ■ ■ When the finger position on the slider is at the origin. When the finger position is greater than 66 and less than or equal to 99. ** 73 . the LED emits the color blue. When the finger position on the slider is greater than 33 and less than or equal to 66. Driver Elements PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. The project files are located in the firmware directory as illustrated in Figure 2-9 on page 19. the LED emits the color green. the LED emits the color red. When the finger position is in between the origin and position 33. As you move your finger near and far from the proximity detection antenna. For this project. ■ ■ 4. This includes the absence of a finger on the slider. This project contains these driver elements: ■ ■ ■ CSD Proximity Green and Red LED Figure 4-31. the LED is OFF.5 MultiFunction Expansion Card Proximity Sensor The purpose of this project is to demonstrate the capacitive sensing and proximity detection capability of Cypress's PSoC technology. # 001-48286 Rev. the LED is OFF. the red and green LED turn ON and OFF. # 001-48286 Rev. Green LED Properties 74 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Figure 4-34. Proximity Properties In the LED Properties screen. select the Current Mode as "Sourcing". ** . The drivers are configured with the following default properties shown in Figure 4-32 to Figure 4-37 on page 75. CSD Properties Figure 4-33. Figure 4-32. Spec.Firmware Configure the driver elements to control the turning ON and OFF of the two LEDs. Green LED Transfer Function Figure 4-37. # 001-48286 Rev. the red LED turns OFF and the green LED turns ON. ■ PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Red LED Transfer Function This project can be explained through the following statements: ■ When the finger is not close enough to the proximity antenna.Firmware Figure 4-35. the red LED is ON and the green LED is OFF. Spec. ** 75 . As the finger is brought closer and crosses the proximity threshold of the proximity antenna. Red LED Properties Figure 4-36. 4. and green LEDs are used to represent the different temperatures acquired by the thermistor. Setpoints are useful in converting a continuous range of values into a set number of discrete regions. thermistor reading. Spec. it divides the region in which it lies into two regions. SyncedBlinkTimer. and calibrating capabilities of the PSoC device. Buzzer. and blue). the red LED turns back ON and the green LED turns OFF. 76 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.Firmware ■ When the finger is gradually taken away again as it moves further than the proximity threshold. This project contains these driver elements: ■ ■ Temperature. LED. Depending upon the temperature range within which a particular temperature reading is recorded.6 MultiFunction Expansion Card Temperature Sensor This project demonstrates the temperature sensing. This enables you to create a repeating timing interval. This is a Set Point region driver. blue. Setpoints convert a range of input values into a set number of regions. different colored LED blink (red. a Buzzer is sounded out as an alert mechanism. green. This is the thermistor driver. Red. Temprange. ■ ■ ■ Figure 4-38. # 001-48286 Rev. This is an interval generator driver. Driver Elements Configure the driver elements and their associated transfer functions to blink the color coded LEDs for the appropriate temperature ranges and sound the buzzer when the temperature goes above or below extreme thresholds. When a new setpoint threshold is added. This is used to create a sound alert. ** . Figure 2-9 on page 19 in the MF_TEMP folder. When the temperature goes above or below a certain threshold. Firmware The drivers are configured with the following default properties shown in Figure 4-39 to Figure 4-50 on page 80. Spec. Figure 4-39. Green LED Transfer Function PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** 77 . Temperature Properties Figure 4-40. # 001-48286 Rev. Temperature Range Properties Figure 4-41. 1°C. Red LED Properties Figure 4-44. # 001-48286 Rev. 32. 23. Figure 4-43. Green LED Properties 78 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. to demarcate different temperature regions. 21. Each set point has an associated hysteresis of 0.9°C.3°C. The points are 15. Blue LED Properties Figure 4-45.7°C. Spec. varying from -10. Figure 4-42. 18.5. and 35°C. select the Current Mode as "Sourcing". ** .1 °C. Temperature Range Properties In the LED Properties screen. 26. 29.2°C.1°C to 55.4°C.Firmware Different set points are added at different points within the broad range.6°C. Red LED Transfer Function Figure 4-48. # 001-48286 Rev. Buzzer Properties Figure 4-47. Spec. ** 79 . Green LED Transfer Function PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.Firmware Figure 4-46. 1°C The Red LED is ON only if the temperature is between 26.4°C.Firmware Figure 4-49.6°C. LEDs blink only if the Blink Timer is triggered. Buzzer Transfer Function These transfer functions can be explained through the following conditions: ■ The Buzzer is sounded only when the temperature is between -10. Spec.1°C and 15.1°C and 23.0°C and 55.1°C. Blue LED Transfer Function Figure 4-50. The Blue LED is ON only when the temperature is between -10.9°C.1°C and 29. ** . # 001-48286 Rev.7°C and 55. and also when the temperature is between 35. ■ ■ ■ ■ 80 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. The Green LED is ON only when the temperature is between 21. In the LED Properties screen.7 MultiFunction Expansion Card Light Sensor The purpose of this project is to demonstrate a light sensor. # 001-48286 Rev. The drivers are configured with the following properties and Transfer function as shown in For the Light driver. use the default settings. Spec. ** 81 . the light sensor is used to control the brightness of the LED array. Figure 2-9 on page 19 in the MF_LIGHT folder. Figure 4-52. Driver Elements Configure the driver elements to control the brightness of the LED array. In this project. select the Current Mode as “Sourcing”. LED Transfer Function PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.Firmware 4. This is shown in Figure 4-52 to Figure 4-54 on page 82. LED Properties Figure 4-53. This project contains these driver elements: ■ ■ ■ Light LED I2C Slave Figure 4-51. Firmware Figure 4-54. 12C Slave Properties 82 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** . Spec. # 001-48286 Rev. Spec. Schematics All hardware schematics can be found in C:\Cypress\CY3271\Hardware. The FTPC Bridge is the interface bridge between the expansion cards. Since the FTPC Bridge enumerates as a special type of 'composite device' that contains a PSoC Mini-Prog interface.5. Figure 5-1. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. your PC.4 GHZ CyFi Transceiver. ** 83 . It contains a 16-pin connector to connect to the RF Expansion Board or the MultiFunction board. the standard PSoC Programmer utility can identify and communicate with the FTPC bridge. This ensures that your FirstTouch RF Kit is automatically compatible with PSoC Designer. and the CYRF7936 2.1 PC Bridge The PC Bridge consists of the Hub CY8C24894. the Master CY8C24894. PC Bridge The master CY8C24894 also acts as a PSoC programmer and downloads the firmware hex file onto the application CY8C24894. and the various applications. # 001-48286 Rev. for application data exchange or ISSP programming. Hardware 5. The green LED also turns Off when Bind mode times out. # 001-48286 Rev. it blinks at a periodic interval to indicate that the hub is enumerated and functioning normally. Green LED ❐ ■ The green LED lights up when the hub enters Bind mode. Spec. the hub application cannot receive additional RF packets from the nodes.Hardware LED Usage ■ Blue LED The blue LED blinks fast when the bridge is first connected to the USB port of a PC. PC Bridge Layout CYRF7936 2. Make sure that there are no expansion cards connected to the expansion connector. ** . 84 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.1.HEX file to program the application processor. The layout is shown in Figure 5-2. The green LED also blinks when an RF packet is received from any node. Figure 5-2. After hot plug and play is established. the green LED turns OFF. ■ Red LED ❐ Figure 9-1 on page 101 shows the schematic of the PC Bridge. The red LED indicates activity on the I2C bus when the SCD application is communicating with the CyFiSNP hub application. After a successful Bind. These images are also available in the hardware directory in your installation directory. In the event that the packet buffer in the hub application files up. the red remains solid until the buffer is serviced. When in this condition.1 Programming the PC Bridge Application Processor Select FirstTouch RF from the list of programmer devices and then choose the .4 GHz CyFi Transceiver Connector for RF Expansion Board Master CY8C24894 RF Antenna Slave CY8C24894 5. It contains the PSoC CY8C27443.1 RF Expansion Card Overview RF Expansion Card Figure 5-3.2. # 001-48286 Rev. The RF Expansion Board also contains the onboard thermistor. This also makes it easier to transfer your design from the FirstTouch kit to your hardware. ** 85 . which is the application MCU that controls the radio transceiver CYRF7936 and sensors. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. The FirstTouch expansion cards have a dedicated host PSoC device installed. All power for the included expansion cards is provided by either the AA or the coin cell battery packs. Top View RF SECTION: +20 dBm Chip Antenna Programming and Battery Connector Thermistor Pushbuttons and LEDs Expansion Connector The RF Expansion card acts as the node device. Connection to the FTP Expansion Port is through the 8x2 or 5x2 pin header on the expansion card. Spec.Hardware 5.2 5. The particular PSoC installed is chosen as an example to indicate which PSoC is most suitable for the types of applications supported by a particular expansion card. The RF expansion card is designed to plug and play with the FTPC bridge. The schematic is in Figure 9-2 on page 102. 0 Thermistor 86 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** .2. 2 [3. Bottom View Node Application PSoC 5.3 Hardware Design Figure 5-5 shows the hardware design for a temperature sensor design using a thermistor. Spec. # 001-48286 Rev.2 Programming the RF Expansion Card Connect the RF expansion card into the PC Bridge and then select FirstTouch RF from the list of programmer devices. Hardware Design P 2. 3 volts] 390 ohms P 0.Hardware Figure 5-4.1 10 K ohms P 0. Figure 5-5. 5.2. 2 and P1. and the thermistor.3 are configured as active LOW outputs. This drives the 390 ohm resistor.2 is supplied with 3.0 (shown in Figure 5-5 on page 86) are the analog inputs to the ADC. P1. Red LED: The red LED blinks at a five second interval when bound. Spec. The green LED is turned OFF if the bind is successful or when the Bind mode times out.2 on the CY8C27443 on the RF Expansion Board.3 and the Red LED is connected to P1. This ratiometric reading eliminates inaccuracies because of supply voltage. Success of a transmission is determined by reception of the 'ACK' packet from the hub when a data packet is sent. by driving a high (logic '1') to the port pin.3 Green LED After the CD is installed. the reference resistor of 10K. # 001-48286 Rev. The 390 ohm resistor helps to prevent the input signal to the ADC from exceeding the supply voltage rails. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Figure 5-6.Hardware In this operation. The resistance of the thermistor changes with respect to temperature and it is about 10K at 25oC.4 LED Connections The user is provided with two LEDs on the FTRF Expansion Board. When SW2 is pressed for more than two seconds the red LED illuminates solid indicating that the report interval was advanced to the next interval.2.2 470 ohms Red LED P 1. P0.0 and P0. P2. The ratio of the voltages at P0. LED Connections 470 ohms P 1. ** 87 . The node firmware causes the green LED to blink upon successful transmission of a data packet. all hardware schematics are located in a folder such as illustrated in Figure 2-9 on page 19. LED Usage (As controlled by the Node firmware) Green LED: The green LED is turned ON when the node enters Bind mode.3V. The Green LED is connected to P1.1 and P0. 5. When SW2 is released the red LED flashes according to the selected interval: ■ ■ ■ ■ ■ 1 = 1second 2 = 5 seconds 3 = 30 seconds 4 = 1 minute 5 = 5 minutes The power on default is five seconds.1 is proportional to the absolute temperature. Hardware Figure 5-7. RF Expansion Layout 5. the FTMF card also provides the following output devices: ■ ■ ■ ■ The dedicated sensors and output devices on the FTMF Expansion Card help you quickly evaluate and experiment with a variety of PSoC applications.3 MultiFunction Card (FTMF Expansion Card) The FTMF Expansion Card contains a CY8C21434 PSoC that acts as the 'host' for various demonstrations. without having to build any hardware. Your PSoC Express or PSoC Designer project completely determines the remaining FTMF Expansion Card functions. Spec. # 001-48286 Rev. 88 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** . or both I2C Digital Communications Four Unused A/D GPIO Lines for User Functions In addition to the above input sensors. The kit installation contains demonstration projects that use the following input sensors: ■ ■ ■ ■ CapSense Slider Temperature Sensor Ambient Light Sensor CapSense Proximity Sensor The FTMF Expansion Card uses a standard FirstTouch expansion header to connect to the FirstTouch RF Expansion Board or other target hardware. The FTMF Expansion Card has hardware to support the following PSoC powered peripheral applications: ■ ■ ■ ■ ■ CapSense 'Touch Button' CapSense '7-Element Touch Slider' CapSense 'NonTouch/Proximity Detection' Ambient Light-Level Detection Thermistor-based Temperature Measurement Red-Green-Blue Triple LED Cluster Audible Magnet Transducer or Speaker. These images are also available in the CDROM that is shipped with the kit. ** 89 .Hardware Figure 5-8. or any combination of the four types. This pin selection makes them true analog or digital GPIO. These IO pins are specifically chosen because they can operate as analog outputs. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Failure to do so may cause unpredictable or unplanned project results. FTMF Layout The schematic is shown in Figure 9-3 on page 103. The layout for the MultiFunction Expansion Card is shown in Figure 5-9. but you must ensure to always assign the correct pins within your project. digital inputs. Figure 5-9. Spec. You can use the sensors and output devices in any way you want within your project. analog inputs. # 001-48286 Rev. digital outputs. These are hard wired to four unused Port 0 IO pins on the CY8C21434 host and allow you to easily connect the FTMF Expansion Card to your specific hardware or sensors. FTMF Expansion Card Notice that the 8x2 pin expansion header also includes four General Purpose IO connections labeled P02-P05. Hardware 5. Spec. # 001-48286 Rev. Figure 5-10.4 AAA Power Pack The AAA power pack can hold two AAA batteries and is used to power the RF Expansion cards. AAA Layout 90 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. ** . The schematic is shown in Figure 9-4 on page 104. It also contains a 16-pin connection header to connect with the RF board. ** 91 . Spec.5 CR2032 Power Pack The CR2032 power pack can hold one CR2032 coin cell battery and is used to power the RF Expansion cards.Hardware 5. It also contains a 16-pin connection header to connect with the RF board. Figure 5-11. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. CR2032 Layout The schematic is shown in Figure 9-5 on page 105. # 001-48286 Rev. This enables coin cell ultra low-power operation. Spec.Hardware 92 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. # 001-48286 Rev. ** . Spec.4 to 3. Specifications 6.3 PC Bridge ■ ■ ■ ■ USB powered Support for I2C and up to 5 General purpose IOs Operating temperature from 0 to 50°C Support programming of the following PSoC families: ❐ ❐ ❐ ❐ 21xxx 24xxx 27xxx 29xxx 6.4. scientific. GFSK data rate of 1 Mbps 6.5.412 .460 GHz at +20 dBm (PA enabled) Less than 240 mA operating current (Transmit at 20 dBm) Transmit power up to +20 dBm (Europe and Japan limited to +10 dBm) Receive sensitivity up to -93 dBm Operating range of up to 1 km or more DSSS data rates up to 250 kbps.483 GHz.2. ** 93 .2 RF Expansion Card ■ ■ ■ ■ Operating voltage from 2.4 MultiFunction Expansion Card ■ ■ Operating voltage from 2.6. and medical (ISM) band: ■ ■ ■ ■ ■ ■ 2.25V Operating temperature from 0 to 50°C PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.1 General RF FTRF operates in the unlicensed worldwide industrial.400 . up to 0 dBm and 2.2. # 001-48286 Rev.6V Operating temperature from 0 to 50°C Expansion connector can supply up to 100 mA at 3.3VDC Support for I2C and up to 5 General purpose IOs 6. Specifications 6.5 Certifications This kit is designed to implement wireless device links operating in the worldwide 2.4 GHz ISM frequency band. It is intended for systems compliant with worldwide regulations covered by: ■ ■ ■ Europe ETSI EN 301 489-1, ETSI EN 301 489-7, & ETSI EN 300 328-1 USA FCC Part 15 Industry Canada RSS-210 standards. This device complies with part 15 of the FCC rules. Operation is subject to the following two conditions: 1. This device may not cause harmful interference. 2. This device must accept any interference received, including interference that may cause undesired operation. Note The manufacturer is not responsible for any radio or TV interference caused by unauthorized modifications to this equipment. Such modifications could void the user's authority to operate the equipment. RF Exposure Warning This equipment complies with FCC radiation exposure limits set forth for an uncontrolled environment. This device must be installed in accordance with the provided instructions and must be operated with minimum 20 cm spacing between the antennas and a person’s body during wireless mode of operation. Further, this transmitter must not be co-located or operated in conjunction with any other antenna or transmitter. 94 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF, Spec. # 001-48286 Rev. ** 7. Frequently Asked Questions 1. What kind of range can I expect from the CY3271? ■ The CY3271 features CyFi transceivers with power amplification on both the PC Bridge and the RF Expansion Card, for a maximum possible RF output of +20 dBm. This translates to over 400m of line of sight (LOS) range in open space. However, the firmware projects that are included with the CY3271 limit the RF output power to lower than +20 dBm: In the Ultra Low Power Temperature Sensor Demo, which uses the CR2032 coin cell battery, the power amplifier circuitry is disabled to extend battery life, and the CyFi transceiver output power is limited to a maximum of 0 dBm. However, because the RF signal still passes through the transmit and receive switches, there is a path loss of approximately 3 dBm. This translates roughly to LOS range of 30m in open space, which is slightly worse than the 50m LOS range that is typically expected from the CyFi transceiver with 0 dBm output power. This is an issue with this specific implementation, and not a reflection on the range that can be achieved by the CyFi transceiver in real implementations. The following figure shows the difference between the implementation in the CY3271 and a typical implementation. Figure 7-1. 0 dBm Configuration in CY3271 Sustains 3 dBm Loss Due To Passing Through T/R Switches. 0-dBm TR CyFi Transceiver -3-dBm Loss PA TR Figure 7-2. In a Typical Nonpower Amplified Implementation, the Output of The Transceiver does Not Pass Through T/R Switches, and No Loss Is Sustained. MATCHING CyFi Transceiver 0-dBm ■ In the Wireless I2C Bridge project, the power amplifier is limited to a maximum of +10 dBm. This is due to regulatory compliance requirements by ETSI (Europe) and TELEC (Japan). This translates roughly to a range of 150m LOS. However, customers that are using the kit in the United States may choose to modify the included projects, according to the instructions in this User PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF, Spec. # 001-48286 Rev. ** MATCHING 95 Frequently Asked Questions Guide, to increase the maximum RF output power to +20 dBm for prototyping purposes. In that case, the maximum range that the kit is capable of can be achieved. The following figure illustrates the maximum power output that the kit is programmed for international compliance, vs. what is possible for customers in the United States: Figure 7-3. Out-Of-Box Maximum Output Power Configuration For International Regulatory Compliance -6-dBm TR CyFi Transceiver +16-dBm Gain PA TR Figure 7-4. Maximum Allowed Output Power Configuration For US Customers MATCHING +4-dBm CyFi Transceiver TR +16-dBm Gain PA TR 2. What does the red LED on the PC Bridge indicate? The red LED indicates I2C activity between the SCD software application and the RF Hub application. It should be blinking any time the SCD application is running. If the LED is on solid, this means that the RF Hub packet buffer is full. This will happen when the SCD application is not running but nodes are continuing to send data to the RF Hub. The red LED will also go solid if the SCD software application is unable to keep up with the rate of packets arriving from the nodes. 3. How many devices do I need to implement a typical sensor application? The CY3271 was built for modularity and adaptability, and therefore uses more PSoC devices to accomplish this goal than would be typically necessary to create a sensor application. For example, the conceptual block diagram for the Wireless MultiFunction Temperature Sensor Demo, which is one of the many demos that can be performed with the CY3271, is shown in the following figure: MATCHING 96 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF, Spec. # 001-48286 Rev. ** This PSoC is open for experimentation by the kit user. ** 97 . and also acts as the programmer. which combined with the on-board CyFi transceiver. The RF Expansion Card has its own PSoC so that it can operate standalone as a wireless node. The additional functionality that is required from the PC Bridge and the RF Expansion Card necessitates the additional PSoC components discussed here. so that they can operate either standalone (when connected directly into a battery power pack). Contrast this to what a typical implementation in a real system would appear: Figure 7-6. two PSoC devices are provided in the PC Bridge. acts as the hub of the CyFi network. The CY3271 PC Bridge was designed to act as the interface for the CY3271 into the PC.Frequently Asked Questions Figure 7-5. or optionally accept sensor boards such as the MultiFunction Board (the usage model is shown in Figure 7-5). and as the CyFi wireless hub for wireless demos. To accomplish all these goals. The second PSoC is a target device. The firmware on this PSoC is protected to ensure seamless operation for the entire kit at all times. which is achieved by using I2C. Wireless Thermistor System in a Typical Implementation USB PSoC SPI CyFi Trans ceiver Wireless Hub PC Dongle CyFi wireless link Therm is tor CyFi Transceiver SPI PSoC Wireless Sensor Node PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. as a programmer for all target PSoCs within the CY3271 system. Spec. This requires PSoC-to-PSoC communication across the expansion connector. The first PSoC provides a USB-to-I2C bridge to the PC. Wireless Thermistor System Using CY3271 USB Programm er PSoC I2C Application PS oC SPI CyFi Transceiv er PC Dongle CyFi wireless link Therm istor Connector C yFi Transceiv er SPI PSoC I2C PSoC RF Expansion Board MultiFunction Board The modularity of the CY3271 system means that sensor boards such as the MultiFunction Board have their own PSoC devices. # 001-48286 Rev. or in conjunction with the RF Expansion Card (the usage model is shown in Figure 7-5). 6. which features two additional RF Expansion Cards. because the system in Figure 7-6 does not have the burdens of the CY3271 in terms of the additional functionality it must accomplish. Can I evaluate the power consumption of PSoC and CyFi Low-Power RF with the CY3271? As described in the answer to question 2 in this FAQ. its component count is smaller. c. To do so. Because of this. and ground. but not an ideal system to evaluate their power consumption. ** . the CY3271 does indeed demonstrate low power operation with the Ultra Low Power Temperature Sensor demo. the power configuration of the AAA Power Pack and the RF Expansion Card was designed to supply a fairly large amount of current. The CY3271-EXP1 is only the first of many CY3271-EXP* kits that will be released by Cypress to extend the functionality of CY3271. and two additional AAA Power Packs. you can create a sensor board that connects into the RF Expansion Card.100" male header that mates with the RF Expansion Card's 8x2 0. Can I create my own sensor boards to work with the CY3271? Yes. because the CY3271 enables the user to connect sensor boards into the expansion header of the RF Expansion Card. VDD. Spec. follow these steps: a. there was a need to accommodate a wide range of voltage and current requirements that make up the CY3271 system. Limit the current consumption on your sensor board to 50 mA. This makes the CY3271 an ideal system to experiment with the functionality of PSoC devices and CyFi Low-Power RF. This necessitated the use of several voltage converters that ensure that the various boards in the CY3271 work both standalone and in tandem. humidity. and ambient light sensors. the RF Expansion Card. 5 GPIOs. Cypress offers the CY3271-EXP1 Sensor Expansion Pack. a single PSoC device can be used on the wireless node end to read the thermistor measurement and run the CyFi network protocol stack. which uses the CR2032 Power Pack. What other kits work with the CY3271? The modularity of the CY3271 enables a large variety of sensor boards to be added to the kit to showcase more applications. For example. b. 7. These include an I2C interface. # 001-48286 Rev. 98 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. The header signals must match the specification provided as part of the RF Expansion Card schematic in the Appendix of this User Guide. 4. However. featuring temperature. Note that both systems in Figure 7-5 on page 97 and Figure 7-6 accomplish the same ultimate purpose when it comes to reading the value of the thermistor and reporting it wirelessly to a PC. Customers that are interested in creating wireless networks with a larger number of nodes can order the CY3271RFBOARD. Similarly on the wireless hub side. which features two sensor expansion boards: ■ ■ Pigtail Thermistor Board Weather Station Board.100" female receptacle. What if I want more than one wireless node? The CY3271 ships with one wireless node. which both supplies your board with power. pressure. out of the box. a single PSoC can act as the USB interface into the PC and run the CyFi network protocol stack.Frequently Asked Questions In this implementation. 5. and enables you to transmit sensor data to a PC using CyFi Low-Power RF. Your sensor board must use a 8x2 0. However. the CY3271 was designed to demonstrate a wide range of functionality in a very modular way. LCD interface. and connections for power and ground mates easily with common prototyping hardware. located in the Appendix of this User Guide. Spec. in-system programming. 5 GPIOs. generous prototyping area. The RF Expansion Card's 8x2 0. visit http://www. The connector specification is available in the RF Expansion Card schematic. and RS232 interface Firmware tutorials and examples PSoC Designer software Sense and Control Dashboard software ■ ■ ■ Though the CY3210-CYFI ships with PSoC Evaluation Pods for the 29xxx and 24x94 families. I have evaluated PSoC and CyFi Low-Power RF.001" male header. which features an I2C interface. The CY3210-CYFI features: ■ ■ ■ Two PSoC Evaluation Pods (29xxx family and 24x94 family) Two CyFi transceiver RF modules Two development baseboards with ZIF sockets. # 001-48286 Rev. flexible power options. RF module headers. and I want to continue with development. PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.cypress. ** 99 . In addition. allowing you to choose the PSoC device that is most suited for your application. 9. it enables development with most other PSoC families.com/training to find training on PSoC devices and CyFi LowPower RF. you can re-use the RF Expansion Card as a wireless module for development and prototyping purposes. What are the next steps? The recommended next step is to acquire the CY3210-CYFI Low-Power RF Development Kit.Frequently Asked Questions 8. What else can I do with the CY3271 hardware? After you are done experimenting with the CY3271 kit itself. # 001-48286 Rev.Frequently Asked Questions 100 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. Spec. ** . 47 uFd 34 RST SS SCK MOSI MISO IRQ 2 VBAT2 VBAT1 VBAT0 VREG NO LOAD R32 1 1 0603 0603 VCC1 VCC2 VCC3 VDD VIO 1 0402 2 0=EXTERNAL 1=LOCAL 1 0603 100K C10 0. Transmit with PA off. September 07.2K 2 2. ** 0402 UPG2214TK UPG2214TK 2 C17 1.2K ZERO SDA SCL R26 1 R25 1 ZERO 0603 0603 DAT894 R24 CLK894 2.0 pF 2.0 uFd 5 nSHDN GND GND GND IN OUTPUT SENSE BYP 1 2 C49 4 1 0603 2 LP_SCLK LP_MOSI LP_IRQ LP_nSS TV7 TV-20R TV-20R V33 SW1 SW1 0603 0603 C50 2 0805 10 uFd 16V 2 2 560 pFd GND1 GND2 EPAD TV8 LT1763CS8-3.2K 2 EXT_XRES EXT_CLK 2 V33 U11 1 VCC 5 1 C5 2 0402 0603 0402 0402 0603 0603 VBUS DM DP GND S1 S2 1 2 3 4 5 6 R29 1 R28 1 2 24 ohm 2 24 ohm XRES894 21 20 36 45 54 46 53 47 52 48 51 25 18 26 17 27 16 28 15 DM DP XRES P0_0 P0_1 P0_2 P0_3 P0_4 P0_5 P0_6 P0_7 P1_0 P1_1 P1_2 P1_3 P1_4 P1_5 P1_6 P1_7 ISSP-RADON LOCAL_DAT R30 VDD1 VDD2 J3 1 Resettable Fuse V33 C2 1 2 2 SW1 NO LOAD A Rev ** of 2 101 .2 nH L2 IND0402 27 pF C3 1 2 0402 VUSB 24 25 27 28 26 PACTL XTAL 30 1 TV-20R TV6 2.47 uFd 8 6 38 33 40 3 7 16 35 V33 U1 CYRF7936 C12 0.047 uFd 1 0402 C14 0.1 uFd 3 GND NC7SV34P5X 2 4 VCC 5 41 1 1 0402 0402 R23 2.2K 25 18 26 17 27 16 28 15 1 R37 D3 2 2 1 0402 0603 R20 1 R21 1 2 2. PC Bridge Schematic 5 4 3 2 1 V33 8x2 0.047 uFd D 0402 1 ISSP-RADON NO LOAD C9 0.1 uFd 1 C46 0. September 07.047 uFd nPASSIVE/ACTIVE SDA SCL V33 VUSB J1 1 2 3 4 5 1 2 3 4 5 5 PIN HDR FTPC0[6] FTPC0[5] EXT_XRES EXT_CLK EXT_DAT ISSP_SEL 1 D XRES894 CLK894 DAT894 2 2 FTPC0[4] FTPC0[3] FTPC0[2] C8 0.1 uFd B 2 2.047 uFd 0402 C39 1 2 2 2 100K C43 2 0.1uF 2 1 C22 27 pF DEA202450BT-1213C1 U3 OutPut N.1uF 1 0402 C26 0. 2008 Sheet 1 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.2K 36 45 54 46 53 47 52 48 51 RXPA GND1 GND2 EPAD 560 ohm 19 50 57 CY8C24894 QFN56 nPASSIVE/ACTIVE 1 R33 0603 LED2 SDA SCL 330 ohm LP_MISO 41 2 42 1 43 56 44 55 U9 8 1 C47 0. or receive.2 uFd VUSB LP_IRQ 0603 0603 2 Y1 1 4 3 C 2 F1 1206L 2 350mA 22 49 37 U7 2 4 5 9 14 15 17 18 P3_0 P3_1 P3_2 P3_3 P3_4 P3_5 P3_7 P4_0 P4_1 P4_2 P4_3 P4_4 P4_5 P4_6 P4_7 P5_0 P5_1 P5_2 P5_3 P5_4 P5_5 P5_6 P5_7 P7_0 P7_7 33 10 34 9 35 8 7 37 6 38 5 39 4 40 3 29 14 30 13 31 12 32 11 24 23 R19 1 0603 XOUT L/D NC1 NC2 NC3 NC4 NC5 NC6 NC7 NC8 GND1 E-PAD RESV NC9 NC10 NC11 NC12 NC13 NC14 NC15 NC16 29 2 19 20 21 22 23 31 32 36 39 TV-20R TV5 eCera FX 12MHz C 1 R31 0603 0603 1 USB A RA PLUG SMD 12 100 ohm V33 100 ohm P04 2 2 LOCAL_XRES LOCAL_CLK V33 U10 2 2.0 pF 1 3 2 4 0402 0402 C27 0.1 uFd 0805 IND0603 0402 0402 2 RFbias RFp RFn 10 11 13 L1 1 47 nH 2 C1 1 0402 LP_RF_RX_TX C4 2. They will be changed to NO LOADs for the Beta PCAs.1uF 0.01 uFd VUSB LP_nSS LP_SCLK LP_MOSI LP_MISO 1 C45 0.2 nH 2 3 5 4 L4 1 L5 1 IND0402 12 nH 2 2 C24 2.047 uFd VUSB 1 0402 2 R22 ISSP_SEL 0.0 pF C44 2.1uF ANT1 Antennova Rufa 5 B A Rev ** 2 of 2 0603 VUSB V33 100K LED1 LED GREEN 1 2 Sheet 1 0603 1 560 ohm R36 LED RED D2 2 2 1 0603 0603 0603 TV-20R TV12 0603 0603 Note: R30 and R31 are to be loaded for the Alpha PCAs only.2K 0.0 pF 0402 2 2 1 1 2 5. 2008 1 10K 2 5 4 3 2 5 4 3 2 1 D D V33 V33 1 1 0402 0402 V33 L3 1 C25 27 pF 1 0402 IND0402 C23 10 pF 1 C6 0402 0.Appendix Figure 9-1.1uF TXPA RXPA 4 6 5 0402 0402 U6 1 3 2 C31 1 18 pF 2 C32 1 C33 1 0402 1 1 1 2 Vcont2 Vcont1 Input OutPut1 OutPut2 GND 1 3 2 OutPut1 OutPut2 GND Vcont2 Vcont1 Input 4 6 5 2 18 pF RXPA C16 1 18 pF 2 0402 0402 LP_RF_RX_TX B C15 1 18 pF 2 TXPA TXPA RXPA RXPA RXPA (LP XOUT) 0 TXPA (LP PACTL) 1 Input to OutPut1 ON Input to OutPut2 OFF Mode of operation for transmit and receive Transmit with PA on and at fixed gain.1 uFd TXPA ISSP-RADON 2 2 R42 1 R41 1 0402 0402 2 ZERO 2 ZERO 2 2 0603 0603 LDO_ON ISSP_SEL Input B 41 2 42 1 43 56 44 55 P2_0 P2_1 P2_2 P2_3 P2_4 P2_5 P2_6 P2_7 U8 TV2 TV3 VUSB TV1 LOCAL_XRES 0603 22 49 TV4 VDD1 VDD2 21 20 R39 1 0603 DM DP XRES P0_0 P0_1 P0_2 P0_3 P0_4 P0_5 P0_6 P0_7 P1_0 P1_1 P1_2 P1_3 P1_4 P1_5 P1_6 P1_7 P2_0 P2_1 P2_2 P2_3 P2_4 P2_5 P2_6 P2_7 2 4 3 P3_0 P3_1 P3_2 P3_3 P3_4 P3_5 P3_7 P4_0 P4_1 P4_2 P4_3 P4_4 P4_5 P4_6 P4_7 P5_0 P5_1 P5_2 P5_3 P5_4 P5_5 P5_6 P5_7 P7_0 P7_7 33 10 34 9 35 8 7 37 6 38 5 39 4 40 3 29 14 30 13 31 12 32 11 24 23 LED1 LED2 GND NC7SV34P5X R9 NO LOAD 0402 0.1uF 7 C UPG2250 0402 C35 0.C Vcont GND_PAD VDD2 VDD1 INPUT 1 1 6 2.1uF 18 pF 2 C36 TXPA 0.1 uFd 1 C41 V33 0.1uF C34 0402 27 pF C30 2 2 4 3 GND RF out GND RF in 2 1 2 FLT1 C29 0. Spec. Tx level of LP Radio varies total Tx power. # 001-48286 Rev.1 uFd 1 C48 1.047 uFd 1 0402 2 C13 0. 1 R27 D1 2 1 2 FTPC0[2] FTPC0[3] FTPC0[4] FTPC0[5] FTPC0[6] LED BLUE 1 2 LOCAL_DAT LOCAL_CLK R38 1 R40 1 2 2.3 TV9 TV-20R TV10 TV-20R TV11 TV-20R LDO_ON 3 4 A 3 6 7 SW PUSHBUTTON SMT CY8C24894 QFN56 TV-20R TV13 1 19 50 57 R34 0603 PCB: PDCR-9439 CYPRESS SEMICONDUCTOR © 2007 Title FIRST TOUCH PC BRIDGE (103-007-P3) Size C Date: Document Number REF-14667 Sunday.100" FEMALE Expansion Port 1 0402 V33 P1 1 3 5 7 9 11 13 15 V33 nDISCON/BOOST GND TYPE ISSP_XRES SDA ISSP_CLK SCL ISSP_DAT VBATT ISSP_SEL FTPC0[4] FTPC0[6] FTPC0[3] FTPC0[5] FTPC0[2] 8X2 PIN RECPT RA 2 4 6 8 10 12 14 16 V33 C11 0. 1 A 0 OFF ON 1 PCB: PDCR-9439 CYPRESS SEMICONDUCTOR © 2007 Title FIRST TOUCH PC BRIDGE (103-007-P3) Size B Date: 5 4 3 2 Document Number REF-14667 Sunday.2K 1 EXT_DAT 1 C40 0.2K 2 2.6 nH IND0402 2 2 2 R5 0402 1 0402 2 C 1 2 160 1% 1 R4 0402 160 1% 2 2 2 U5 C28 0. 2008 Sheet 1 5 4 3 2 102 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.2K R28 2.3 0402 5 4 5 4 D 1 1 0402 0402 VIN L3 1 C25 27 pF 1 0402 IND0402 C23 10 pF 1 C6 0402 0.1uF 1 2.1uF 18 pF 2 C36 TXPA 0.1 uFd 1 R3 2 1 1. Spec.01 uFd NO LOAD 2 A TV-20R TV6 VOUT_33 2 4 5 9 14 15 17 18 2 1 2 A 3 1 C43 10 uFd 16V NO LOAD 1 C44 10 uFd 16V PCB: PDCR-9400 CYPRESS SEMICONDUCTOR © 2007 Title FIRST TOUCH RF EXPANSION BOARD (103-006-P3) Size B Date: Document Number REF-14204 Wednesday. Transmit with PA off.1 uFd TXPA 0402 RFp 11 2 CY8C27443 SSOP28 2 RFbias 10 L1 1 47 nH 2 C1 1 27 pF VIN 2 C4 0402 LP_RF_RX_TX U7 1 VCC 5 1 C18 2 B 2.1 uFd RXPA 2 0.2 nH 2 3 2 N.100" FEMALE Sensor/FTMF Receptacle VIN 1 3 5 7 9 11 13 15 J1 VIN nDISCON/BOOST TYPE GND SDA ISSP_XRES SCL ISSP_CLK ISSP_DAT VBATT ISSP_SEL FTPC0[4] FTPC0[6] FTPC0[3] FTPC0[5] FTPC0[2] 8X2 PIN HDR RA 2 4 6 8 10 12 14 16 VOUT_33 1 3 5 7 9 11 13 15 C37 P1 V33 nDISCON/BOOST TYPE GND ISSP_XRES SDA-SHDN ISSP_CLK SCL-CTRL ISSP_DAT VBATT ISSP_SEL FTPC0[4] FTPC0[6] FTPC0[3] FTPC0[5] FTPC0[2] 8X2 PIN RECPT RA 2 4 6 8 10 12 14 16 nPASSIVE/ACTIVE I2C_SDA I2C_SCL GPIO4 GPIO3 GPIO2 1 0402 VOUT_33 R20 390 0603 VTEMP_EXC TV8 TV-20R R18 1 2 10K .0 pF 0402 P0_0 P0_1 P0_2 P0_3 P0_4 P0_5 P0_6 P0_7 24 4 25 3 26 2 27 1 VTEMP VTEMP_EXC GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 BATT_LVL NO LOAD 0402 0402 ISSP_DAT ISSP_CLK LED1 LED2 SW2 I2C_SDA SW1 I2C_SCL 15 13 16 12 17 11 18 10 P1_0 P1_1 P1_2 P1_3 P1_4 P1_5 P1_6 P1_7 2 2 XRES 19 ISSP_XRES 1 2 C9 1 uFd 0402 330 ohm C14 VBATT 0.047 uFd 2 R35 237K 1% R31 237K 1% 1 0402 0402 1 VIO 1 IND0603 0402 14 B C3 1 0402 2 3 GND NC7SV34P5X 1 RFn 13 L2 1 IND0402 2 2. 2008 Sheet 1 12 0805 0805 0805 0805 2 2 2 2 41 LTC3525-3.047 uFd 0402 SW2 C11 0.0 ohm 1% R6 0402 0402 1 1 0402 0402 VCC C 47 ohm 0402 1 1 VIN C10 0.5mm TV-20R LP_IRQ 2 R34 1 6 5 4 1 C45 10 uFd 16V 1 C46 10 uFd 16V 10 NO LOAD 0603 37 C42 2 1 0603 L/D NC1 NC2 NC3 NC4 NC5 NC6 NC7 NC8 E-PAD GND1 RESV NC9 NC10 NC11 NC12 NC13 NC14 NC15 NC16 19 20 21 22 23 31 32 36 39 TV5 TV-20R Y1 1 2 4 3 eCera FX 12MHz 10 uH U2 10K 1 nSHDN GND VIN SW GND VOUT 2 4 3 GND NC7SV34P5X R8 NO LOAD 0402 0.047 uFd 0.1 uFd 2 0402 P2_0 P2_1 P2_2 P2_3 P2_4 P2_5 P2_6 P2_7 0.1% 0603 VTEMP 2 1 2 RT1 2 1 8x2 0.047 uFd LED2 1 U4 2 560 ohm R29 0603 0603 C8 C13 2 LED RED D2 2 2 1 C 0603 0402 0402 0402 0402 D 0402 0402 0402 0402 0402 GPIO6 GPIO5 R22 R23 NO LOAD NO LOAD R19 R25 R24 GPIO4 GPIO3 GPIO2 390 TV1 TV-20R VTHERM_DIV VOUT_33 SW1 SW1 1 3 2 4 TV2 TV-20R GPIO6 GPIO5 VIN NO LOAD R7 VIN C19 0.47 uFd VIN 8 6 38 33 40 3 7 16 U1 CYRF7936 C12 0.1uF C17 1. July 16.1uF TXPA RXPA 4 6 5 0402 0402 U6 1 3 2 C31 1 18 pF 2 C32 1 C33 1 0402 1 1 1 2 Vcont2 Vcont1 Input OutPut1 OutPut2 GND 1 3 2 OutPut1 OutPut2 GND Vcont2 Vcont1 Input 4 6 5 B 2 18 pF RXPA C16 1 18 pF 2 0402 3 2 4 0402 LP_RF_RX_TX C15 1 18 pF 2 2 TXPA TXPA RXPA RXPA RXPA (LP XOUT) 0 TXPA (LP PACTL) 1 Input to OutPut1 ON Input to OutPut2 OFF Mode of operation for transmit and receive Transmit with PA on and at fixed gain.Appendix Figure 9-2.1uF 1 0402 TV9 PACTL XTAL 30 TV3 1 TV-20R 2.1uF 2 1 2 12 nH 2 1 C24 0402 2 2 C26 0.47 uFd 34 LP_nSS LP_SCLK LP_MOSI LP_MISO R16 1 R15 1 R17 1 2 1K 2 1K 2 1K 24 25 27 28 26 RST SS SCK MOSI MISO IRQ 35 0402 0402 1 R2 ZERO 0402 2 100K 1% C20 C39 1 2 0402 TV-20R TV10 R32 0402 VBAT2 VBAT1 VBAT0 VREG VSS 100K 2 SMP 9 0402 VCC1 VCC2 VCC3 VDD LP_MISO 20 nPASSIVE/ACTIVE 8 VTHERM_DIV 21 LP_SCLK 7 22 LP_MOSI 6 LP_IRQ 23 LP_nSS 5 1 C41 0.0 pF 2 5. Tx level of LP Radio varies total Tx power.1uF 7 2 2 2 2 U5 C28 0. # 001-48286 Rev.047 uFd 1 R1 LED GREEN 2 1 R30 2 BATT_LVL 1 1 1 ANT1 Antennova Rufa 5 2 0603 R27 2. RF Expansion Card Schematic 5 4 3 2 1 8x2 0.1uF 2 1 2 2 C 1 2 R5 0402 1 0402 1 160 1% 0402 2 1 R4 160 1% C29 0.2K 28 0603 10 uFd 0402 0.0 pF VIN U8 1 C2 VCC 5 1 2 XOUT 29 2 2 3 2 3 2 VIN VIN C22 27 pF DEA202450BT-1213C1 U3 OutPut VDD2 6 4 0402 GND RF out GND RF in 2 1 C C30 27 pF 3 2 FLT1 0402 C35 0. July 16. or receive.100" MALE Expansion Port VOUT_33 ZERO 0402 VOUT_33 1 C38 0.2 nH VIN = 2.1 uFd NO LOAD NO LOAD 1 R21 2 25 10K 1% D 0402 SW PUSHBUTTON SMT SW2 1 3 2 4 SW PUSHBUTTON SMT R26 D1 2 2 1 1 C40 100 pFd 0402 Rev 5 of 2 D B A Rev 5 of 2 .6VDC(max) VIN TV-20R TV4 L6 1 1 TV-20R TV7 R33 0402 3.0 pF 2 4 0. A 1 1 0 OFF ON PCB: PDCR-9400 CYPRESS SEMICONDUCTOR © 2007 Title FIRST TOUCH RF EXPANSION BOARD (103-006-P3) Size B Date: Document Number REF-14204 Wednesday. ** 0402 UPG2214TK UPG2214TK 0402 0402 C27 0.C Vcont GND_PAD UPG2250 VDD1 INPUT 5 4 L4 1 L5 1 IND0402 0402 2.6 nH IND0402 C34 0.4VDC(min) to 3.2mmx2.047 uFd LED1 0603 ISSP_XRES ISSP_CLK ISSP_DAT I2C_SDA I2C_SCL VBATT NO LOAD NO LOAD NO LOAD 0. 1 uFd A + C4 4.7 uFd 16v SOT-23 NOTE: This Expansion Board Does Not Have An Onboard Voltage Regulator .99K 1% 0603 0603 VSS VSS CP 0.DO NOT Power With > 5Vdc Q1 2N7002 VEXP TV7 A ALARM R11 0603 R6 1K 0603 3 1 2 CYPRESS SEMICONDUCTOR © 2007 Title TV6 Size B Date: FIRST TOUCH MULTI FUNCTION BOARD Document Number REF-14209 Sunday.6K 2K 0603 1 CS GND 2 D 1 10K .1% D4 2.01 uFd Cap Sense FTMF B 12 32 CP CY8C21434 MLF32 VEXP VEXP 1 LS1 CSS-J4D20 VEXP TV1 2 1 3 5 7 9 11 13 15 0. ** 0603 0603 CSENSE1 CSENSE2 CSENSE3 CSENSE4 CSENSE5 CSENSE6 CSENSE7 P2_0 P2_1 P2_2 P2_3 P2_4 P2_5 P2_6 P2_7 P3_0 P3_1 P3_2 P3_3 18 7 19 6 R5 2K C1 CSENSE7 R18 560 1 0603 0603 Proximity PRX1 Sensor R7 1 1 Loop RECEPTACLE 1x1 CSENSE6 R17 560 20 5 21 4 22 3 23 2 0603 LSENSE 24 1 25 31 26 30 27 29 XRES 17 ISSP_XRES P0_0 P0_1 P0_2 P0_3 P0_4 P0_5 P0_6 P0_7 Cap Sense FTMF CSB5 C P1_0 P1_1 P1_2 P1_3 P1_4 P1_5 P1_6 P1_7 13 11 14 10 15 9 16 8 ISSP_DAT ISSP_CLK LED_BLUE LED_RED LED_GRN I2C_SDA ALARM I2C_SCL CSENSE5 R16 560 1 2 CS GND 2 Cap Sense FTMF CSB6 560 1 CS GND 2 Cap Sense FTMF CSB7 CS GND 2 B PCB:PDCR-9402 A Rev *A 1 of 1 103 .2K C Ambient Light Detector R19 4. FTMF Expansion Card Schematic 5 4 3 2 1 TV8 VEXP TSENSE D RGB LED Cluster LED_BLUE R2 LED_GRN R3 LED_RED R4 0603 7-Element CS Slider CSB1 6 5 D1 680 0603 R20 560 ZVREF 0603 R1 1 0603 1 2 3 B G CSENSE1 R12 0603 560 1. # 001-48286 Rev.4V 150mW RT1 10K 1% 4 R LED BLUE GREEN RED CSENSE2 R13 0603 Cap Sense FTMF CSB2 560 1 CS GND 2 25 2 Temperature Sensor 2 Cap Sense FTMF CSB3 CSENSE3 VEXP VEXP VEXP R14 0603 560 1 CS GND 2 R10 VEXP 0603 0603 R9 2. Spec.1 uFd 0402 C3 0. September 07. 2008 Sheet 1 10K 1% 5 4 3 2 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF.100" 8x2 Male Pin Header J1 NC VEXP_IN VEXP_OUT GND ISSP_XRES SDA-MOSI ISSP_CLK SCL-SCLK ISSP_DAT GPIO5 EXP_TYPE GPIO4 MISO GPIO3 SPI_nss GPIO2 8X2 PIN HDR RA 2 4 6 8 10 12 14 16 VEXP ISSP_XRES ISSP_CLK ISSP_DAT I2C_SDA I2C_SCL PO5 PO4 PO3 PO2 R8 100 0603 0402 C2 0.Appendix Figure 9-3.2K CSENSE4 R15 0603 Cap Sense FTMF CSB4 560 1 CS GND 2 U3 1 + PR1 LX1972A TV2 TV3 TV4 TV5 TSENSE PO2 PO3 PO4 PO5 LSENSE ZVREF VCC 28 2. 100" FEMALE FTRF/FTMF Receptacle V33 1 3 5 7 9 11 13 15 P1 V33 nDISCON/BOOST TYPE GND ISSP_XRES SDA-SHDN ISSP_CLK SCL-CTRL VBATT ISSP_DAT FTPC0[4] ISSP_SEL FTPC0[3] FTPC0[6] FTPC0[2] FTPC0[5] 8X2 PIN RECPT RA 2 4 6 8 10 12 14 16 nDISCON/BOOST VBATT VIN = 1.01 uFd NO LOAD V33 J1 1 2 + C1 1500 uFd 6.3v TV2 3 1 1 SPDT C2 10 uFd 16V NO LOAD C3 10 uFd 16V 3 2 NEG 2 LTC3525-3.5mm 2 10 uH R1 0402 R2 100K 10 NO LOAD TV4 0603 C6 1 2 0603 U1 nDISCON/BOOST TV1 BH1 SW1 POS 1 1 D10 1 2 nSHDN GND VIN SW GND VOUT 6 5 4 1 0.3 0805 0805 0805 C4 10 uFd 16V 0805 C5 10 uFd 16V 1 2 3 3 PIN HDR 2 2 2 BATTHLDR 2XAAA TV5 104 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. AAA Power Pack Schematic 8x2 0. # 001-48286 Rev.8VDC(min) to 3.2mmx2. ** 2 1 . Spec.Appendix Figure 9-4.6VDC(max) VBATT TV3 L1 1 3. 100" FEMALE FTRF/FTMF Receptacle V33 1 3 5 7 9 11 13 15 P1 V33 nDISCON/BOOST TYPE GND ISSP_XRES SDA-SHDN ISSP_CLK SCL-CTRL ISSP_DAT VBATT ISSP_SEL FTPC0[4] FTPC0[6] FTPC0[3] FTPC0[5] FTPC0[2] 8X2 PIN RECPT RA 2 4 6 8 10 12 14 16 VBATT TV1 SW1 1 2 R1 47 1 BH1 2 0805 VBATT 3 4 5 6 DPDT TV2 1 V33 D10 + C1 1500 uFd 6. Spec.3v 2 TV3 BATT CON 1xCOIN 20mm 3 PC PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. CR2032 Power Pack Schematic 8x2 0. ** 105 .Appendix Figure 9-5. # 001-48286 Rev. Appendix 106 PSoC FirstTouch™ Starter Kit with CyFi Low-Power RF. # 001-48286 Rev. Spec. ** .