PSIM Tutoria l - Powersim · PSIM’s S code for This tuto in Code C To illustr example PSIM dir To...

13
Auto C P Code G PSIM Gener Ja - 1 - M Tut ration f anuary 2015 toria for F28 5 al 833x T Pow www.powersi Target wersim Inc. mtech.com t

Transcript of PSIM Tutoria l - Powersim · PSIM’s S code for This tuto in Code C To illustr example PSIM dir To...

Auto C

PCode G

PSIMGener

Ja

- 1 -

M Tutration f

anuary 2015

toriafor F28

5

al 833x T

Powwww.powersi

Target

wersim Inc. mtech.com

t

PSIM’s Scode for

This tutoin Code C

To illustrexample PSIM dir

To keep tand use t

1. PSIM

In PSIM,

As compF2833x Helements

The F283F2833x T

SimCoder Mhardware ba

orial describeComposer S

rate the procis located in

rectory.

the original this folder as

M Setup fo

, load the sch

pared to otheHardware Ta: a 16-chann

33x HardwarTarget. A li

A

Module, combased on TI F

es, in step bytudio (CCS)

cess, we use n the sub-fold

example uncs the working

for Code G

hematic file

r PSIM circuarget librarynel A/D conv

re Target libst of the libr

Auto Code Gen

bined with F2833x series

y step, how t), and run it o

the circuit “Tder “exampl

changed, weg folder in th

Generation

“TI_DC_DC

uits not for c. In this circuverter and a

brary can be rary is shown

neration for F

- 6 -

F2833x Hards floating-po

to generate con the DSP.

TI 1-ch DC/les\SimCode

e will copy thhis tutorial.

n

C_Buck_1_c

code generatuit, there are1-phase PW

accessed byn below on t

F2833x Target

dware Targetoint DSP.

code in PSIM

/DC buck.pser\F2833x Ta

he whole fol

ch.psimsch”

tion, this circe two F2833

WM Generato

y going to Elthe right.

t

t, can genera

M, compile a

simsch’ as anarget\TI 1-C

lder to “c:\ T

” as shown b

cuit containsx Hardware

or, as shown

lements >>

Powewww.powersim

ate ready-to-

and upload th

n example. TCh DC-DC”

TI 1-Ch DC-

elow.

s elements frTarget librabelow on th

SimCoder >

ersim Inc. mtech.com

-run

he code

This in the

-DC”,

rom the ary he left.

>>

Like any

1.1 S

Before peStudio. Dshould bethis case,

With the program

other circui

imulation C

erforming thDouble click e set to F283, we will cho

RAM Debuto the flash

F283

A

its, this circu

Control Par

he code geneon the Simu

33x. Click ooose RAM D

ug setting, it memory.

335 Hardwareused in the c

Auto Code Gen

uit can be sim

ameters

eration, first ulation Contron the drop-d

Debug, as sho

is easy to de

e elements ircuit

F2833x Tar

neration for F

- 7 -

mulated by s

define the prol block (thdown menu town below.

ebug the pro

rget library lis

F2833x Target

selecting Sim

project confighe clock imato choose on

gram and th

st:

t

mulate >> R

guration for age). The Hane of the fou

here is no nee

Powewww.powersim

Run Simulat

Code Compardware Tarur project set

ed to write th

ersim Inc. mtech.com

tion.

poser rget ttings. In

he

1.2 G

To generseparate

PSIM noconfigurafile and aTI_DC_D

2. CCS

The PSIM3.3 or highigher, yway to lo

2.1 Im

Launch Cto CCS vpops up. code)\TI_

Generating C

rate code, selwindow, as

ot only generations: RAMall dependenDC_Buck_1

S Setup

M generated gher. If you

you need to uoad and debu

mport Proje

CCS v5.5, if v5.5 project bclick on "Br_DC_DC_B

A

Code

lect Simulatshown below

rates the codM Debug, RAnt files are sto_ch (C code

project is foare using CC

use CCS’s Imug the progra

ect into CC

f this is the fiby go to Prorowse..." but

Buck_1_ch.pj

Auto Code Gen

te >> Generw.

de, but also gAM Release,ored in a sub

e)”.

or CCS v3.3,CS v3.3, the mport Legacyam in this do

S

irst time youoject >> Imptton to choosjt" then click

neration for F

- 8 -

rate Code. T

generates all Flash Relea

b-folder calle

, the Code Cproject can y v3.3 Projeocument for

u load the proport Legacyse " C:\TI 1-k "Next" but

F2833x Target

The generate

the necessarase, and Flased “c:\TI 1-C

Composer Stube opened d

ect function. the example

oject, you ney CCSv3.3 P-Ch DC-DC\tton.

t

ed code will

ry project filsh RAM RelCh DC-DC\

udio from Tdirectly; If u We use CC

e.

eed to transfProject. The\TI_DC_DC

Powewww.powersim

be displayed

les for four lease. The pr

TI should be vsing CCS 4

CS v5.5 to sh

fer CCS v3.3e following dC_Buck_1_ch

ersim Inc. mtech.com

d in a

roject

version or

how the

3 project dialog h (C

When the

If there isappear as

e following d

s no transfers follows:

A

dialog displa

r problem, th

Auto Code Gen

ayed, click "

he transform

neration for F

- 9 -

"Finish" butt

ed project w

F2833x Target

ton to start p

will be autom

t

project transf

matically load

Powewww.powersim

fer.

ded. The CC

ersim Inc. mtech.com

CS will

Note thatwill be lo

2.2 C

To comppane of Pproject nchanges trebuild th

t the project oaded to the

Compiling C

pile the projeProject Exploame in the pto bold) thenhe whole pro

A

configuratioRAM memo

Code

ect, right mouorer, then cli

pane of Projen select Projoject). After

Auto Code Gen

on is set to Rory.

use click on ick on "Builect Explorer ject >> Builthe compilin

neration for F

- 10 -

RAM Debug

the project nd Project" into select it a

ld to build thng is comple

F2833x Target

. With this s

name ("TI_Dn the poppedas the currenhe project orete, CCS wil

t

setting, all pr

DC_DC_Bud up menu. Ont project (thr Project >> ll display the

Powewww.powersim

rogram and d

ck_1_ch") inOr click on thhe project nam Rebuild Ale following:

ersim Inc. mtech.com

data

n the he me ll to

The warnsaved in

2.3 S

Before lo(AssumeConfigur

Right moConfigur

ning messagthe flash me

et Target C

oading a prog that a TI’s Trations, a pa

ouse click onration" in the

A

e can be ignemory.

Configuratio

gram to the tTMS320F28ane of Targe

n "User Defie popped up

Auto Code Gen

ored. This w

on

target, we ne8335 controlet Configurat

ined" in the Tmenu. A dia

neration for F

- 11 -

warning mess

eed to createCARD is ustions display

Target Confialog displays

F2833x Target

sage is displ

e a target consed). Select Vys as follows

figuration pas as below.

t

layed when p

nfiguration fView -> Tars in CCS.

ane then sele

Powewww.powersim

program is n

for the targetrget

ct "New Tar

ersim Inc. mtech.com

not

t board

rtget

Change t"Finish"

In "ConnC2000 XClick "Sa

Back to tmove mosub-menuproject in

3. Targ

Insert TI(TMDSD

the file namebutton. A ne

nection" comXDS510LC Eave" button t

the "Target Couse to "Linku. Select "TIn the "Projec

get Hardw

’s TMS320FDCDC2KIT)

A

e as you wanew pane nam

mbo box, choEmulator"), tto save the c

Configuratiok File to ProjI_DC_DC_Bct Explorer"

ware Setup

F28335 contr), as shown b

Auto Code Gen

nt (here is "Fmed "F2833x

oose the emuthen check "configuration

ons" pane, rigoject" in the pBuck_1_ch" pane. See be

p

rolCARD inbelow.

neration for F

- 12 -

F2833x", thex.ccxml" disp

ulator you wiTMS320F28n.

ght mouse clpopped up mproject, thenelow.

nto TI’s 2-Ch

F2833x Target

e file extensioplays in CCS

ill use (for e8335" in the

lick on "F28menu, all pron check if "F

hannel DC/D

t

on will be "cS as below.

example, "Spe list box of "

833x.ccxml"ojects will beF2833x.ccxm

DC Buck Co

Powewww.powersim

ccxml"), the

pectrum Digi"Board of D

configuratioe displayed iml" is added

onverter Kit

ersim Inc. mtech.com

n click

ital evice".

on, in the to the

Connect to the comSW2 on tposition.

4. Run

4.1 L

In CCS, cproject nconnectioautomati

the J1 connemputer’s USthe board. S

nning Code

Load Code t

click on "TI_ame displayon is successcally reset an

A

ector of the bSB port. Aftewitch SW3 i

e in DSP T

o DSP Targ

_DC_DC_Bys bold), thensful, the prognd run to the

Auto Code Gen

board to the er connectingis for display

Target

get

Buck_1_ch" pn select Rungram will bee start place

neration for F

- 13 -

JTAG emulg the power ying either C

project to sen >> Debug te upload to thof main fun

F2833x Target

lator, and theto the board

Ch1 or Ch2 o

et it as the cuto connect thhe target, the

nction as show

t

en connect thd, turn on Swoutput. Set S

urrent projeche computere F28335 DSwn below.

Powewww.powersim

he JTAG emwitches SW1SW3 to the C

ct (the currenr to the DSPSP will

ersim Inc. mtech.com

mulator 1 and Ch2

nt . If the

4.2 U

There areand FlashFlashRelwill autoconfigura"Build C

After chato the DS

4.3 R

To run thstep into,

5. Mo

At the enDSP to g

Uploading C

e 4 configurahRamReleaslease and Flamatically coation, right monfiguration

anging confiSP with the s

Run Code in

he code in th, step over an

nitoring W

nd of Sectiongenerate a co

A

Code to DSP

ation optionsse. RamReleashRamReleopy the progrmouse click ns" in the pop

guration, thesame method

n DSP Targe

he DSP, we cnd step retur

Waveform

ns Error! Reonverter outp

Auto Code Gen

(Flash Rele

s in the geneease and Ramase upload pram to RAMon the projepped up men

e project need described a

et

can use the torn to run the

s with PSI

eference souput of 3.3V (

neration for F

- 14 -

ease Version

erated projecmDebug uploprogram to D

M and all codct name in thnu and selec

ed to be comat 5. Upload

oolbar in "Dprogram.

IM’s DSP

urce not fou(+/-0.05V). N

F2833x Target

n)

ct: RamReleaoad programDSP flash mde will be runhe Project E

ct a configura

mpiled again,ding Code to

Debug" pane

Oscillosc

und., the codNow, one ma

t

ase, RamDebm to DSP RA

emory but Fn in RAM. T

Explorer paneation you wa

, then the codo DSP (RAM

as shown rig

ope

de is runningay use PSIM

Powewww.powersim

bug, FlashRAM area; InstFlashRamRelTo use a diffe, move mouant as below

de can be upM Debug Ve

ght to resum

g in the targeM’s DSP

ersim Inc. mtech.com

Release tead, lease ferent use to

w.

ploaded ersion).

me, stop,

eted

Oscilloscvoltage.

Connect

Launch Pshown be

Set the coSCI Conf

Click thevariables

cope feature

the SCI port

PSIM. Selectelow.

orrect serial figuration bl

e Connect bus will be liste

A

to monitor t

t of the hardw

t Utilities >>

port numberlock in the P

utton at the leed on the left

Auto Code Gen

the variables

ware target t

> DSP Oscil

r, baud rate, PSIM circuit

eft bottom oft side of the

neration for F

- 15 -

s inside the D

to the compu

lloscope. Th

and parity c.

f the scope ppanel, as sh

F2833x Target

DSP and to c

uter.

his will launc

check. They

panel. All nahown below.

t

control the c

ch the DSP O

must be iden

ames of SCI

Powewww.powersim

converter out

Oscilloscope

ntical to thes

output and

ersim Inc. mtech.com

tput

e as

se in the

input

The two on the sc

To changbutton. Tshows th

6. Cod

For furthdocumen

variables avope screen.

ge the DC-DThe LED dispe waveform

de Compo

her informatints in the link

A

vailable for m

DC converter play of the cs with the ne

ser Studio

ion about theks below.

Auto Code Gen

monitoring ar

output voltaconverter boaew value of V

o Referenc

e Texas Instr

neration for F

- 16 -

re Vfdbk an

age, modify ard will chanVref.

ces

rument’s Co

F2833x Target

nd Ref_out. S

the value Vrnge to the ne

ode Compose

t

Select the va

ref to 2 and ew value. Th

er Studio, pl

Powewww.powersim

ariables to di

click the Uphe figure bel

ease refer to

ersim Inc. mtech.com

isplay

pdate low

o the

C

ht

CCSv5 Getting

ttp://proces

A

g Started Gui

ssors.wiki.ti

Auto Code Gen

deCCSv5 Ge

.com/index.

neration for F

- 17 -

tting Started

.php/CCSv5

F2833x Target

Guide

5_Getting_S

t

Started_Gu

Powewww.powersim

ide

ersim Inc. mtech.com