Advertisement

Quick Links

AN230264
Getting started with PSoC

About this document

Scope and purpose
AN230264 briefly introduces you to PSoC
M0+ based microcontroller. This application note also guides you to set up the PSoC
environment.
Intended audience
This document is intended for anyone using PSoC

Table of contents

About this document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Table of contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2
Feature set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
2.1
Function summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3
Development environment and tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
3.1
Evaluation board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
3.1.1
CYHVPA-128K-32-001 board connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
3.1.2
Connection diagram with tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2
Sample Driver Library (SDL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.1
SDL structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.2
3.2.3
Startup flow example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2.4
Sample code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
3.3
Peripheral drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.4
Example usage of SDL with IAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.4.1
Environment for SDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18
3.4.2
Install IAR Embedded Workbench and SDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.4.3
Set up debug script and configuration files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
3.4.4
Example usage of SDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.4.5
Other sample codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.5
Development tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.6
Flash programming tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
Application note
Please read the sections "Important notice" and "Warnings" at the end of this document
www.infineon.com
HV PA family
high-voltage (HV) precision analog (PA) family, an Arm
HV PA family MCUs.
HV PA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
®
®
Cortex
-
HV PA development
002-30264 Rev. *B
2023-04-19

Advertisement

Table of Contents
loading

Summary of Contents for Infineon AN230264

  • Page 1: Table Of Contents

    ™ About this document Scope and purpose ® ® AN230264 briefly introduces you to PSoC high-voltage (HV) precision analog (PA) family, an Arm Cortex ™ M0+ based microcontroller. This application note also guides you to set up the PSoC HV PA development ™...
  • Page 2 Getting started with PSoC HV PA family ™ Table of contents Disclaimer ................39 Application note 002-30264 Rev.
  • Page 3: Introduction

    Getting started with PSoC HV PA family ™ 1 Introduction Introduction This application note provides an overview of the device feature set, and describes the development environment and tools to get started with the CY8C41xxLCE-HV4xx series from the PSoC HV PA family. ™...
  • Page 4: Feature Set

    Getting started with PSoC HV PA family ™ 2 Feature set Feature set PSoC HV PA is a fully integrated programmable embedded system for battery monitoring and management. ™ ® ® The system features an Arm Cortex M0+ processor, and programmable and reconfigurable analog and digital blocks.
  • Page 5 Getting started with PSoC HV PA family ™ 2 Feature set Up to 8 KB of SRAM with ECC Up to 8 KB of data flash with ECC • Precision analog channel subsystem (PACSS) Two precision delta-sigma ADCs (16-20+ bits) Current channel with automatic gain Voltage channel Temperature and diagnostic channels...
  • Page 6: Development Environment And Tools

    CYHVPA-128K-32-001 has Arm standard MIPI 10-pin / 20-pin connectors for the debug interface by third-party interfaces, and Infineon KitProg3 low-level communication interface for programming and debugging. The evaluation board can be used for the development of software. For more information on board details, see the PSoC HV PA Evaluation Board user guide (References).
  • Page 7: Cyhvpa-128K-32-001 Board Connections

    Getting started with PSoC HV PA family ™ 3 Development environment and tools Status LED 10 pin program header USB Lines USB micro 20 pin program PSoCһ 5LP header 3.3V Pseudo load Reset SW 12V wall adapter Selecter 8 pin I/O header Battery connector 2 LEDs...
  • Page 8: Connection Diagram With Tools

    Getting started with PSoC HV PA family ™ 3 Development environment and tools Table 1 (continued) Board connections CY8C4147LCE-HV413 (U3) Connection/component Pin name P0[6] SWDIO for programming P0[5] User push switch / I/O header P0[4] User DIP switch / I/O header P0[3] User LED (green) / I/O header P0[2]...
  • Page 9: Sample Driver Library (Sdl)

    Basic connection diagram of MIPI 20-pin connector Sample Driver Library (SDL) Infineon provides an SDL including startup as sample software. The SDL provides a simple interface to access various peripherals and is used for system validation, hardware bring-up, benchmarks, feasibility studies, and demos.
  • Page 10: Sdl Structure

    Getting started with PSoC HV PA family ™ 3 Development environment and tools 3.2.1 SDL structure The SDL package includes startup, device header files, drivers providing APIs for each peripheral and their examples, and development tool support for the IAR toolchain (recommend version: IAR EWARM revision 8.42.1).
  • Page 11 Getting started with PSoC HV PA family ™ 3 Development environment and tools │ └─mcureg ├─src │ │ main_cm0plus.c CM0+ Core Application Source File │ ├─drivers │ │ ├─adc Provides the ADC Driver API │ │ ├─cpu Provides the CPU Driver API │...
  • Page 12: Cpu (Cm0+) Startup Sequence For Psoc

    Getting started with PSoC HV PA family ™ 3 Development environment and tools │ │ │ ├─interrupt │ │ │ ├─polling │ │ │ └─reset │ │ ├─tcpwm Basic Example of TCPWM and PWM │ │ │ ├─capture │ │ │...
  • Page 13: Startup Flow Example

    Getting started with PSoC HV PA family ™ 3 Development environment and tools CM0+ executes "SystemInit" Disables WDT Applies flash wait states Clock selection Enables generic system IRQ Continues execution of CM0+ user application 3.2.3 Startup flow example The application startup sequence process is executed after the boot process completes. In the boot process, according to the lifecycle stage, protection status and debug access restriction settings are mainly performed, and application authentication is performed.
  • Page 14: Sample Code

    Getting started with PSoC HV PA family ™ 3 Development environment and tools Boot process is executed Reset Release The main function of the boot process is to configure the system. ∙ Apply trims ∙ Lifecycle stage and protection from eFuse and supervisory flash ∙...
  • Page 15 Getting started with PSoC HV PA family ™ 3 Development environment and tools Code Listing 1 Sample code for CM0+ startup ;************************************************************************ ;* Start-up Code ;************************************************************************ THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler: ; Disable global interrupts CPSID ; Update Vector Table Offset Register with address of user ROM table ;...
  • Page 16 Getting started with PSoC HV PA family ™ 3 Development environment and tools ;CMP r2, sp ;BNE startup_stack_ecc_init_loop ; Call C startup code (no ANSI C context established yet!) r7, =Startup_Init ; Initialize data sections r7, =__iar_data_init3 r7, =__iar_program_start ; Note: Control flow does not necessarily return here. ;...
  • Page 17: Peripheral Drivers

    Peripheral drivers are a set of firmware drivers that provide APIs for accessing hardware. These APIs perform initialization and control activities of each peripheral. Table 2 lists the peripheral drivers that Infineon provides for SDL, and Table 3 lists the device-specific middleware.
  • Page 18: Example Usage Of Sdl With Iar

    Getting started with PSoC HV PA family ™ 3 Development environment and tools Table 2 (continued) Peripheral drivers list Driver Description API functionality CPU driver Enable CPU-specific features Direct Memory Access Perform memory-to-memory (M-DMA) and peripheral- to-memory (P-DMA) (and vice versa) operations FLASH Flash APIs to handle flash memory...
  • Page 19: Install Iar Embedded Workbench And Sdl

    Locate flash loaders. They are available at the location: /misc/iar/IAR_EWARM_8421_Patch_PSoC4HV.7z Extract IAR_EWARM_8421_Patch_PSoC4HV.7z Copy the extracted package (" " folder) to the IAR installation folder. (example, C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm src: IAR_EWARM_8421_Patch_PSoC4HV\arm\config\debugger\Infineon dst: \config\debugger\Infineon src: IAR_EWARM_8421_Patch_PSoCHV\arm\config\devices\Infineon\PSoC4\PSoC4-HV-PA dst: \config\devices\Infineon\PSoC4 src: IAR_EWARM_8421_Patch_PSoC4HV\arm\config\flashloader\Infineon...
  • Page 20: Example Usage Of Sdl

    Getting started with PSoC HV PA family ™ 3 Development environment and tools SDL folder IAR Systems folder Copy in Embedded Workbench 8.4 folder Figure 8 Copying to Embedded Workbench 3.4.4 Example usage of SDL Go to the following folder of SDL: C:/<user path>\ PSoC_Sample_Driver_Library_x.x.x\PSoC4hvpa144k\tools\iar\flash Open IAR EWARM v8.42.1, navigate to the flash workspace and open accordingly.
  • Page 21 Getting started with PSoC HV PA family ™ 3 Development environment and tools Figure 10 IAR EWARM project Click on the under in the left panel. Details of the sample code are shown (see Code main_cm0plus.c Listing Application note 002-30264 Rev. *B 2023-04-19...
  • Page 22 Getting started with PSoC HV PA family ™ 3 Development environment and tools Figure 11 Sample code Select Project > Rebuild All to build the project. Application note 002-30264 Rev. *B 2023-04-19...
  • Page 23 Getting started with PSoC HV PA family ™ 3 Development environment and tools Figure 12 Rebuild All • Download the application using the IAR I-JET debugger Note: If you do not have the IAR I-jet Debugger, then skip Steps to 8. Connect the IAR I-jet Debugger to either J3 (MIPI 20-pin) or J5 (MIPI 10-pin) of the CYHVPA-128K-32-001 Evaluation Board with power supply (See Figure...
  • Page 24 Getting started with PSoC HV PA family ™ 3 Development environment and tools 12V Wall Adapter Debugger Power Power VBAT MIPI 10-pin MIPI 20-pin Connector Switch Connector Connector connector PSoC™ 5LP KitProg3 PSoC™ 4 HV PA (DUT) Figure 13 Connection of IAR I-jet Debugger Download the project to PSoC HV PA device by selecting Project >...
  • Page 25 Getting started with PSoC HV PA family ™ 3 Development environment and tools Figure 14 Downloading the project Push the reset switch (SW2) on the CYHVPA-128K-32-001 Evaluation Board and then confirm that the LED (D7) is blinking. • Download the application using the onboard KitProg3 Connect the USB cable to the J4 of the CYHVPA-128K-32-001 Evaluation Board with the power supply (See Figure...
  • Page 26 Getting started with PSoC HV PA family ™ 3 Development environment and tools 12V Wall Adapter Power Power VBAT Connector Switch PSoC™ 5LP connector KitProg3 PSoC™ 4 HV PA (DUT) USB cable Figure 15 USB cable connection Select Project > Options… to change the debugger settings. Figure 16 Debugger options Select Debugger from Options and change the Driver to CMSIS DAP as shown in...
  • Page 27 Getting started with PSoC HV PA family ™ 3 Development environment and tools Figure 17 CMSIS DAP driver Select CMSIS DAP from Options and select the Interface tab. Change the settings as shown in : • Probe config -> Auto •...
  • Page 28 Getting started with PSoC HV PA family ™ 3 Development environment and tools Figure 18 CMSIS DAP settings Click OK and re-select Project > Rebuild All to build the project. Download the project to PSoC HV PA device by selecting Project > Download > Download active ™...
  • Page 29 Getting started with PSoC HV PA family ™ 3 Development environment and tools Figure 19 Downloading the project to PSoC HV PA ™ Push the reset switch (SW2) on the CYHVPA-128K-32-001 Evaluation Board and then confirm that the LED (D7) is blinking. To debug the project using either IAR I-JET debugger or onboard KitProg3 (CMSIS DAP), select Project >...
  • Page 30: Other Sample Codes

    Getting started with PSoC HV PA family ™ 3 Development environment and tools Figure 20 Download and Debug 3.4.5 Other sample codes Other sample codes are in the: C:/<user path>\ PSoC_Sample_Driver_Library_x.x.x\PSoC4hv144k\src\examples Application note 002-30264 Rev. *B 2023-04-19...
  • Page 31 Getting started with PSoC HV PA family ™ 3 Development environment and tools Figure 21 Sample codes Go to any code sample folder (e.g., adc > dual) and copy the file in the folder. main_cm0plus.c Application note 002-30264 Rev. *B 2023-04-19...
  • Page 32 Getting started with PSoC HV PA family ™ 3 Development environment and tools Figure 22 Copy file main_cmoplus.c Go to: and replace the copied C:/<user path>\ PSoC_Sample_Driver_Library_x.x.x\PSoC4hv144k\src file at the src level. You should make a backup of the file. main_cm0plus.c main_cm0plus.c Figure 23...
  • Page 33: Development Tools

    EWARM (8.42.1) Onboard KitProg3 Flash programming tools Table 5 lists the supported flash programming tools. Infineon MiniProg4 programmer is for development purposes. For mass production purposes, a JTAG programmer from a third-party is suitable. Table 5 Flash programming tools Vender...
  • Page 34: Summary

    4 Summary Summary This application note guided you to set up the PSoC HV PA development environment. Infineon provides an ™ evaluation board and a wealth of sample software to help you get started with the PSoC HV PA family. To ™...
  • Page 35: Glossary

    Getting started with PSoC HV PA family ™ 5 Glossary Glossary Table 7 Glossary Terms Description A/D converter Analog to Digital Converter Analog to Digital Converter Advanced High-Performance Bus Application Programming Interface Brown-Out Detectors ® ® CM0+ Cortex -M0+ (processor core name) Central Processing Unit CPUSS CPU Subsystem...
  • Page 36 Getting started with PSoC HV PA family ™ 5 Glossary Table 7 (continued) Glossary Terms Description Sample Driver Library Serial Peripheral Interface SRAM Static RAM SRSS System Resource Subsystem Serial Wire Debugging TCPWM Timer, Counter and PWM Watchdog Timer Application note 002-30264 Rev.
  • Page 37: References

    The following are the PSoC HV PA family series application notes, datasheets, and technical reference ™ manuals. Contact Infineon Technical Support to obtain these documents and sample driver library. Application notes AN230265 - Hardware design guide for PSoC HV PA family ™...
  • Page 38: Revision History

    Getting started with PSoC HV PA family ™ Revision history Revision history Document Date Description of changes revision 2020-11-24 Initial release 2023-04-07 Updated all sections to support the latest silicon 2023-04-19 Template update; no content updated. Application note 002-30264 Rev. *B 2023-04-19...
  • Page 39 Infineon Technologies, All Rights Reserved. information given herein in the real application. Infineon Technologies’ products may not be used in Infineon Technologies hereby disclaims any and all   any applications where a failure of the product or...

Table of Contents