background image

 

 

CE219490 – PSoC 6 MCU Ramping LED 

using Smart I/O 

 

 

 

 

 

 

 

www.cypress.com

 

Document No. 002-25568 Rev.*A 

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

 IDE 1.1  

Programming Language: 

C  

Associated Parts:

 All 

PSoC 6 MCU

 parts 

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. Se

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

. 

Summary of Contents for CE219490

Page 1: ...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 L...

Page 2: ...K_PERI This input clock is divided by 4 using the lookup tables LUTs of the Smart I O resource to produce a square wave with a 40 4 ms period To generate a square wave signal with a time period close...

Page 3: ...s and Settings Table 2 lists the ModusToolbox resources used in this example and how they are used in the design For pin usage and configuration open the Pins tab of the design modus file Table 2 Modu...

Page 4: ...com Document No 002 25568 Rev A 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 Configu...

Page 5: ...press com Document No 002 25568 Rev A 5 Figure 4 Smart I O Routing Configuration Figure 5 LUT Configuration LUT Output Mapping Figure 5 depicts the LUT2 configuration settings Similarly configure LUT3...

Page 6: ...re 7 show the Peripheral Clock configuration for Smart I O and TCPWM resources respectively Figure 6 Peripheral Clock Configuration for Smart I O Figure 7 Peripheral Clock Configuration for TCPWM Reus...

Page 7: ...stem Design Describes the dual CPU architecture in PSoC 6 MCU and shows how to build a simple dual CPU design Code Examples Visit the Cypress GitHub site for a comprehensive collection of code example...

Page 8: ...8 Document History Document Title CE219490 PSoC 6 MCU Ramping LED using Smart I O Document Number 002 25568 Revision ECN Orig of Change Submission Date Description of Change 6373851 VKVK 11 02 2018 Ne...

Page 9: ...mpilation of the Software is prohibited TO THE EXTENT PERMITTED BY APPLICABLE LAW CYPRESS MAKES NO WARRANTY OF ANY KIND EXPRESS OR IMPLIED WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING...

Reviews: