PSIM Tutorial. How to Use SimCoder with TI F28335 Target Powersim Inc.

Similar documents
TUTORIAL Auto Code Generation for F2833X Target

TUTORIAL Auto Code Generation for F2803X Target

TUTORIAL Auto Code Generation for F2806X Target

PSIM Tutorial. How to Use SCI for Real-Time Monitoring in F2833x Target. February Powersim Inc.

PSIM Tutorial. How to Use SPI in F2833x Target. February Powersim Inc.

Code Composer Studio Operation Manual

How to: Flash the DC/DC LED Lighting Kit s F28035 controlcard so that it works with the GUI

As CCS starts up, a splash screen similar to one shown below will appear.

F28335 ControlCard Lab1

F28069 ControlCard Lab1

HVMotorCtrl + PFC Kit How to Run Guide

APPENDIX A. CODE COMPOSER STUDIO (CCS) v5: A BRIEF TUTORIAL FOR THE DSK6713

Quick-Start Guide. BNS Solutions. QSK62P Plus

As CCS starts up, a splash screen similar to one shown below will appear.

BHFlashBurn v2.0. User Guide. BHFlashBurn-UG-02 April 2008

ECE 487 LAB 1 ÇANKAYA UNIVERSITY Overview of DSP Board

TMS. series SIGNUM SYSTEMS CORPORATION. JTAGjet Driver for Code Composer Studio 2.x/3.0. Installation Instructions

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup using a USB Debug Adapter

TMS320F2808, TMS320F2806 and TMS320F2801 SDFlash JTAG Flash Programming Utilities

NIOS CPU Based Embedded Computer System on Programmable Chip

TDS510USB-C2K Emulator Installation Guide

IAR EWARM Quick Start for. Holtek s HT32 Series Microcontrollers

STM32 F4xx Discovery Board Setup Guide

SKP16C26 Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Quick Start Guide for the Turbo upsd DK3300-ELCD Development Kit- RIDE

Section Objective: Acquaint with specifications of Launchpad Acquaint with location of switches, LEDs, power-on switch, powering the board.

DOMAIN TECHNOLOGIES INC. Users Guide Version 2.0 SB-USB2. Emulator

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission.

Debugging in AVR32 Studio

Evaluation board for NXP LPC2103. User Guide. Preliminary Version updated 27 th Aug TechToys Company All Rights Reserved

Solar Explorer Kit Quick Start Guide

TMS320F2810, TMS320F2811 and TMS320F2812 SDFlash JTAG Flash Programming Utilities

Keil TM MDK-ARM Quick Start for. Holtek s HT32 Series Microcontrollers

ZCRMZNICE01ZEMG Crimzon In-Circuit Emulator

Code Composer TM. Quick Start Guide

EPM900 - Overview. Features. Technical Data

Experiment 6 Finite Impulse Response Digital Filter (FIR).

Code Composer Studio Development Tools v3.3. Getting Started Guide

Use of ISP1507-AL Evaluation Boards

ECE4703 Real-Time DSP Orientation Lab

Getting Started with STK200 Dragon

TMS320F2802x SDFlash JTAG Flash Programming Utilities

NIOS CPU Based Embedded Computer System on Programmable Chip

Section 2: Getting Started with a FPU Demo Project using EK-LM4F232

TMS320F2810, TMS320F2811 and TMS320F2812 SDFlash JTAG Flash Programming Utilities

indart -HCS08 In-Circuit Debugger/Programmer for Freescale HCS08 Family FLASH Devices User s Manual Rev. 2.0

Getting Started in C Programming with Keil MDK-ARM Version 5

Quick Start Guide TWR-S08PT60. 5-Volt S08P Family of 8-bit MCUs for Industrial and Appliance Applications TOWER SYSTEM

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

System Framework Overview Guide and Instructions on How to Use the Template Projects

Quick Tutorial for Quartus II & ModelSim Altera

Getting Started in C Programming with Keil MDK-ARM Version 5

AC/DC. Adapter. Ribbon. Cable Serial. Serial. Adapter. Figure 1. Hardware Setup using an EC2 Serial Adapter

M16C/62P QSK QSK62P Plus Tutorial 1. Software Development Process using HEW4

file://c:\documents and Settings\degrysep\Local Settings\Temp\~hh607E.htm

XDS560V2 Installation Guide

Quick Start Guide for mbed enabling Freescale FRDM-KL25z Freedom board

Quick Start Installation Guide

TI Tiva C Series LaunchPad ARM M4 Software Installation

CHAPTER 1 Introduction of the tnano Board CHAPTER 2 tnano Board Architecture CHAPTER 3 Using the tnano Board... 8

P89V51RD2 Development Board May 2010

EVB9S08DZ60. Demonstration Board for Freescale MC9S08DZ60. User s Manual

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup Using a USB Debug Adapter

You have a PC with a USB interface, running Microsoft Windows XP (SP2 or greater) or Vista You have the Workshop Installation Software Flash Drive

Workbench V Integrated Development Environment for Renesas Capacitive Touch

Active Power Programmer Instructions

Pengwyn Documentation

STM32 F7xx Discovery Board Setup Guide

LAB #1: The CSM12C32 Module and PBMCUSLK Project Board

F28027 USB Stick Lab1_3

EXPRESS. Users Guide. Version 3.5

Z8 Encore! XP/Z8 Encore! Development Kits

User Guide for Running a Project on the Embest Board

TMS320C5502 ezdsp Quick Start Guide

Figure 1. JTAGAVRU1 application The JTAGAVRU1 is supported by AVR Studio. Updated versions of AVR Studio is found on

Introduction to the M16C Development Environment

PRELAB! Read the entire lab, and complete the prelab questions (Q1- Q3) on the answer sheet before coming to the laboratory.

CodeWarrior Development Studio for Freescale 68HC12/HCS12/HCS12X/XGATE Microcontrollers Quick Start SYSTEM REQUIREMENTS Hardware Operating System 200

Using Cadence Virtuoso, a UNIX based OrCAD PSpice like program, Remotely on a Windows Machine

April 4, 2001: Debugging Your C24x DSP Design Using Code Composer Studio Real-Time Monitor

SMT107 User Manual User Manual (QCF42); Version 3.0, 8/11/00; Sundance Multiprocessor Technology Ltd. 1999

S3F8S5A Development Kit

Texas Instruments Code Composer and ez-dsp Setup Notes

Controller Continuum. for Microcontrollers V6.3. Quick Start

keyestudio Keyestudio MEGA 2560 R3 Board

Dual Tone Multi-Frequency (DTMF) Generation with TI-DSP TMS320C6713 Processor

TI mmwave Training. xwr16xx mmwave Demo

Getting Started Guide RS-EDP & XC167 CPU Module. Version 2 10th June 2010

LV8548MCSLDGEVB. Brush DC Motor Driver Module Solution Kit Quick Start Guide

NIOS CPU Based Embedded Computer System on Programmable Chip

Click on the Start Icon. Click on All Programs

In-Circuit Emulator. UNetICE for ARM

TMS320F28335, 28334, Flash APIs

PK-HCS12C32 Starter Kit for Motorola MC9S12C32 User s Manual

Getting Started Guide: TMS-FET470A256 IAR Kickstart Development Kit

UPS model : 9PX/9SX 1:1 5 to 22kVA

AC/DC. Adapter. Serial. Adapter. Figure 1. Hardware Setup

R8C/Tiny. StarterKit Plus SKP8CMINI-15, SKP8CMINI-17. Clock Stop Detect

Renesas Starter Kit for RX111

DSP Development Environment: Introductory Exercise for TI TMS320C55x

Transcription:

PSIM Tutorial How to Use SimCoder with TI F28335 Target - 1 - Powersim Inc.

With the SimCoder Module, PSIM can automatically generate generic code from the control schematic. With SimCoder and the TI F28335 Hardware Target, PSIM can generate ready-to-run code for hardware based on TI floating-point DSP F28335. This tutorial describes, in step by step, how to generate code in PSIM, compile and upload the code in CodeComposer Studio, and run it on the DSP. To illustrate the process, we use the circuit TI 1-ch DC/DC buck.psimsch as an example. This example is located in the sub-folder examples\simcoder\ti F28335 Target\TI 1-Ch DC-DC in the PSIM directory. To keep the original example unchanged, we will copy the whole folder to c:\ TI 1-Ch DC-DC, and use this folder as the working folder in this tutorial. 1. Setting Up in PSIM In PSIM, load the schematic file 1-ch dc-dc buck.psimsch as shown below. As compared to other PSIM circuits not for code generation, this circuit contains elements from the TI F28335 Hardware Target library. In this circuit, there are two F28335 Hardware Target library elements: a 16-channel A/D converter and a 1-phase PWM Generator, as shown below on the left. - 6 - Powersim Inc.

The TI F28335 Hardware Target library can be accessed by going to Elements -> SimCoder for Code Generation -> TI F28335 Target. A list of the library is shown below on the right. TI F28335 Target library list Hardware elements used in the circuit Like any other circuits, this circuit can be simulated by selecting Simulate -> Run Simulation. Before performing the code generation, first define the project configuration for Code Composer Studio. Double click on the Simulation Control block (the clock image). The Hardware Target should be set to TI F28335. Click on the drop-down menu to choose one of the four project settings. In this case, we will choose RAM Debug, as shown below. - 7 - Powersim Inc.

With the RAM Debug setting, it is easy to debug the program and there is no need to write the program to the flash memory. 2. Generating Code To generate code, select Simulate -> Generate Code. The generated code will be displayed in a separate window, as shown below. PSIM not only generates the code, but also generates all the necessary project files for four configurations: RAM Debug, RAM Release, Flash Release, and Flash RAM Release. The project file and all dependent files are stored in a sub-folder called c:\ti 1-ch DC-DC\1-ch dcdc buck (C code). 3. Compiling the Project in CodeComposer Studio (CCS) The CodeComposer Studio (CCS) from TI should be version 3.3 or higher. If you are using CCS v3.3, and get the message Unknown compiler option --float_support=fpu32, please follow the procedures in Appendix A to update your CCS v3.3. Launch CCS, go to Project -> Open. Navigate to the folder c:\ti 1-ch DC-DC\1-ch dc-dc buck (C code) and select the project file 1_ch_dc_dc_buck.pjt, as shown below. - 8 - Powersim Inc.

Click the Open button to continue. The CCS will appear as follows: Note that the project configuration is set to RAM Debug. With this setting, all program and data will be loaded to the RAM memory. - 9 - Powersim Inc.

To compile the project, click on the icon on the Toolbar or select Project -> Build to build the project (or click on or select Project -> Rebuild All to rebuild the whole project). After the compiling is complete, CCS will display the following: The warning message can be ignored. This warning message is displayed when program is not saved in the flash memory. 4. Uploading Code to DSP (RAM Debug Version) Insert TI s TMS320F28335 controlcard into TI s 2-Channel DC/DC Buck Converter Kit (TMDSDCDC2KIT), as shown below. Connect the J1 connector of the board to the JTAG emulator, and then connect the JTAG emulator to the computer s USB port. After connecting the power to the board, turn on Switches SW1 and SW2 on the board. Switch SW3 is for displaying either Ch1 or Ch2 output. Set SW3 to the Ch2 position. In CCS, select Debug -> Connect to connect the computer to the DSP. If the connection is successful, the bottom left corner of CCS will be changed from the disconnection state to the connection state, as shown below. Disconnected Connected - 10 - Powersim Inc.

If connection cannot be established, an error message will appear as shown below: If this happens, remove the JTAG emulator cable from the computer s USB connector and turn off switch SW1 of the kit. Then reconnect the cable and turn on switch SW1. Select Debug -> Reset Emulator, then select Debug -> Connect again. If connection still cannot be established, check if the proper JTAG driver is used. After the connection is established, there are two ways to upload the code to the DSP. One is to use the Load Program function. Go to File -> Load Program, and specify the.out file (in this example C:\TI 1-Ch DC-DC\1-ch dc-dc buck (C code)\ramdebug\1_ch_dc_dc_buck.out ). CCS will automatically load the code to the RAM memory. Note that the Load Program function works only for the RAM Debug or RAM Release version. Another way to upload the code to the DSP is to use the on-chip flash programmer function. This method works for both RAM and flash versions. Click on the icon of the loader tool in CCS Toolbar as shown below or select Tools -> F28xx On-Chip Flash Programmer. The following dialog will pop up. Enter the values and selection as shown below. Note that the DSP external clock of the TMS320F28335 controlcard is 25MHz. Also, the DIVSEL value and PLLCR Value are set to /2 and 12 for this Converter Kit. They may be different for other hardware boards. Click on the OK button, and the following dialog will appear. - 11 - Powersim Inc.

