Enabled Evaluation kit for PSoC 1 Low Power Kit CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 Contents 1. Introduction.................................................................................................................................................................... 4 1.1 2. Software Installation ..................................................................................................................................................... 5 2.1 2.2 2.3 3. 3.4 Connecting the PSoC 1 Prototyping Kit to the Computer ...................................................................................... 7 Open the PSoC 1 Low Power Example Project in PSoC Designer ....................................................................... 7 My First PSoC 1 (CY8C24x93) Project .................................................................................................................. 9 3.3.1 Loading My First PSoC 1 Project .............................................................................................................. 9 3.3.2 Building My First PSoC 1 Project .............................................................................................................. 9 3.3.3 Programming the PSoC 1 Low Power Kit ............................................................................................... 10 Updating the Onboard Programmer Firmware..................................................................................................... 11 Hardware ...................................................................................................................................................................... 13 4.1 4.2 4.3 5. Install Kit Software ................................................................................................................................................. 5 Install Software ...................................................................................................................................................... 5 Install Hardware..................................................................................................................................................... 5 Kit Operation .................................................................................................................................................................. 6 3.1 3.2 3.3 4. Kit Contents ........................................................................................................................................................... 4 Board Details ....................................................................................................................................................... 13 Theory of Operation............................................................................................................................................. 14 Functional Description ......................................................................................................................................... 15 4.3.1 PSoC 1 ................................................................................................................................................... 15 4.3.2 Power Supply System............................................................................................................................. 17 4.3.3 Power Measurement (CN5) .................................................................................................................... 17 4.3.4 Arduino Compatible Headers (J1, J2, J3, and J4) .................................................................................. 18 4.3.5 Digilent Pmod Compatible Header (CN1) ............................................................................................... 20 4.3.6 PSoC 1 board LEDs ............................................................................................................................... 21 4.3.7 Push Buttons .......................................................................................................................................... 22 4.3.8 Thermistor .............................................................................................................................................. 23 4.3.9 Humidity Sensor ..................................................................................................................................... 25 4.3.10 Segment LCD ......................................................................................................................................... 26 Example Projects......................................................................................................................................................... 28 5.1 5.2 Project: Breathing LED ........................................................................................................................................ 28 5.1.1 Project Description.................................................................................................................................. 28 5.1.2 Flowchart ................................................................................................................................................ 29 5.1.3 Hardware Connections ........................................................................................................................... 30 5.1.4 Verify Output ........................................................................................................................................... 30 Project: Sleep_Wakeup ....................................................................................................................................... 30 5.2.1 Project Description.................................................................................................................................. 30 5.2.2 Flow Chart .............................................................................................................................................. 31 5.2.3 Hardware Connections ........................................................................................................................... 32 5.2.4 Verify Output ........................................................................................................................................... 32 Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 2 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: ???????????? Rev. 1.0, 2/04/2014 5.3 Project: Data_Logger........................................................................................................................................... 32 5.3.1 Project Description.................................................................................................................................. 32 5.3.2 Flow Chart .............................................................................................................................................. 33 5.3.3 Hardware Connections ........................................................................................................................... 34 5.3.4 Verify Output ........................................................................................................................................... 34 Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 3 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 1. Introduction Thank you for your interest in the PSoC 1 Low Power kit. This development kit supports the PSoC 1 device family CY8C24x93. The following document will provide users guidance on using the PSoC 1 Low Power development kit, detailing the kit contents and kits example projects to get users started designing with PSoC. 1.1 Kit Contents PSoC 1 Low Power kit contains: PSoC 1 Low Power kit board Quick Start Guide Kit Contents Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 4 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 2. Software Installation 2.1 Install Kit Software To develop with the PSoC 1 Low Power development kit, users will need to download and install the latest release of PSoC Designer. The PSoC 1 Low Power development kit requires the following minimum software configuration: PSoC Designer 5.4 and later versions support the CY8C24x93 PSoC 1 device. Download the latest software from www.cypress.com/go/psocdesigner. Code Examples: located on the element14 kit page at, www.element14.com/psoc1 2.2 Install Software The software can be uninstalled using one of the following methods: Go to Start > All Programs > Cypress > Cypress Update Manager > Cypress Update Manager; select the Uninstall button. Go to Start > Control Panel > Programs and Features; select the Uninstall/Change button. 2.3 Install Hardware After installing the PSoC Designer software you may connect your PSoC 1 Low Power development kit to your computer. When connecting your PSoC 1 Low Power kit to the computer for the first time it may take a moment to enumerate as the computer is completing an online check for the latest drivers. Please wait until this is complete or select the Skip obtaining driver software from Windows Update. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 5 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 3. Kit Operation The PSoC 1 Low Power Kit enables the user to develop applications using the CY8C24x93 PSoC 1 devices. This kit can also be used as an Arduino shield with other Arduino baseboard such as the Arduino Uno, or with Cypress’s Arduino hardware compatible kits such as the CY8CKIT-042. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 6 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 3.1 Connecting the PSoC 1 Prototyping Kit to the Computer To use the PSoC 1 Low Power kit you need to connect the kit to a target PC. The Kit is designed to be connected to the PC through USB. The USB connector will provide power to the target boards and enables communication with the onboard programmer. 3.2 Open the PSoC 1 Low Power Example Project in PSoC Designer 1. Launch the PSoC Designer software from the Start menu. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 7 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 2. Open the example project by clicking the Open Project/Workspace option under the File menu. Open the project by navigating to the example project downloaded from the kit page. 3. The example project opens and displays the project files in the Workspace Explorer. Subsequent sections of this user guide show how to build, program, and understand the example projects supplied with this kit. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 8 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 3.3 My First PSoC 1 (CY8C24x93) Project This is a simple PSoC 1 project which uses a PWM8SW User Module to continuously change the brightness of an LED. This section describes how to open, build and program a project. 3.3.1 Loading My First PSoC 1 Project 1. 2. 3. 4. 5. Open PSoC Designer. In the Start Page, navigate to File > Open Project/Workspace. Navigate to the project directory: <Install_Directory>:\ PSoC 1 Low Power Kit\<version>\Firmware\. Open the Breathing_LED folder. Double-click Breathing_LED.app file. 6. The project opens in the Chip Editor view. 3.3.2 Building My First PSoC 1 Project 1. Select Build > Generate/Build ' Breathing_LED ' Project. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 9 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 2. PSoC Designer builds the project and displays comments in the Output window. When you see the message that the project is built with 0 errors and 0 warnings, you are ready to program the device. 3.3.3 Programming the PSoC 1 Low Power Kit The kit allows programming of the PSoC 1 device using the onboard PSoC 3 programmer. 1. To program the device, plug the USB cable into the Programming USB connector ‘USB_Prog’. The kit will enumerate as a DVKProg1. Note: PSoC Programmer 3.18 or higher must be installed for proper installation of the kit driver. 2. The onboard PSoC 3 uses ISSP to program the PSoC 1 device. 3. Open the Program Part window in PSoC Designer by selecting Program > Program Part. 4. In the Program Part window make the following selections: a. Select DVKProg1 in the Port Selection drop-down menu. b. Set Acquire Mode to Reset. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 10 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 c. Set Verification to On. This ensures that the downloaded checksum matches the actual checksum. 5. In the Program Part window, click the Program button to program the device. 6. Wait until programming is complete. 7. See that the LED on the kit is now breathing. 3.4 Updating the Onboard Programmer Firmware The firmware of the onboard programmer, PSoC 3, can be updated from PSoC Programmer. When a new firmware releases is available PSoC Programmer will display a warning message indicating that the new firmware is available. Open PSoC Programmer from the Start > All Programs > Cypress > PSoC Programmer <version>. When Program opens a warning window pops up saying that the programmer is currently out of date. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 11 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 Click OK to close the window. On closing the warning window, the Action and Results window displays “Please navigate to the Utilities tab and click Upgrade Firmware Button.” Click the Utilities tab and click the Upgrade Firmware button. On successful upgrade, the Action and Results window displays the firmware update message and the new kit firmware version. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 12 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 4. Hardware 4.1 Board Details The PSoC 1 Low Power kit consists of the following sections: PSoC 1 PSoC 3 Programmer Power supply system Programming interface USB interface CY3215 ICE-Cube Debugging interface headers Arduino compatible headers Power board LEDs Push buttons (Reset Button and User Button) Thermistor Humidity sensor SLCD Potentiometer Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 13 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 4.2 Theory of Operation This section provides a block level description of the PSoC 1 low power kit. The CY8C24x93 PSoC 1 device is a low power and low pin count PSoC 1 device. The CY8C24x93 family allows customers to quickly add USB support to their designs with minimal effort with PSoC Designer. It supports a wide operating range from 1.7V to 5.5V. The PSoC 1 low power board features an on-board PSoC 3 which communicates interfaces with a PC through USB to program the PSoC 1 device using ISSP protocol. The PSoC 1 kit has a user LED, a status LED and a power LED. The user LED is connected to the PSoC 1 device and the status LED is connected to the PSoC 3 device. The PSoC 1 kit also includes a PSoC 1 reset button which connects to the PSoC 1 XRES pin, a user button and a segment LCD display. The PSoC 1 pins are brought out to the headers J1 – J4 so that it can be connected to Arduino base boards such as the PSoC 4 Pioneer kit. The Port 2 pins of the PSoC 1 device are also brought out to the header CN6 so that a standard 16x2 character LCD can be connected to the board. The PSoC 1 low power board can be powered from the two USB connectors as well as the Arduino connectors. The power source can be selected using the jumper J1. The input voltage is 5V. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 14 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 4.3 Functional Description 4.3.1 PSoC 1 The kit uses the PSoC 1 CY8C24x93 family of devices. The PSoC 1 CY8C24x93 devices are a combination of a microcontroller with programmable digital, 10-bit ADC and comparators. For more information refer to the PSoC 1 CY8C24x93 webpage and the PSoC 1 CY8C24x93 family datasheet. Features ■ Powerful Harvard-architecture processor ❐ M8C CPU with a max speed of 24 MHz ■ Operating Range: 1.71V to 5.5V ❐ Standby Mode 1.1 μA (Typ) ❐ Deep Sleep 0.1 μA (Typ) ■ Operating Temperature range: –40 °C to +85 °C ■ Flexible on-chip memory ❐ 8 KB flash, 1 KB SRAM ❐ 16 KB flash, 2 KB SRAM ❐ 32 KB flash, 2 KB SRAM ❐ Read while Write with EEPROM emulation ❐ 50,000 flash erase/write cycles ❐ In-system programming simplifies manufacturing process ■ Four Clock Sources ❐ Internal main oscillator (IMO): 6/12/24 MHz ❐ Internal low-speed oscillator (ILO) at 32 kHz for watchdog and sleep timers ❐ External 32 KHz Crystal Oscillator ❐ External Clock Input ■ Programmable pin configurations ❐ Up to 36 general purpose dual mode GPIO (Analog inputs and Digital I/O supported) ❐ High sink current of 25 mA per GPIO • Max sink current 120 mA for all GPIOs ❐ Source Current • 5 mA on ports 0 and 1 • 1 mA on ports 2, 3 and 4 ❐ Configurable internal pull-up, high-Z and open drain modes ❐ Selectable, regulated digital I/O on port 1 Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 15 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 ❐ Configurable input threshold on port 1 ■ Versatile Analog functions ❐ Internal Low-Dropout voltage regulator for high power supply rejection ratio (PSRR) ■ Full-Speed USB ❐ 12 Mbps USB 2.0 compliant ❐ Eight unidirectional endpoints ❐ One bidirectional endpoint ❐ Dedicated 512 byte SRAM ❐ No external crystal required ■ Additional system resources ❐ I2C Slave: • Selectable to 50 kHz, 100 kHz, or 400 kHz ❐ Configurable up to 12 MHz SPI master and slave ❐ Three 16-bit timers ❐ Watchdog and sleep timers ❐ Integrated supervisory circuit ❐ 10-bit incremental analog-to-digital converter (ADC) with internal voltage reference ❐ Two general-purpose Comparators • 3 Voltage References (0.8 V, 1 V, 1.2 V) • Any pin to either comparator inputs • Low-power operation at 10 µA ❐ One 8-bit IDAC with full scale range of 512 µA ❐ One 8-bit Software PWM ■ Development Platform ❐ PSoC Designer™ IDE ■ GPIOs and Package options ❐ 13 GPIOs - QFN 16 ❐ 28 GPIOs - QFN 32 ❐ 34 GPIOs - QFN 48 ❐ 36 GPIOs - QFN 48 Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 16 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 4.3.2 Power Supply System The power supply system on this board is versatile, allowing the board to be powered from the following sources: 5V from the on-board USB programming header (PROG) VREG from the Arduino base board 4.3.3 Power Measurement (CN5) The PSoC 1 Low Power kit provides users with the ability to connect an ammeter to the board and measure current consumption on the PSoC. On the board there is a header with a jumper. This jumper can be removed and the user can connect the ammeter in series to calculate the current consumption. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 17 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 4.3.4 Arduino Compatible Headers (J1, J2, J3, and J4) The kit has four Arduino compatible headers; J1, J2, J3, and J4. The user can develop applications to interface with an Arduino base board. The PSoC 1 board will serve as a shield interface to the base Arduino board. In the following images we show the PSoC 1 Low Power board interfacing with the Arduino Uno, Arduino Mega, and PSoC 4 Pioneer Board. Users can develop applications that interface with these various base boards. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 18 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 The majority of the I/O on the PSoC 1 kit is tied to onboard features such as the Thermistor or the LCD. However, there are a number of I/O that are connected to the PSoC 1 device and are exposed for usage by the base board. The header J1 contains all of the power and ground connections to the base board. Header J2 contains connections to the SCL and SDA pins which can be used to communicate with an Arduino base board. The SCL and SDA lines are also connected to the PSoC 3 which provided USB-I2C bridging capabilities. Header J3 contains all of the analog pin connections to the onboard features. There is an option to enable the SCL and SDA lines on the A4 and A5 pins. The header J4 provides to pin connections to a target base board through the D5 and D6 pin connections. Here the base board will be able to provide I/O inputs to the PSoC 1 board. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 19 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 4.3.5 Digilent Pmod Compatible Header (CN1) This port supports Digilent Pmod peripheral modules. Pmods are small I/O interfaces, which connect with the embedded control boards through either 6- or 12-pin connectors. The PSoC 1 Low Power kit supports the 6-pin Pmod type 2 (SPI) interface. For Digilent Pmod cards, go to www.digilentinc.com. The header is not populated on the PSoC 1 kit. You must populate this header before connecting the Pmod daughter cards. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 20 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 4.3.6 PSoC 1 board LEDs The PSoC 1 Low Power Board supports three LEDs. A green LED (D11) that indicates the status of the programmer. A red colored LED (D10) is used to indicate the power status of the board. The board also has a user LED (D12) which is a general purpose LED connected to pin P0_5. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 21 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 4.3.7 Push Buttons The PSoC 1 kit contains a Reset and User push buttons. The reset push button is connected to the XRES pin of the PSoC 1 device and is used to reset the PSoC 1 device on- board. The user push button is connected to P0[7] of the PSoC 1 device. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 22 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 4.3.8 Thermistor Application note AN2017 - PSoC® 1 Temperature Measurement with Thermistor explains the thermistor theory and temperature measurement with thermistor. The thermistor resistance changes with temperature in a nonlinear fashion. Many Thermistor manufacturers provide the thermistor temperature versus resistance table. The Steinhart-Hart equation characterizes thermistor resistance change with temperature to a good accuracy and can be used to find temperature from thermistor resistance. Following figure shows the implementation of thermistor on the PSoC 1 Low Power Kit. The thermistor circuit is implemented in such a way that the input voltage range to the PSoC 1 ADC is 0 – 1.2V. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 23 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 The Thermistor RT1 is located next to the LCD screen, above the white humidity sensor. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 24 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 4.3.9 Humidity Sensor The onboard capacitive humidity sensor (HCH-1000-002) along with reference capacitors can be used to measure the humidity. The humidity sensor is implemented on the kit. The humidity sensor is read using the P1(2) pin on the PSoC 1 device. The PSoC 1 kit also includes two reference capacitors circuits to calculate the upper and lower reference bounds for the Humidity sensor. These two capacitor circuits can be charged and that charging time measured to give you 0% and 100% range for the humidity sensor. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 25 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 4.3.10 Segment LCD The onboard segment LCD can be used to show various output. The SLCD user Module can be used to drive this SLCD. The following table gives the pin connections of the SLCD. The LCD can display 4 numeric characters and 3 decimal points. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 26 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 SLCD Pin PSoC 1 Pin COM0 P0_6 COM1 P0_4 COM2 P0_2 COM3 P0_0 SEG1 P3_0 SEG2 P3_1 SEG3 P3_2 SEG4 P3_3 SEG5 P3_4 SEG6 P3_5 SEG7 P3_6 SEG8 P3_7 Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 27 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 5. Example Projects The example projects described in the following sections introduce the functionality of the CY8C24x93 PSoC 1 device and the on-board components to the user. To download these examples navigate to the kit web page: www.element14.com/psoc1. 5.1 Project: Breathing LED 5.1.1 Project Description This example project uses a PWM8SW user module to illuminate the user LED. The brightness of the LED is controlled using the PWM duty cycle. This duty cycle is continuously varied to change the brightness of the LED and thus producing a breathing effect. PSoC 1 M8C PWM8 SW LED Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 28 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 5.1.2 Flowchart Start A Enable Global Interrupts Start the PWM8SW User Module Write the compare value to the PWM8SW User Module Write the compare value to the PWM8SW User Module Give some Delay Give some Delay Decrease the Compare Value Increase the Compare Value Is Compare < MIN_COMPARE? B NO YES NO Is Compare > MAX_COMPARE? B YES A Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 29 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 5.1.3 Hardware Connections There are no specific hardware connections for this project because all the connections are hardwired on the board (P0_5 to LED D12). 5.1.4 Verify Output Build and program the code example on to the device. The brightness of the LED should smoothly vary over time. 5.2 Project: Sleep_Wakeup 5.2.1 Project Description This project demonstrates how to use the sleep functionality in the CY8C24x93 PSoC 1 device. On startup, the PSoC 1 device continuously blinks the LED using a PWM8SW User Module. When the switch SW2 is pressed, the PSoC 1 device goes into sleep mode by shutting down various peripherals. When the switch SW2 is pressed again, the PSoC 1 device wakes up and start blinking the LED again. PSoC 1 M8C PWM8 SW LED Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 30 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 5.2.2 Flow Chart Start Enable Global Interrupts Start the PWM8SW User Module Check if Switch SW2 is pressed NO YES Stop the PWM8SW User Module Make all ports as HighZ Clear all Pending Interrupts Turn Off ILO Put the device to sleep Check if Switch SW2 is Released NO YES Start the PWM8SW User Module Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 31 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 5.2.3 Hardware Connections There are no specific hardware connections for this project because all the connections are hardwired on to the board (P0_5 to LED D12, P0_7 to Switch SW2). 5.2.4 Verify Output Build and program the code example on to the device. When the board is powered, the LED starts blinking. Press switch SW2 to put the device to sleep. The LED will stop blinking. You can measure the current consumed by the PSoC 1 device using the CN5 header. 5.3 Project: Data_Logger 5.3.1 Project Description This project demonstrates how measure temperature using a thermistor and transferring the data to a PC every second. The project uses the ADCINC User Module to measure the thermistor voltage, SLCD User Module to display the current temperature on a segment LCD and the Timer16 and USBUART User Modules to send the data to a PC every one second. Note: The USBART User Module used here does not act as an USBUART bridge. It is used here so that it will be enumerated as a COM port in the PC. Thermistor PSoC 1 ADCINC M8C Timer16 USBUART Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. PC 32 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 5.3.2 Flow Chart Start Enable Global Interrupts Start all the User Modules Timer16 Interrupt Connect the ADC to ground pin and measure voltage (offset) uart_Update = TRUE Connect the thermistor terminal to ADC and measure voltage Calculate the thermistor resistance from R_THERMISTOR = R_FIXED * (Reference Voltage/Thermistor voltage) Detemine the temperature using the Resistance vs Temperature LUT Display the temperature on the SLCD NO Is uart_update Flag TRUE? YES Send the data to a PC using USBUART uart_Update = FALSE Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 33 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 5.3.3 Hardware Connections Connect the kit board to a PC using a USB A to mini B cable. Use the Dev_Prog connector to connect the USB cable. Other than this, there are no specific hardware connections for this project because all the connections are hardwired on to the board as shown in the following schematic. 5.3.4 Verify Output Build and program the code example on to the device. Open a terminal console such as TeraTerm on your PC. When the kit is powered, the terminal console will start displaying temperatures every second. The SLCD onboard will also display the same temperature. Note: After programming the PSoC 1 device and connecting the board to the PC for the first time, the device will get enumerated but the driver will not be enumerated properly as it is not an HID device. The driver needs to be installed manually and is located at <Project Workspace>/Data_Logger/Data_Logger/lib/USBUART_1.inf. To complete that installation please use the following steps. 1. Connect the USB cable to the PSoC 1 USB connector. 2. The device will enumerate but not correctly install the driver. Navigate to the Device Manager by clicking Start and right clicking on Computer and selecting Properties. Then select Device Manager. You will see that under Other Devices there is a listing for a Data Logger Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 34 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 3. Right click on the Data Logger and select Update Driver Software 4. Navigate to the driver stored in the example project directory. <Project Workspace>/Data_Logger/Data_Logger/lib/USBUART_1.inf. 5. The driver will install. You will likely get a message that the driver is not signed and asking if you would like to continue. Select Install This Driver Anyways. 6. Once the driver is complete you will get a message that the driver has been installed. It will be named Demo. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 35 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 7. The user will see the COM port under Ports (COM & LPT) 8. Launch a Hyperterminal client like PuTTY. You will not need to configure the baud rate as the driver uses a custom driver and not the HID driver. Set the serial port to the correct port, in this example the port is COM39. Click Open. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. 36 CY8CKIT-PSOC-024LP Evaluation kit for PSoC 1 Low Power Kit Doc ID: PSOC1LPKUM Rev. 1.0, 2/04/2014 9. The PuTTY terminal then will display the streaming data. Embest and element14 are trademarks of Premier Farnell plc © 2014 Premier Farnell plc. All Rights Reserved Cypress and the Cypress logo are trademarks of Cypress Semiconductor, Inc., Reg. U.S. Pat. Tm. Off. 37