Documente Academic
Documente Profesional
Documente Cultură
P M Tuttoria
al
Auto Code
C Gener
G ration ffor F28
833x T
Targett
Jaanuary 20155
-1- Pow
wersim Inc.
www.powersimtech.com
Auto
A Code Gen
neration for F
F2833x Targett
PSIM’s SimCoder
S Module,
M combbined with F2833x
F Harddware Targett, can generaate ready-to--run
code for hardware baased on TI F2833x seriess floating-pooint DSP.
This tuto
orial describees, in step by
y step, how to
t generate ccode in PSIM
M, compile aand upload thhe code
in Code Composer
C Studio (CCS)), and run it ono the DSP.
To illustrrate the proccess, we use the circuit “T
TI 1-ch DC//DC buck.pssimsch’ as ann example. T
This
example is located in n the sub-fold
der “examplles\SimCodeer\F2833x Taarget\TI 1-CCh DC-DC” in the
PSIM dirrectory.
To keep the
t original example uncchanged, wee will copy thhe whole follder to “c:\ T
TI 1-Ch DC--DC”,
and use this
t folder ass the working
g folder in th
his tutorial.
1. PSIM
M Setup for
fo Code Generation
G n
In PSIM,, load the sch
hematic file “TI_DC_DC
C_Buck_1_cch.psimsch”” as shown below.
F283
335 Hardwaree elements
used in the circuit
With the RAM Debu ug setting, it is easy to deebug the pro gram and thhere is no neeed to write thhe
program to the flash memory.
1.2 Generating
G Code
C
To generrate code, sellect Simulatte >> Generrate Code. T
The generateed code will be displayedd in a
separate window, as shown below w.
2. CCS
S Setup
The PSIM M generated project is fo
or CCS v3.3,, the Code C
Composer Stuudio from T TI should be vversion
3.3 or hig
gher. If you are using CC
CS v3.3, the project can be opened ddirectly; If using CCS 4 or
higher, you
y need to useu CCS’s Im mport Legacyy v3.3 Projeect function. We use CC CS v5.5 to shhow the
way to lo
oad and debu ocument for the examplee.
ug the prograam in this do
2.1 Im
mport Projeect into CCS
Launch CCS
C v5.5, iff this is the fiirst time you
u load the prooject, you neeed to transffer CCS v3.33 project
to CCS v5.5
v project by b go to Pro oject >> Imp port Legacyy CCSv3.3 P Project. Thee following ddialog
pops up. click on "Brrowse..." buttton to choosse " C:\TI 1--Ch DC-DC\\TI_DC_DC C_Buck_1_chh (C
code)\TI_
_DC_DC_B Buck_1_ch.pjjt" then click k "Next" buttton.
he transformed project w
If there iss no transferr problem, th will be autom
matically loadded. The CC
CS will
appear ass follows:
2.2 Compiling
C Code
C
To comp pile the projeect, right mou use click on the project nname ("TI_D DC_DC_Buck_1_ch") inn the
pane of Project
P Explo orer, then cliick on "Build Project" inn the poppedd up menu. O Or click on thhe
project name in the pane
p of Projeect Explorer to select it aas the currennt project (thhe project namme
changes to
t bold) then n select Projject >> Builld to build thhe project orr Project >> Rebuild Alll to
rebuild th
he whole pro oject). After the compilin ng is compleete, CCS willl display thee following:
- 10 - Poweersim Inc.
www.powersim
mtech.com
Auto
A Code Gen
neration for F
F2833x Targett
Right mo
ouse click on n "User Defiined" in the Target
T Confi
figuration paane then select "New Tarrtget
Configurration" in thee popped up menu. A diaalog displayss as below.
- 11 - Poweersim Inc.
www.powersim
mtech.com
Auto
A Code Gen
neration for F
F2833x Targett
Change the
t file namee as you wannt (here is "F
F2833x", thee file extensioon will be "cccxml"), then click
"Finish" button. A neew pane nam
med "F2833x x.ccxml" dispplays in CCS S as below.
In "Connnection" com
mbo box, cho oose the emuulator you wiill use (for eexample, "Sppectrum Digiital
C2000 XDS510LC
X Emulator"),
E then
t check "TMS320F288335" in thee list box of ""Board of Device".
Click "Saave" button to
t save the configuration
c n.
Back to the
t "Target Configuratio
C ons" pane, rigght mouse cllick on "F28833x.ccxml" configuratioon,
move mo ouse to "Linkk File to Proj
oject" in the popped
p up m
menu, all proojects will bee displayed iin the
sub-menu u. Select "TII_DC_DC_B Buck_1_ch" project, thenn check if "F F2833x.ccxm ml" is added to the
project in
n the "Projecct Explorer" pane. See beelow.
3. Targ
get Hardw
ware Setup
p
Insert TI’s TMS320F
F28335 contrrolCARD in
nto TI’s 2-Chhannel DC/D
DC Buck Coonverter Kit
(TMDSD DCDC2KIT)), as shown below.
b
- 12 - Poweersim Inc.
www.powersim
mtech.com
Auto
A Code Gen
neration for F
F2833x Targett
4. Run
nning Codee in DSP Target
T
4.1 Load
L Code to DSP Targ
get
In CCS, click
c on "TI__DC_DC_B Buck_1_ch" project
p to seet it as the cuurrent projecct (the currennt
project name displayys bold), then n select Runn >> Debug tto connect thhe computerr to the DSP. If the
connectioon is successsful, the prog
gram will bee upload to thhe target, thee F28335 DS SP will
automatically reset annd run to thee start place of main funnction as show wn below.
- 13 - Poweersim Inc.
www.powersim
mtech.com
Auto
A Code Gen
neration for F
F2833x Targett
4.2 Uploading
U Code
C to DSP (Flash Releease Version
n)
There aree 4 configuraation optionss in the geneerated projecct: RamReleaase, RamDebbug, FlashR Release
and FlashhRamReleasse. RamReleease and Ram mDebug uplooad program m to DSP RA AM area; Insttead,
FlashRellease and FlaashRamRelease upload program
p to D
DSP flash memory but F FlashRamRellease
will automatically co opy the progrram to RAM M and all codde will be runn in RAM. T To use a diffferent
configuraation, right mouse
m click on the project name in thhe Project E
Explorer panee, move mouuse to
"Build Configuration ns" in the poppped up men nu and selecct a configuraation you waant as below
w.
4.3 Run
R Code in
n DSP Targeet
To run thhe code in thhe DSP, we can
c use the to oolbar in "D
Debug" pane as shown rigght to resum
me, stop,
step into,, step over an
nd step returrn to run the program.
5. Monitoring Waveform
W s with PSIIM’s DSP Oscilloscope
At the en
nd of Section
ns Error! Reeference souurce not fouund., the codde is runningg in the targeeted
DSP to generate
g a co
onverter outp
put of 3.3V (+/-0.05V).
( N
Now, one maay use PSIM M’s DSP
- 14 - Poweersim Inc.
www.powersim
mtech.com
Auto
A Code Gen
neration for F
F2833x Targett
Set the co
orrect serial port numberr, baud rate, and parity ccheck. They must be idenntical to thesse in the
SCI Conffiguration bllock in the PSIM
P circuit.
Click thee Connect bu utton at the leeft bottom of the scope ppanel. All naames of SCI output and input
variabless will be listeed on the left
ft side of the panel, as shhown below.
- 15 - Poweersim Inc.
www.powersim
mtech.com
Auto
A Code Gen
neration for F
F2833x Targett
6. Cod
de Composer Studio
o Referencces
For furth
her informatiion about thee Texas Instrrument’s Coode Composeer Studio, please refer too the
documen nts in the link
ks below.
- 16 - Poweersim Inc.
www.powersim
mtech.com
Auto
A Code Gen
neration for F
F2833x Targett
CCSv5
C Getting
g Started GuideCCSv5 Getting Started Guide
htttp://processsors.wiki.ti.com/index..php/CCSv55_Getting_S
Started_Guide
- 17 - Poweersim Inc.
www.powersim
mtech.com