background image

5

Summary

This application note explored the PSoC

 6 MCU device architecture and the associated development tools.

PSoC

 6 MCU is a truly programmable embedded system-on-chip with configurable analog and digital

peripheral functions, memory, and a dual-CPU system on a single chip. The integrated features and low-power

modes make PSoC

 6 MCU an ideal choice for smart home, IoT gateways, and other related applications.

Related application notes and code examples

For a complete and updated list of PSoC

 6 MCU code examples, please visit our 

code examples web page.

 For

more PSoC

 6 MCU-related documents, please visit our 

PSoC

 6 MCU

 product web page.

Table 2

 lists the system-level and general application notes that are recommended for the next steps in learning

about PSoC

 6 MCU and PSoC

 Creator.

Table 2

General and system-level application notes

Document

Document name

AN228571

Getting Started with PSoC

 6 MCU on ModusToolbox

AN210781

Getting Started with PSoC

 6 MCU with Bluetooth

 Low Energy (BLE) Connectivity on

PSoC

 Creator

AN218241

PSoC

 6 MCU Hardware Design Considerations

AN219434

PSoC

 6 MCU Importing Generated Code into an IDE

AN219528

PSoC

 6 MCU Low-Power Modes and Power Reduction Techniques

Table 3

 lists the application notes (AN) and code examples (CE) for specific peripherals and applications.

Table 3

Documents related to PSoC

 6 MCU features

Document

Document name

System resources, CPU, and interrupts

AN215656

PSoC

 6 MCU Dual-CPU System Design

AN217666

PSoC

 6 MCU Interrupts

CE221773

PSoC

 6 MCU Hello World Example

CE216795

PSoC

 6 MCU Dual-Core Basics

CE216825

PSoC

 6 MCU Real-Time Clock Basics

CE218129

PSoC

 6 MCU Wake up from Hibernate Using Low-Power Comparator

CE218541

PSoC

 6 MCU Fault-Handling Basics

CE218542

PSoC

 6 Custom Tick Timer Using RTC Alarm Interrupt

CE218552

PSoC

 6 MCU UART to Memory Buffer Using DMA

CE218964

PSoC

 6 MCU RTC Daily Alarm

CE219339

PSoC

 6 MCU MCWDT and RTC Interrupts (Dual Core)

CE219521

PSoC

 6 MCU GPIO Interrupt

CE219881

PSoC

 6 MCU Switching Power Modes

CE220060

PSoC

 6 MCU Watchdog Timer

CE220061

PSoC

 6 MCU Multi-Counter Watchdog Interrupts

CE220120

PSoC

 6 MCU Blocking Mode Flash Write

(table continues...)

Getting started with PSoC

 6 MCU on PSoC

 Creator

5 Summary

Application Note

38

002-21774 Rev. *G

2022-07-21

Содержание PSoC 6

Страница 1: ...list of hundreds of PSoC code examples please visit our code examples web page Please visit the GitHub site for a comprehensive collection of code examples using ModusToolbox IDE for PSoC 6 You can a...

Страница 2: ...27 4 6 Part 4 Write the firmware 29 4 7 Part 5 Build the project and program the device 34 4 8 Part 6 Test your design 36 5 Summary 38 Related application notes and code examples 38 Glossary 40 Revisi...

Страница 3: ...lexibility and dynamic fine tuning of the design using PSoC Creator the schematic based design tool Figure 1 illustrates an application level block diagram for a real world use case using PSoC 6 MCU M...

Страница 4: ...E221773 for PSoC Creator For hardware design considerations see AN218241 PSoC 6 MCU Hardware Design Considerations 1 1 Prerequisites Before you get started make sure that you have a development kit an...

Страница 5: ...etooth connectivity for development on ModusToolbox Training Videos Video training on our products and tools including a dedicated series on PSoC 6 MCU is available 2 2 Firmware application developmen...

Страница 6: ...6 MCU device not supported on PSoC Creator PSoC Creator is the long standing proprietary tool that runs on Windows only This mature IDE includes a graphical editor that supports schematic based desig...

Страница 7: ...you use in your firmware and include various middleware libraries for additional functionality like Bluetooth Low Energy LE connectivity or FreeRTOS This source code makes it easier to develop the fir...

Страница 8: ...d and pre validated Components However the PDL is a source code library that you can use with any development environment The PDL includes the following key software resources Header and source files...

Страница 9: ...Library FreeRTOS as shown in Figure 3 Figure 3 Import FreeRTOS in PSoC creator project If you have a preferred RTOS use the resources provided as examples on how to integrate such code with the PDL 2...

Страница 10: ...devices with PSoC Creator refer to the PSoC Creator Help 2 6 PSoC 6 MCU development kits PSoC 6 Wi Fi BT Pioneer Kit CY8CKIT 062 WiFi BT and PSoC 6 Wi Fi BT Prototyping Kit CY8CPROTO 062 4343W are de...

Страница 11: ...faces Up to 12 UDBs for custom digital peripherals Up to 32 TCPWM blocks configurable as 16 bit 32 bit timer counter PWM or quadrature decoder Up to 13 SCBs configurable as I2C Master or Slave SPI Mas...

Страница 12: ...Figure 4 PSoC 6 MCU block diagram Getting started with PSoC 6 MCU on PSoC Creator 3 Device features Application Note 12 002 21774 Rev G 2022 07 21...

Страница 13: ...nd follow all the instructions in this application note you use the code example as a reference while following the instructions You can download the code example from the website by clicking the link...

Страница 14: ...Launch PSoC Creator and get started 1 Ensure that PSoC Creator can find the PDL This should be set correctly automatically during installation but nothing works if this isn t set up right Refer to Fi...

