PSoC™ 63 Code Examples
GitHub Links
Example types | Description |
Bluetooth® | Code examples demonstrating Bluetooth® functionality with PSoC™ 63 devices |
Getting Started | Code examples to get you started with PSoC™ 63 devices |
Graphics | Code examples implementing graphics functionality with PSoC™ 63 devices |
Peripherals | Code examples demonstrating how to work with peripherals and PSoC™ 63 devices |
Sensing/HMI | Code examples demonstrating CAPSENSE™ capacitive sensing with PSoC™ 63 devices |
Bluetooth®
Title |
Description |
This code example demonstrates the implementation of a simple Bluetooth® Immediate Alert Service (IAS)-based Find Me Profile (FMP) using the Infineon PSoC™ 6 MCU with AIROC™ Bluetooth® LE, AIROC™ CYW20829, and AIROC™ Wi-Fi & Bluetooth® combo SoC devices |
|
This code example demonstrates the implementation of a simple Bluetooth® LE environmental sensing profile. It shows how to send environmental parameters like temperature by sending simulated temperature values over the Bluetooth® LE connection using AIROC™ CYW20829 Wi-Fi & Bluetooth® combo SoCs. |
|
This code example demonstrates the implementation of a simple AIROC™ Bluetooth® LE GAP Peripheral - GATT Client with Current Time Service (CTS) using PSoC™ 6 MCU, AIROC™ CYW20829, and ModusToolbox™ software environment. |
|
This code example demonstrates the implementation of a simple AIROC™ Bluetooth® LE GAP Central - GATT Server with Current Time Service (CTS) using PSoC™ 6 MCU, AIROC™ CYW20829, and ModusToolbox™ software environment. |
|
This code example demonstrates the implementation of a Bluetooth® LE custom service with Bluetooth® security using AIROC™ CYW20829, PSoC™ 6, and ModusToolbox™ software environment. |
|
This code example demonstrates the implementation of the Bluetooth® LE Battery Service Client using the Infineon® AIROC™ CYW20829 Bluetooth® chip and PSoC™ 6 MCU with AIROC™ Bluetooth® LE with ModusToolbox™ software environment. |
|
This code example demonstrates the privacy features available to users in Bluetooth 5.0 and above using ModusToolbox™ software. |
|
This code example demonstrates the implementation of a simple Bluetooth® LE Battery Service. The Battery Service exposes the battery level of the device and supports over-the-air (OTA) update over a Bluetooth® Low Energy connection. |
|
This code example features a Bluetooth® LE custom GATT Server with multiple sensors. The motion sensor and thermistor are interfaced with PSoC™ 6 MCU. The sensor reading are sent to the GATT Client over GATT notification. This project uses the sensors and middleware library; it is developed in the ModusToolbox™ software environment. |
Getting Started
Title |
Description |
This is a minimal starter dual-CPU application template for PSoC™ 6 MCU devices. |
|
This is a minimal starter application template for Infineon MCU devices. |
|
This code example demonstrates a simple UART communication by printing the "Hello world" message on a terminal and blinking an LED using a timer resource. The code example is based on HAL(Hardware Abstraction Layer) libraries. |
|
mtb-example-psoc6-security | This is a minimal starter dual-CPU security application template for PSoC™ 62/63 MCU devices. This code example is meant to be a companion to the AN221111 – PSoC™ 6 MCU: Designing a secured system application note. It demonstrates the following features to create a secured system as explained in the application note. |
This example demonstrates how to transition PSoC™ 6 MCU to the following system and MCU power states: |
Graphics
Title |
Description |
This example demonstrates displaying 2D graphics on a TFT display using the emWin graphics library and the AppWizard GUI design tool in FreeRTOS. |
|
This code example demonstrates displaying 2D graphics on an OLED display using the emWin graphics library and the AppWizard GUI design tool in FreeRTOS |
|
This code example demonstrates displaying 2D graphics on an E-ink display using the emWin graphics library. |
Peripherals
Title |
Description |
mtb-example-psoc6-i2s | This example demonstrates how to use the I2S hardware block in PSoC 6 MCU to interface with an audio codec. |
mtb-example-hal-spi-master | This code example demonstrates the use of a SPI (HAL) resource in master mode. The SPI master is configured to send command packets to control a user LED on the slave. |
mtb-example-hal-i2c-master | This code example demonstrates the use of the I2C resource in HAL in master mode. The I2C master is configured to send command packets to control a user LED on the slave. |
mtb-example-psoc6-smartio-ramping-led | 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. |
mtb-example-hal-rtc-periodic-wakeup | This code example demonstrates how to enter the DeepSleep and Hibernate modes, and wakeup using the RTC alarm. |
mtb-example-psoc6-filesystem-littlefs-freertos | This example uses the Arm® Cortex®-M4 (CM4) CPU of PSoC™ 6 MCU to execute a littlefs filesystem task. This example uses the mtb-littlefs middleware library that implements the littlefs-compatible block device drivers for different storage devices such as SD card and NOR flash. |
mtb-example-psoc6-mcwdt | This code example explains how to set up a multi-counter watchdog timer (MCWDT) using the MCWDT PDL resource to measure the timing between events in free-running mode on PSoC™ 6 MCU. |
mtb-example-psoc6-uart-transmit-receive-dma | This code example demonstrates the UART transmit and receive operation in PSoC™ 6 MCU using DMA. The application uses a serial terminal to read data and echoes what is received. UART is configured to perform both transmit and receive operations. |
mtb-example-psoc6-csdidac | This code example demonstrates using the CSD hardware-block-based current digital-to-analog converter (CSDIDAC) as a current source and a current sink. |
mtb-example-hal-uart-transmit-receive | This code example demonstrates the UART (HAL) transmit and receive operation in an Infineon MCU. |
mtb-mtb-example-hal-adc-basic | TThis code example demonstrates the use of the ADC HAL driver to perform voltage measurements |
mtb-example-psoc6-csdadc | This code example demonstrates the usage of CSDADC in PSoC™ 6 MCU |
mtb-example-psoc6-dfu-basic | This example demonstrates the basic DFU with PSoC™ 6 MCU. This includes downloading an application from a host and installing it in the device flash, and then transferring control to that application |
mtb-example-hal-gpio-interrupt | This code example demonstrates the use of a GPIO configured as an input pin to generate interrupts on an Infineon MCU |
mtb-example-hal-rtc-basics | This example demonstrates the usage of the real-time clock (RTC) in Infineon MCU. It shows how to get and set the time in the RTC using the RTC HAL API. |
mtb-example-psoc6-crypto-sha | This code example demonstrates how to generate a 32-byte hash value or message digest for an arbitrary user input message with the SHA-2 algorithm using the cryptographic hardware block in PSoC™ 6 MCU |
mtb-example-hal-crypto-trng | This code example demonstrates how to generate a one-time password (OTP) of eight characters in length with the true random number generation feature using the Cryptographic hardware block in MCU |
mtb-example-psoc6-crypto-aes | This code example encrypts and decrypts user input data using the AES algorithm using a 128-bit key. The encrypted and decrypted data are displayed on a UART terminal emulator. |
mtb-example-lz4-demo | This code example demonstrates a simple LZ4 compression and decompression on a byte array. The byte array included with this application is the pre-built image of the hello-world application. The application boots the decompressed byte array on a user command |
mtb-example-hal-i2c-slave | This code example demonstrates the use of the I2C resource in HAL in slave mode. The I2C slave is configured to receive command packets to control a user LED on the kit. |
mtb-example-hal-spi-slave | This code example demonstrates the use of a SPI (HAL) resource in slave mode. The SPI slave is configured to receive command packets to control an user LED on the kit. |
mtb-example-hal-lptimer | This code example demonstrates how to configure a low-power timer to measure the timing between events in free-running mode using the LPTimer HAL resource. |
mtb-example-hal-wdt | This example explains how to set up a Watchdog Timer (WDT) using the WDT HAL resource. The WDT resets the device if it is not serviced or "kicked" within the configured timeout interval. |
mtb-example-serial-flash-readwrite | This code example demonstrates interfacing an external NOR flash memory using serial flash library. |
mtb-example-hal-pwm-square-wave | This code example generates a square wave using the PWM driver. An LED connected to the PWM output pin blinks at 2 Hz. |
mtb-example-psoc6-pdm-pcm | This example demonstrates how to use the pulse-density modulation (PDM)/pulse-code modulation (PCM) hardware block in PSoC™ 6 MCU with a digital microphone. |
mtb-example-psoc6-qspi-fram-access | This code example demonstrates interfacing with an external QSPI F-RAM memory and access it in single, dual, or quad SPI mode using the serial memory interface (SMIF) block in PSoC™ 6 MCU. This example uses the PSoC™ 6 MCU standard QSPI HAL driver library to build the QSPI F-RAM access API. |
mtb-example-psoc6-smartio-sgpio-target | This code example uses a SPI resource and Smart I/O in PSoC™ 6 MCU to implement the serial general purpose input/output (SGPIO) target interface, which is a four-signal bus defined in the SFF-8485 standard. Another SPI resource is used to implement the SGPIO initiator, which drives the clock on the SGPIO bus. |
mtb-example-psoc6-spi-master-dma | This example demonstrates the use of the SPI Serial Communication Block (SCB) resource for PSoC™ 6 MCU in master mode using DMA |
mtb-example-psoc6-dual-cpu-ipc-sema | This code example demonstrates how to use the inter-processor communication (IPC) driver to implement a semaphore in PSoC™ 6 MCU. The semaphore is used as a lock to control access to a resource shared by the CPUs and synchronize the initialization instructions. |
mtb-example-psoc6-i2c-slave-callback | This code example demonstrates the operation of the I2C (HAL) resource in slave mode using callbacks. |
mtb-example-psoc6-i2c-master-ezi2c-slave | This code example demonstrates the use of the I2C (HAL) resource in master mode with an EzI2C slave. The I2C master is configured to send command packets to control a user LED on the slave. Both the slave and the master can be configured on the same kit. |
mtb-example-psoc6-smartio-i2s | This code example uses a SPI resource and smart I/O in PSoC™ 6 MCU to implement the Inter-IC Sound (I2S) master interface (Tx only). |
mtb-example-psoc6-mcuboot-basic | This example demonstrates using MCUboot with PSoC™ 6 MCUs, an open-source secure bootloader for 32-bit MCUs. This bootloader app runs on CM0+. |
mtb-example-psoc6-fault-handling | This example demonstrates the fault handling functionality of PSoC™ 6 MCU using peripheral driver library (PDL) system library (SysLib). |
mtb-example-psoc6-dual-cpu-protection-units-freertos | This example demonstrates how to use the protection units to isolate the CM0+ CPU memory from CM4. This example uses FreeRTOS (v10.3.1). |
mtb-example-psoc6-qspi-xip | This code example demonstrates how to use the queued serial peripheral interface (QSPI) block of the PSoC™ 6 MCU in eXecute-in-Place (XiP) mode with an external flash memory device using Eclipse IDE for ModusToolbox™ software. |
mtb-example-psoc6-dual-cpu-ipc-pipes | This example demonstrates how to use the inter-processor communication (IPC) driver to implement a message pipe in PSoC™ 6 MCU. The pipe is used to send messages between CPUs. |
mtb-example-psoc6-filesystem-emfile-freertos | This example uses the Arm® Cortex®-M4 (CM4) CPU of PSoC™ 6 MCU to execute an emFile filesystem task. This example uses the emfile middleware library that includes emFile in the form of pre-built libraries along with the hardware layer and OS layer implementations for PSoC™ 6 MCUs. |
Sensing/HMI
Title |
Description |
mtb-example-psoc6-capsense-buttons-slider | This code example features a 5-segment CAPSENSE™ slider and two CAPSENSE™ buttons. Button 0 turns the LED ON, button 1 turns the LED OFF, and the slider controls the brightness of the LED. The code example also demonstrates monitoring CAPSENSE™ data using the CAPSENSE™ tuner GUI tool. |
mtb-example-psoc6-bmi160-motion-sensor-freertos | This example demonstrates how to interface PSoC™ 6 MCU with a BMI160 motion sensor over an I2C interface within a FreeRTOS task using the BMI160 motion sensor library. This example reads the raw motion data and estimates the orientation of the board. |
mtb-example-psoc6-capsense-custom-scan | This code example demonstrates CAPSENSE™ custom scanning through callback functions from CAPSENSE™ middleware that allows altering the sensor parameters during runtime or synchronizing the CAPSENSE™ scan with non-CAPSENSE™ operations. |
mtb-example-psoc6-capsense-cm0p | This code example demonstrates how to create a CAPSENSE™ design using only the CM0+ core of PSoC™ 6 MCU devices. This code example features a 5-segment CAPSENSE™ slider and two CAPSENSE™ buttons. Button 0 (BTN0) turns the LED ON, button 1 (BTN1) turns the LED OFF, and the slider controls the brightness of the LED. The code example also demonstrates monitoring CAPSENSE™ data using the CAPSENSE™ tuner GUI tool. |
mtb-example-psoc6-capsense-buttons-slider-freertos | This code example features a 5-segment linear slider and two CAPSENSE™ buttons. Button 0 turns the LED ON, Button 1 turns the LED OFF, and the slider controls the brightness of the LED. The code example also demonstrates interfacing with the CAPSENSE™ Tuner using the I2C interface. |
mtb-example-psoc6-low-power-capsense-freertos | This code example demonstrates how to create a low-power CAPSENSE™ design using PSoC™ 6 MCU. This example features a 5-segment CAPSENSE™ slider and a ganged sensor and displays the detected touch position over the serial terminal. |