Power Application Controller www.active-semi.com Copyright 2018 Active-Semi, Inc.
Table of Contents 1 Overview... 3 1.1 Supported Versions... 3 2 Download... 3 2.1 Embedded Workbench for ARM... 3 2.2 PAC5xxx Support Patch... 3 3 Install... 3 3.1 Embedded Workbench for ARM... 3 3.2 PAC5xxx Support Patch... 3 3.2.1 v7.50.2 through v7.80.4... 3 3.2.2 v8.10... 4 4 Creating a New Project... 4 4.1 Create a New Pac52xx Project... 4 4.2 Configure Device Settings... 6 4.3 Create a New Source File... 10 4.4 Add the PAC52xx SDK... 13 4.5 Add PAC52xx SDK folders to Include Paths... 17 4.6 Add Defined Symbols... 20 4.7 Build the Project... 21 5 Linking Functions into RAM... 22 5.1 Create a RAM Function... 22 6 Conclusion... 23 About Active-Semi... 24 2018 Copyright, Active-Semi International, Inc. - 2 - Revised 2018/02/15
1 OVERVIEW This document will discuss how to install and configure IAR Embedded Workbench for use with PAC5xxx. 1.1 Supported Versions For versions of IAR Embedded Workbench older than v7.50.2, please contact Active-Semi for instructions. For versions of IAR Embedded Workbench v7.50.2 through v8.10, follow the instructions in this document. For versions of IAR Embedded Workbench newer than v8.10, simply install it as normal. No special instructions or files are required. 2 DOWNLOAD This section will discuss what to download. Please contact Active-Semi with any trouble obtaining any of the required files. 2.1 Embedded Workbench for ARM If not already installed, download Embedded Workbench for ARM from this link: https://www.iar.com/iar-embedded-workbench/#!?architecture=arm 2.2 PAC5xxx Support Patch Download the appropriate PAC5xxx support patch file: v7.50.2 through v7.80.4 - IAR_7.x_patch.zip v8.10 - IAR_8.10_patch.zip These files are available for download from this link: https://drive.google.com/open?id=0b9oea30rxc38vhbqu3nta0jynmm 3 INSTALL This section will discuss how to install the files downloaded. 3.1 Embedded Workbench for ARM Install Embedded Workbench for ARM using the default options. 3.2 PAC5xxx Support Patch Install the appropriate PAC5xxx support patch by following the instructions included with the patch. 3.2.1 v7.50.2 through v7.80.4 Copy the config folder into the ARM directory (replace existing files): C:\Program Files (x86)\iar Systems\Embedded Workbench 7.2\arm C:\Program Files (x86)\iar Systems\Embedded Workbench 7.3\arm 2018 Copyright, Active-Semi International, Inc. - 3 - Revised 2018/02/15
3.2.2 v8.10 Copy the config folder into the ARM directory (replace existing files): C:\Program Files (x86)\iar Systems\Embedded Workbench 8.0\arm 4 CREATING A NEW PROJECT This section will discuss how to create a new PAC52xx project, create a new source file, and add the PAC52xx SDK. The latest version of the PAC52xx SDK can be downloaded from the Software Tab of any PAC52XX product page. For example, the PAC5223 product page is located at: https://active-semi.com/products/intelligent-motor-control/pac5223 4.1 Create a New Pac52xx Project Create a new project by selecting Project->Create New Project in the menu. 2018 Copyright, Active-Semi International, Inc. - 4 - Revised 2018/02/15
Select the ARM tool chain and the Empty project template. Choose a name and directory to save the new project. The example below uses the project name pac52xx_iar and project directory C:\PAC52XX 2018 Copyright, Active-Semi International, Inc. - 5 - Revised 2018/02/15
A blank PAC52xx project should now be created. 4.2 Configure Device Settings Select Project->Options for Target in the menu. 2018 Copyright, Active-Semi International, Inc. - 6 - Revised 2018/02/15
Select the General Options->Target tab. Choose the Device option in the Processor variant section and click on the menu button to the right. 2018 Copyright, Active-Semi International, Inc. - 7 - Revised 2018/02/15
Select a PAC52xx device, such as PAC52XX or PAC5223. The Device box should now display the PAC52xx device you selected. 2018 Copyright, Active-Semi International, Inc. - 8 - Revised 2018/02/15
Select the General Options->Library Configuration tab. Check the box next to Use CMSIS in the CMSIS section. 2018 Copyright, Active-Semi International, Inc. - 9 - Revised 2018/02/15
4.3 Create a New Source File Open the project directory by right-clicking on pac52xx_iar and selecting Open Containing Folder Create a new main.c file in the project directory. 2018 Copyright, Active-Semi International, Inc. - 10 - Revised 2018/02/15
Add a new source file to the blank project by right-clicking on pac52xx_iar and selecting Add->Add Files 2018 Copyright, Active-Semi International, Inc. - 11 - Revised 2018/02/15
Select the main.c file in the project directory. A blank main.c file should now be in the project. 2018 Copyright, Active-Semi International, Inc. - 12 - Revised 2018/02/15
Edit main.c as shown below. 4.4 Add the PAC52xx SDK Install the PAC52xx SDK into your project directory, being sure to read and accept the License Agreement. The example below uses the project directory C:\PAC52XX\ and installs the PAC52xx SDK into the directory C:\PAC52XX\pac5xxx_sdk 2018 Copyright, Active-Semi International, Inc. - 13 - Revised 2018/02/15
Add a Group to the project by right-clicking on pac52xx_iar and selecting Add->Add Group Name the group pac5xxx_sdk Create three more subgroups under the pac5xxx_sdk group as shown. 2018 Copyright, Active-Semi International, Inc. - 14 - Revised 2018/02/15
Add the PAC52xx SDK files to the pac5xxx_boot subgroup by right-clicking on it and selecting Add Files Browse to the PAC52xx SDK folder inside the project directory. For the pac5xxx_boot subgroup, add the files from the pac5xxx_boot_iar folder. 2018 Copyright, Active-Semi International, Inc. - 15 - Revised 2018/02/15
Repeat this process for the pac5xxx_drivers and pac5xxx_peripheral subgroups by adding the files from the folders with their respective names. 2018 Copyright, Active-Semi International, Inc. - 16 - Revised 2018/02/15
Add the pac5xxx_sdk_version.h file to the pac5xxx_sdk group. 4.5 Add PAC52xx SDK folders to Include Paths Select Project->Options for Target in the menu. 2018 Copyright, Active-Semi International, Inc. - 17 - Revised 2018/02/15
Select the C/C++ Compiler->Preprocessor tab. 2018 Copyright, Active-Semi International, Inc. - 18 - Revised 2018/02/15
In the Additional include directories box, add the directories shown below. IAR IDE Installation 2018 Copyright, Active-Semi International, Inc. - 19 - Revised 2018/02/15
4.6 Add Defined Symbols In the Defined symbols box, add IAR as shown below. 2018 Copyright, Active-Semi International, Inc. - 20 - Revised 2018/02/15
4.7 Build the Project To build the project, select Project->Make in the menu. When prompted, save the workspace as pac52xx_iar If the build is successful, the Build window will show 0 errors. 2018 Copyright, Active-Semi International, Inc. - 21 - Revised 2018/02/15
5 LINKING FUNCTIONS INTO RAM This section will discuss how to create functions that are placed into RAM, instead of FLASH, for quicker execution. 5.1 Create a RAM Function Modify main.c as shown below. In this example, the gpio_init function will be placed into FLASH but the gpio_toggle function will be placed into RAM instead because of the PAC5XXX_RAMFUNC attribute. This can be verified by checking the map file. 2018 Copyright, Active-Semi International, Inc. - 22 - Revised 2018/02/15
The pac52xx_iar.map file is located in the List folder where the project is saved. The example below uses the project directory C:\PAC52XX\ 6 CONCLUSION IAR Embedded Workbench for ARM should now be installed and properly configured for use with PAC5xxx. 2018 Copyright, Active-Semi International, Inc. - 23 - Revised 2018/02/15
ABOUT ACTIVE-SEMI Active-Semi, Inc., headquartered in Dallas, TX, is a leading innovative semiconductor company with proven power management, analog, and mixed-signal products for end-applications that require power conversion (AC/DC, DC/DC, DC/AC, PFC, etc.), motor drivers and control, and LED drivers and control along with ARM microcontrollers for system development. Active-Semi s latest family of (PAC ) ICs offer high-level of integration with 32-bit ARM Cortex -M0, along with configurable power management peripherals, a Configurable Analog Front End with high-precision high-speed data converters, single-ended and differential PGAs, and integrated low-voltage and high-voltage gate drives. PAC ICs offer unprecedented flexibility and ease in the systems design of various end-applications such as Wireless Power Transmitters, Motor drives, UPS, Solar Inverters, and LED lighting that require a microcontroller, power conversion, analog sensing, high-voltage gate drives, open-drain outputs, analog and digital general purpose IO, as well as support for wired and wireless communication. More information and samples can be obtained from http://www.active-semi.com or by emailing marketing@active-semi.com Active-Semi shipped its 1 Billionth IC in 2012, and has over 120 in patents awarded and pending approval. LEGAL INFORMATION & DISCLAIMER Copyright 2018 Active-Semi, Inc. All rights reserved. All information provided in this document is subject to legal disclaimers. Active-Semi reserves the right to modify its products, circuitry or product specifications without notice. Active-Semi products are not intended, designed, warranted or authorized for use as critical components in life-support, life-critical or safety-critical devices, systems, or equipment, nor in applications where failure or malfunction of any Active-Semi product can reasonably be expected to result in personal injury, death or severe property or environmental damage. Active-Semi accepts no liability for inclusion and/or use of its products in such equipment or applications. Active-Semi does not assume any liability arising out of the use of any product, circuit, or any information described in this document. No license, express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of Active-Semi or others. Active-Semi assumes no liability for any infringement of the intellectual property rights or other rights of third parties which would result from the use of information contained herein. Customers should evaluate each product to make sure that it is suitable for their applications. Customers are responsible for the design, testing, and operation of their applications and products using Active-Semi products. Customers should provide appropriate design and operating safeguards to minimize the risks associated with their applications and products. All products are sold subject to Active-Semi's terms and conditions of sale supplied at the time of order acknowledgment. Exportation of any Active-Semi product may be subject to export control laws. Active-Semi, the Active-Semi logo, are registered trademarks of Active-Semi, Inc. Active-Semi logo, Solutions for Sustainability, Micro Application Controller, Multi-Mode Power Manager, Configurable Analog Front End, and Application Specific Power Drivers are trademarks of Active-Semi, Inc. ARM and Cortex are registered trademarks of ARM Limited. All referenced brands and trademarks are the property of their respective owners. 2018 Copyright, Active-Semi International, Inc. - 24 - Revised 2018/02/15