Страница 15: ...workspace and open the workspace Figure 8 Open existing code example workspace 3 Select PSoC 6 MCU as the target device PSoC Creator speeds up the development process by automatically setting various...

Страница 16: ...part number this is the place you choose to Launch Device Selector option in Target device and select the appropriate part number a b c d Figure 9 Selecting target device 4 Pick a project template a C...

Страница 17: ...this step you set the name and location for your workplace and a name for the project See Figure 12 for help with this step A workspace is a container for one or more projects a Set the Workspace name...

Страница 18: ...files You view these files in the Workspace Explorer pane to the left The project schematic opens by default This is the TopDesign cysch file Double click the file name in the explorer pane to open t...

Страница 19: ...omponent Catalog expand the Communications group drag a UART SCB Component into the schematic and drop it It doesn t matter where you put a Component b Expand the Ports and Pins group and drag a Digit...

Страница 20: ...ive LOW that is the logic HIGH pin drive state turns OFF the LED and the logic LOW pin drive state turns it ON Figure 15 shows the configuration Double click the Component placed on the schematic to o...

Страница 21: ...Components to a design External Components on the schematic are included for descriptive purposes only they have no effect on the generated code Off chip Components are optional but can assist the ha...

Страница 22: ...e clock source of the TCPWM is the peripheral clock Clk_Peri The design will use this interrupt to toggle the LED state Open the Component customizer and follow the steps illustrated in Figure 18 a Ch...

Страница 23: ...mponent A B Figure 19 SysInt_PDL Settings As the final step connect the interrupt output of the TCPWM Component to the Isr_TCPWM Component input This routes the TCPWM interrupt to the CM4 CPU the sele...

Страница 24: ...in the corresponding field or use the drop down menu to pick the port or pin Typically the port number is used instead of the pin number since these names are independent of the specific package being...

Страница 25: ...Here you can see the clock tree and modify the clocks as required Note that there are tabs for different types of clocks such as Source Clocks FLL PLL High Frequency Clocks and Miscellaneous Clocks c...

Страница 26: ...ick the Interrupts that is under Design Wide Resources The list of interrupts appears b Enable Isr_Timer for the CM4 CPU The interrupt numbers are generated automatically by PSoC Creator when you gene...

Страница 27: ...before writing firmware PSoC Creator will automatically create macros constants and API calls that you may then use in your firmware 1 Generate the application Choose Build Generate Application PSoC C...

Страница 28: ...ce file and select Properties Figure 25 shows the Properties dialog window By default the main_cm0p c file is targeted to the Cortex M0 and the main_cm4 c file is targeted to the Cortex M4 You do not...

Страница 29: ...respective source codes to main_cm0p c and main_cm4 c from the code snippet provided in this section If you are using the code example files are already in your project Firmware flow In the remaining...

Страница 30: ...enabled the UART Component is started and prints a Hello World message on the terminal emulator A Timer Counter PWM TCPWM Component is configured to generate an interrupt every second At each interrup...

Страница 31: ...T_PutString UART_HW x1b 2J x1b H Cy_SCB_UART_PutString UART_HW CE221773 PSoC 6 MCU Hello World Example r n n Cy_SCB_UART_PutString UART_HW Hello World r n n Cy_SCB_UART_PutString UART_HW Press Enter k...

Страница 32: ...oid Configure the TCPWM peripheral Counter_config structure is defined based on the parameters entered in the Component configuration Cy_TCPWM_Counter_Init Timer_HW Timer_CNT_NUM Timer_config Enable t...

Страница 33: ...sage Hello World on to UART terminal Enter key pressed Yes No CM0 CPU CM4 CPU On TCPWM Interrupt Clear the TCPWM Interrupt Set the LEDupdateFlag Exit TCPWM Interrupt Handler LEDupdateFlag true Clear L...

Страница 34: ...atch and encounter errors revisit prior steps to ensure that you accomplished all the required tasks You can work to resolve errors or switch to the code example for these final steps 1 Select the deb...

Страница 35: ...gging this choice matters The debugger will see only the CPU you connect to These instructions do not use the debugger 2 Program the board Choose Debug Program to program the device with the project a...

Страница 36: ...ctions on updating the firmware 4 8 Part 6 Test your design This section describes how to test your design Follow the steps below to observe the output of your design Note that the below steps use Ter...

Страница 37: ...e printed from CM4 CPU 4 Enable the LED Blinking functionality Press the Enter key to start blinking the LED When the LED starts blinking the following message will be displayed on the UART terminal a...

Страница 38: ...241 PSoC 6 MCU Hardware Design Considerations AN219434 PSoC 6 MCU Importing Generated Code into an IDE AN219528 PSoC 6 MCU Low Power Modes and Power Reduction Techniques Table 3 lists the application...

Страница 39: ...Guide Bootloader AN213924 PSoC 6 MCU Bootloader Software Development Kit SDK Guide CE213903 PSoC 6 MCU Basic Bootloaders Communications CE220541 PSoC 6 MCU SCB EzI2C Audio CE218636 PSoC 6 MCU Inter IC...

Страница 40: ...embedded system design with reliable easy to use solutions such as touch sensing and enables low power designs ModusToolbox An Eclipse based embedded design platform for IoT designers that provides a...

Страница 41: ...B 2018 10 31 Updated images C 2018 11 15 Updated for public release D 2019 02 19 Updated for ModusToolbox 1 1 E 2019 10 14 Removed content for ModusToolbox 1 1 F 2021 03 14 Updated to Infineon Templat...

Страница 42: ...liabilities of any kind including without limitation warranties of non infringement of intellectual property rights of any third party with respect to any and all information given in this application...

Отзывы: