Cypress CE219490 User Manual

Psoc 6 mcu ramping led using smart i/o

Advertisement

Quick Links

Objective
This example demonstrates the flexibility of Smart I/O in PSoC
hardware with no CPU usage beyond initialization.
Requirements
Tool: ModusToolbox™ IDE 1.1
Programming Language: C
Associated Parts: All
PSoC 6 MCU
Related Hardware:
PSoC 6 BLE Pioneer Kit, PSoC 6 WiFi-BT Pioneer Kit, PSoC6 WiFi-Prototyping Kit
Overview
This example uses a PWM resource and Smart I/O in PSoC 6 MCU to implement a ramping LED, where an LED gradually
cycles through increasing and decreasing brightness levels. There is no CPU usage except for the initialization of PWM and
Smart I/O.
Hardware Setup
This example uses the kit's default configuration. See the kit guide to ensure the kit is configured correctly.
Note: The PSoC 6 BLE Pioneer kit and the PSoC 6 WiFi-BT Pioneer kit ship with KitProg2. ModusToolbox only works with
KitProg3. Before using this code example, make sure that the kit is upgraded to KitProg3. See ModusToolbox Help >
ModusToolbox IDE Documentation > User Guide; section PSoC 6 MCU KitProg Firmware Loader. If you do not upgrade, you
will see an error like "unable to find CMSIS-DAP device" or "KitProg firmware is out of date".
Software Setup
None.
Operation
Follow the instructions that came with your kit to make sure that your kit is connected to your PC
1.
Connect the kit to your PC using the provided USB cable.
2.
Import the application into a new workspace. See KBA225201.
3.
Build the application. Choose Project > Build All.
4.
Program the PSoC 6 MCU device. In the project explorer, select the mainapp project. In the Quick Panel, scroll to the
Launches section and click the Program (KitProg3) configuration. Program configurations also build the code.
5.
Using a jumper wire, connect P9[4] to P13[7].
You can observe the ramping effect on the LED connected to P13[7] on the kit.
Debugging
You can debug the example to step through the code. Use the Debug (KitProg3) configuration. If you are unfamiliar with how
to start a debug session with ModusToolbox IDE, see KBA224621.
www.cypress.com
CE219490 – PSoC 6 MCU Ramping LED
®
parts
Document No. 002-25568 Rev.*A
6 MCU, by implementing an LED ramping effect exclusively in
using Smart I/O
1

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CE219490 and is the answer not in the manual?

Questions and answers

Summary of Contents for Cypress CE219490

  • Page 1 CE219490 – PSoC 6 MCU Ramping LED using Smart I/O Objective ® This example demonstrates the flexibility of Smart I/O in PSoC 6 MCU, by implementing an LED ramping effect exclusively in hardware with no CPU usage beyond initialization. Requirements Tool: ModusToolbox™...
  • Page 2 LUT 2 and LUT 3. In addition, the divided clock is XORed with the PWM output using LUT 4 to generate a signal with the duty cycle gradually increasing and decreasing over time. The output of LUT 4 is driven to I/O 4 output. www.cypress.com Document No. 002-25568 Rev.*A...
  • Page 3 Timer Counter PWM (TCPWM) Generates 25 Hz, 50% duty cycle square wave Smart I/O SmartIO Implements divide-by-4 sequential circuit Digital Output Pin Pin_LED Provides visual feedback using the LED Figure 2 highlights the non-default settings for the TCPWM. www.cypress.com Document No. 002-25568 Rev.*A...
  • Page 4 Figure 2. TCPWM Configuration Figure 3 through Figure 5 illustrate the steps for configuring Smart I/O. Figure 3. Enabling Smart I/O Click to Launch the SmartIO Configurator Enable Pin P9[4] Enable the Smart I/O Port 9 www.cypress.com Document No. 002-25568 Rev.*A...
  • Page 5 PSoC 6 MCU Ramping LED using Smart I/O Figure 4. Smart I/O Routing Configuration Figure 5. LUT Configuration LUT Output Mapping Figure 5 depicts the LUT2 configuration settings. Similarly, configure LUT3 and LUT 4 with the settings shown in Table 3. www.cypress.com Document No. 002-25568 Rev.*A...
  • Page 6 Change Device. If changing to a different kit, you may need to reassign pins. Table 4. Device and Pin Mapping Table across PSoC 6 MCU Kits Kit Name Device Used CY8CKIT-062-BLE CY8C6347BZI-BLD53 P13[7] CY8CKIT-062-WiFi-BT CY8C6247BZI-D54 P13[7] CY8CPROTO-062-4343W CY8C624ABZI-D44 P13[7] www.cypress.com Document No. 002-25568 Rev.*A...
  • Page 7: Related Documents

    For the PSoC 6 MCU devices, see KBA223067 in the Cypress community for a comprehensive list of PSoC 6 MCU resources www.cypress.com Document No. 002-25568 Rev.*A...
  • Page 8: Document History

    PSoC 6 MCU Ramping LED using Smart I/O Document History Document Title: CE219490 – PSoC 6 MCU Ramping LED using Smart I/O Document Number: 002-25568 Revision Orig. of Submission Description of Change Change Date 6373851 VKVK 11/02/2018 New code example...
  • Page 9: Worldwide Sales And Design Support

    Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses of Cypress products.

Table of Contents