Click on OK again, and the dialog window below will appear. Since the project configuration is set to RAM Debug, make sure to select Load RAM Only in this window. Click on the button Execute Operation to upload the code to the DSP. Close this window after the upload is finished. - 12 - Powersim Inc.

5. Running Code in DSP To run the program in the DSP, select Debug -> Reset CPU. The following window will appear. Then select Debug -> Restart. The following window will appear. Then select Debug-> Go Main to go to the beginning of the main program. The following window will appear. Now click on the icon in the Toolbar, or select Debug -> Run to run the program. - 13 - Powersim Inc.

To stop the program, click on the icon in the Toolbar box, or select Debug -> Halt. To disconnect the kit, select Debug -> Disconnect. Then turn off Switch SW1 of the kit. 6. Uploading Code to DSP (RAM Release Version) The procedure of compiling and uploading the RAM Release version is same as the RAM Debug version, except that the project configuration is set to 2_RamRelease when compiling. With the RAM release version, the speed of the code will be faster than the RAM Debug version, but certain debug information will not be available. 7. Uploading Code to DSP (Flash Release Version) To upload the code to the flash memory of the DSP, in CCS, from the drop-down menu, change the project configuration to 3_FlashRelease as shown below. In this configuration, the code will be saved and executed in the flash memory. Alternatively, select Project -> Configurations. Click on 3_FlashRelease, and then click on the Set Active and Done buttons. To compile the program, click on the icon or select Project -> Build to build the project (or click on the icon or select Project -> Rebuild All to rebuild the whole project). The process of connecting the computer to the DSP is the same as described in Step 4. Once the DSP is connected to the computer, click the loader tool in toolbar box of CCS or select Tools -> F28xx On-Chip Flash Programmer to upload program to the DSP. Note that, in the upload dialog window, make sure to check the option Erase, Program, Verify. Then click on the Execute Operation button to upload the code. After the program is uploaded to the flash memory. Disconnect the JTAG cable from the computer and turn off switch SW1. Then turn on switch SW1 to start running the code. The lamp in the kit will be turned on, and the LED on the board will display the output voltage. - 14 - Powersim Inc.

8. Uploading Code to DSP (Flash RAM Release Version) The procedure of compiling and uploading the flash RAM release version is same as the flash release version, except that the project configuration is set to 4_FlashRamRelease when compiling. With the flash RAM release version, the code will be automatically copied from the flash memory to the RAM memory first, and then it will run in the RAM memory. The speed of the code will be faster as compared to the flash release version. - 15 - Powersim Inc.

Appendix A: Upgrading CodeComposer Studio V3.3 If you have the F28335 DSP and get the error message Uknown compiler option float_support=fpu32 when compiling for the F2833x target, you need to update your CCS C2000 compiler. Below are the steps : 1. Launch CCS v3.3 2. Select Help -> Update Advisor -> Check for Updates. You will have to have an account on the TI site to access the download section. 3. Log in to your account, and you will be re-directed to the page Available Updates for CCS v3.3. Download and install the following: o CCSv3.3 Service Release 10 (or higher), and o C2000 Code Generation Tools Use this link to get the latest version of the TI v5.0 C2000 Code Generation Tools with the floating point updates: https://wwwa.ti.com/downloads/sds_support/codegenerationtools.htm, and download the C2000 Code Generation Tools v5.0.2 or newer. 4. Specify CCS to use the new code generator you downloaded and installed. To do so, start CCS. Click on Help -> About -> Component Manager. In Component Manager, click on the + sign next to the CCS version you just installed. Then click on the + sign next to TMS320C28XX. Check the box next to the v5.0.x Code Generation Tools that you installed from 5. Choose File -> Save and File -> Exit, and exit CCS. - 16 - Powersim Inc.