Home
PSIM Tutorial - Powersim Inc.
Contents
1. Operation mode Continuous Snap shot m Select output variables All variables Selected variables Vfdbk Reg_out A m Set input variables Whea Timebase scale Variables qr Trigger Variable vok z var vfdbk m Change Background Color M one 7 E Scale 1V Div Pe ee ome Io teva o H V Auto scale Delay o poeme wo o Help oc _ac Gnd Drawing Object 5 Code Composer Studio References For further information about the Texas Instrument s Code Composer Studio please refer to the documents in the links below CCSv5 Getting Started GuideCCSv5 Getting Started Guide http processors wiki ti com index php CCSv5s_Getting_Started_Guide Code Composer Studio Development Tools v3 3 Getting Started Guide http www ti com lit ug spru509h sprus509h pdf IE a Oe Powersim Inc POWERSIM www powersimtech com
2. Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp rere FRSA anma fm mr 30 28 30 28 30 30 30 30 30 30 30 30 30 30 30 30 30 30 Copy Result to Clipboard The dialog window shows that for example the output of the digital filter FILTER_D2 is set to IQ24 and the required setting is Q30 which is more than sufficient in the data range However as an example if the default fixed position is set to IQ29 it will not be sufficient as some of the variables will overflow and others are close to overflow The fixed point range check results are shown below SE nTa Powersim Inc POWERSIM www powersimtech com Auto Code Generation for F2803x Target Fixed Point Range Check DC_Dc Buck 1_ch psimsch The results show that the summer and A D converter outputs will overflow and the digital filter and limiter outputs are close to overflow PSIM s range check function provides a convenient way to handle fixed point positions 1 4 Generating Hardware Code To generate code select Simulate gt gt Generate Code The generated code will be displayed in a separate window as shown below E PSIM C F28035 DC_DC DC_DC Buck 1_ch C code DC_DC Buck 1che File Edit Options Window Help Da Beenaa lv Xl OR eFI AAM e Project View m
3. Hardware Insert the TMS320F28035 controICARD into the 2 Channel DC DC Buck Converter Kit TMDSDCDC2KIT as shown below SE Os Powersim Inc POWERSIM www powersimtech com Auto Code Generation for F2803x Target Connect the JTAG emulator between the J1 connector of the board and one of the computer s USB ports After connecting the power to the board turn on Switches SW1 and SW2 on the board Switch SW3 is for displaying either Chl or Ch2 output Set SW3 to the Ch2 position 3 Loading the Code to Hardware Using CCS Currently project files are generated for CCS v3 3 only For a version higher than v3 3 the project file must be converted 3 1 Connecting Hardware with CCS v5 The Code Composer Studio used in this section is Version 5 1 1 00031 Launch CCS v5 When prompted to select a workspace click the Browse button to create a new folder for the files generated by CCS For this example a new folder named CCS workspace is created inside the F28035 DC_DC folder e Select Project gt gt Import Legacy CCSv3 3 Project Navigate to the folder C F28035 DC DC DC_DC Buck 1_ch C code Select the project file DC_DC Buck 1_ch pjt The CCS Editor will be shown as below q Na 7 _ r lt CCS Edit DC DC Buck eh DC DC Buck 1 che Code Composer Studie Sox File Edit View Navigate Project Run Scripts Window Help roe Sv itv i Pv if im erao FY H CCS Debug EF E Project Explorer 52 g Y 7 OB Dc_D
4. block opens as shown below Simulation Corral Parameters SmCoder Color Simulation Parameters Time Step Total Time Prov Time Load Flag SimCoder Hardware Target Fz303x RamDebug CPU Version F z203580pn Check Fixed Point Range Defaut Feed Pont Poston igm The settings are e Hardware Target set to F2803x and RamDebug RamDebug is selected in this example for easy debugging e CPU Version select F2803 80pin e Check Fixed Point Range check this box to check the fixed point range for overflow e Default Fixed Point Position select IQ20 for this example F 4 ao Powersim Inc POWERSIM www powersimtech com Auto Code Generation for F2803x Target Currently project files can be generated for CCS v3 3 only If one uses a version newer than v3 3 one needs to convert the v3 3 project 1 2 Defining F2803x Target Elements In this circuit there are several F2803x Target library elements All these elements must be properly configured according to the specific target hardware settings e F2803x Hardware Configuration This element defines the I O ports of the F2803x hardware One must Unlock this element to change the designation of the I O port and must Lock it afterwards In this example AQ is designated as an A D input channel for voltage measurement GPIO2 is designated as PWM output GPIO28 and GPIO29 are designated for SCI communication and GPIO39 is
5. fixed point code generation a circuit must contain elements from the F2803x Hardware Target library The library can be accessed by going to Elements gt gt SimCoder gt gt F2803x Target A list of the library is shown below EA 20 Powersim Inc POWERSIM www powersimtech com Auto Code Generation for F2803x Target Elements Simulate Options Utilities Window Help Power gt emer may oe eye S AILIO AE 3 phase PWM Control 2 phase PWM Other l phase PWM Sources d 1 phase PWM phase shift Control Blocks d Single PWM shared with capture Symbols Start PWM Event Control gt Stop PWM SimCoder F2833x Target Trip Zone F2803x Target b Trip Zone State PE Pro F28335 Target A D Converter PE Expert3 Target Digital Input TI DMC Library b z Digital Output Global Vanable Interrupt Comparator Input Comparator Output Comparator DAC SCI Configuration SCI Input SCI Output f Te SPI Configuration lem le A fea fea len fe e Piolo ME elelslelo meld roeie SPI Input 3 SPI Output Capture Capture State Encoder Encoder State Up Down Counter DSP Clock F2803x 80 pin Configuration F2803x 64 pin Configuration F2803x 56 pin Configuration 1 1 Setting Up Simulation Control Before the code is generated SimCoder parameters must be properly set in Simulation Control Double click on the Simulation Control block the clock image and set the parameters of SimCoder the dialog
6. is selected for the digital filter block FILTER_D2 which means that the output of this block will use the fixed point position of I1Q20 as defined in Default Fixed Point Position in Simulation Control SE 4 Powersim Inc POWERSIM www powersimtech com Auto Code Generation for F2803x Target E PSIM CAF28035 DC DC DC DE Buck 1 chifisch a ee File Edit View Design Suites Subcircuit Elements Simulate Options Utilities Window Help EXTRA DERS 2Bo yx ORR SEMIN AQOND MO Project View es Higa PSIM Projets f 7 Digital Filter Parameters Fix Point Color Digital filter FILTER_D2 Default v In fixed point calculation the selection of the fixed point position is an important issue If the fixed point range is too low the variable value may overflow But 1f the fixed point range is too high the calculation resolution will suffer To address this problem PSIM provides the function to check the fixed point range from simulation results and give indication 1f a particular output is close to overflow or already overflow or is too conservative in the fixed point position setting In this example after the simulation the following dialog window will appear Fixed Point Range Check DC_Dc Buck 1_ch psimsch i PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1 Outp PSM_F2803x_ADC1
7. used as a digital output e DSP Clock Specify the DSP clock parameters for this project as follows DSP Clock Source Internal oscillator 1 External Clock MHz 10 DSP Speed MHz 60 e SCI Configuration Specify the I O pins the speed and parity check of the SCI port The output buffer size is determined by the desired waveform resolution and available memory space The SCI communication provides a convenient way to utilize PSIM s DSP Oscilloscope function The DSP Oscilloscope is used to control the buck converter s output voltage and monitor the values inside the DSP The SCI input allows the reference value to be changed by the DSP Oscilloscope in real time and SCI outputs are used to display signals it the DSP Oscilloscope in real time e A D Converter 16 channel Specify the mode and gain of ADC channels For this example Channel AO is in DC mode with a gain of 2 0 e PWM Module single phase Specify the PWM module source the output mode switching frequency and many other settings of a single phase PWM module For further detailed information please refer to the SimCoder User Manual 1 3 Defining Fixed Point Positions In the F2803x Target code Texas Instruments IQmath library is used for fixed point calculation As shown in the figure below each of the non hardware related elements can be set as Default Integer or fixed point with the IQ number from 1 to 30 In this example the Default fixed point position
8. 5 lt aT lt oT lt z gt z 5 lt 5 z P lt gt 37 coos PS ScilInit 28 29 115200 aGblSciOutBuf 128 amp ProcSciInputItem Enter location here ai 2S 2 alri ay main 76408AB1 SEGRE PS _EnableIntr 2918 CLRC PS_EnableDbgm 2920 CLRC CSDWS L _main 2 B C L53 FF69 SPM 764089F2 LCR 6FFD SB LEAC MOVL 4 Initialize E Enable Global interrupt INTM INTM DBGM _ProcSciWaitStart 0 _ProcSciWaitStart C L53 UNC CSDWSL _main 2 E PS_SetDacValue XT ACC A b e DC_DC_Buck_1_ch code j RamDebug DLC_DC_BuUCK_I_ch 0b0 I rtsz600_m1 I10 1 2883x_ Qmath_BootkKOMsymbols 1ib I IQmath Iib I II C a remark 10205 D automatic RTS selection linking in rts28 _ml lib in place warning 10063 D entry point symbol other than _c_int specified of index library libc a code_start Finished building target C F28 35 DC_DC DC_DC Buck 1_ch C code DC_DC_Buck_1_ch RamDebug DC_DC_Buck_1 ch out 3 2 Connecting Hardware with CCS V3 3 Launch CCS v3 3 Setup to create a system configuration for the TMS320F28035 control CARD and proper JTAG emulator Launch CCS v3 3 select the correct system configuration as shown below IE POWERSIM 3 F 28035 XDS100USB TMS320C2800_0 TMS320C28 xx Code Composer Studio Not Connected DC_DC Buck_1_ch c Q Fie Edit View Project Debug GEL Op
9. D3 CSL54 CSDWSLS_mais a A Initialize OO8BD3 FF69 SPM 45 h Include PS_EnableIntr we Enable Global Interrupt INIM OOSBD4 764089FF Libraries PS_EnableDbgm OO8BD6 6FFD SB 5 Source for gt i OO08BD7 PS_SetDacValue C Z 2 DC_DC_Buck j _ProcSciWaitStart OOSBD 7 1EAC fa passwords as SEE OOSBD8 92A4 MOV a F28035_FLASH_Lr 008BD9 B2BD MOVL D A F28035_FLASH_R 008BDA 9CFF ADDB RAM Li OO8BDB 5203 x g cones coeape 8710 T 7 OO8BDD OEA9 OOSBDE 8F009680 ma 008BE0 FF30 J 008BE1 56010044 arning entry point symbol other than _c_int00 specified code_start Build Complete 0 Errors 1 Warnings 1 Remarks HALTED s w breakpoint File C F28035 DC_DC DC_DC Buck 1_ch C code DC_DC_Buck_1_ch c Ln 295 Col 1 Select Debug gt gt Run to run the code Section 4 of this tutorial will demonstrate how to use DSP Oscilloscope to monitor DSP internal variables and to control the converter voltage 4 Monitoring DSP Waveforms with DSP Oscilloscope At the end of Sections 3 1 and 3 2 the code is running in the targeted DSP to generate a converter output of 3 3V 0 05V Now one may use PSIM s DSP Oscilloscope feature to monitor the variables inside the DSP and to control the converter output voltage Connect the SCI port of the hardware target to the computer Launch PSIM Select Utilities gt gt DSP Oscilloscope This will launch the DSP Oscilloscope as shown bel
10. DC Buck 1 ch T an tli type filter text General Resource General DC_DC _ Buck_1 ch i Build Configuration 1 RamDebug Active Manage Configurations 5 Binaries C2000 Compiler inj Includes Processor Options ooo 1_RamDebug Optimization E Main h DC_DC_Buck 1 Debug Options L F28035_RAM_Ln Include Options Output type Executable L F2803x_Headers Advanced Options Er 2803x_IQmath_Bi C2000 Linker Device R PENEN Debug Family C2000 Ky F28035_FLASH_ Gg F28035_FLASH amp Variant lt select or type filter text gt x Tws320F28035 E IQmath lib Ei passworas asn Connection Spectrum Digital C2000 XDS510LC Emulator v applies to whole project v Advanced settings TMS320F28035 c Device endianness little Compiler version T1v6 0 2 ory O Output format Linker command file F28035_RAM_Lnk cmd Runtime support library EASUEIS Restore Defaults Apply vs Unlicensed DC_DC_Buck1_ch Ss The settings are Configuration RamDebug Active Device Family C2000 Device Variant TMS320F28035 Connection Select the correct connection from the list according to the JTAG connection you have In the Advanced settings use the browser to find the file F28035_RAM_Lnk cmd in the folder C F28035 DC_DC DC_DC Buck 1_ch C code Click Apply and then OK e Select Run gt gt Debug The hardware target will be connected and the CCS will displ
11. PSIM Tutorial Auto Code Generation for F2803x Target February 2013 A Powersim Inc POWERSIM www powersimtech com Auto Code Generation for F2803x Target With SimCoder and the F2803x Hardware Target PSIM can automatically generate ready to run code from the control schematic for hardware based on TI F2803x series fixed point DSP This tutorial describes in step by step how to generate code in PSIM compile and upload the code in CodeComposerStudio and run it on the DSP To illustrate the process we use the circuit DC_DC Buck I_ch psimsch as an example This example is located in the sub folder Examples SimCoder F2803x Target TI 1 Ch DC DC with SCT in the PSIM directory To keep the original example unchanged we will copy the whole folder to C F28035 DC DC and use this folder as the working folder in this tutorial 1 Setting Up in PSIM In PSIM load the example schematic file DC_DC Buck I_ch psimsch as shown below Ez PSIM C F28035 DC DC DC_Dc Buck 1_ch psimsch Ea File Edit View Design Suites Subcircuit Elements Simulate Options Utilities Window Help x Jej vix als Aor aleen mnm A v a 100 RRR RRRRREE 3s 4 This example generates the code for the TI 2 Channel DC DC Buck Converter Kit TMDSDCDC2KIT with a Piccolo F28035 controlCARD Only one channel is implemented in this example One can simulate this circuit by selecting Simulate gt gt Run Simulation For
12. _DC DC_Dc Buck 1_ch C code DC_DC_Buck_1_ch c wi Used far degacw GEL amp Graph Debug Ln 1 Colt Powersim Inc www powersimtech com Auto Code Generation for F2803x Target Set Active Configuration to RAM Debug All the program and data will be loaded to the RAM memory To compile the project select Project gt gt Build to build the project or select Project gt gt Rebuild All to rebuild the project Select Debug gt gt Connect to connect the computer to the DSP Go to File gt gt Load Program and locate the out file in this example c F28035 DC DC DC_DC Buck 1_ch C code RamDebug DC_DC_Buck 1_ch out CCS will automatically load the code into the RAM memory Note that the Load Program function works only for the RAM Debug or RAM Release version Select Debug gt gt Reset CPU Then select Debug gt gt Restart and Debug gt gt Go Main The cursor will indicate the beginning of the main program as shown below 4 F 28035 XDS100USB TMS320C2800_0 TMS320C28xx Code Composer Studio File Edit View Project Debug GEL Option Profile Tools DSP BIOS Window Help Agu Ba amp A Ah wh GM Ges wigs CE A amp DC_DC_Buck_1_chpit _ 1_RamDebug amp amp M M plv BEkeAd S H Files aE a mea PS_StartStopPwmClock 1 DO8BCF Ty P 008BCF 76408BSE LCR a DC_DC_Buck_1_ch v 2 Dependent Project OO8BD1 2910 CLRC i Documents void main O08BD2 2920 CLRC P DSPIBIOS Confi 008B
13. ay the Debugger window as shown in the figure below The code is ready to run in targeted DSP hardware e Select Run gt gt Resume to resume the code execution The LED display of the EVM would display the DC DC converter output voltage at 3 3V 0 05V e Section 4 of this tutorial will illustrate how to use DSP Oscilloscope to monitor the DSP internal variables and to control the converter voltage P 4 Or Powersim Inc POWERSIM www powersimtech com File Edit View Project Tools Auto Code Run Scripts Window Help ms Hs DOSC SF ihe He Generation for F2803x Target aye E CCS Debug fe Debug 2 Kren a a E E CSE 0 Variables 3 OL Expressions dior Registers a os k aea o me DC_DC_Buck_1_ch Code Composer Studio Device Debugging gi Spectrum Digital C2000 XDS510LC Emulator C28xx Suspended main at DC_DC_Buck_1_ch c 291 0x008B22 _args_main 0x0093B1 _args_main has only skeletal debug info 2 Spectrum Digital C2000 XDS510LC Emulator CLA_0 Disconnected Unknown Name Type Location DC_DC_Buck1_ch c 3 S Disassembly 2 m m PS_SetPwmPeakOffset 2 1 1 0 1 PS SetPwmIntrType 2 ePwmIntrAdc 1 _1Q24 PS SetPwmVector 2 ePwmIntrAdc Task PS SetPwmTzAct 2 e7ZHighImpedance PS SetPwmRateSH 2 _I024 PS StartPwm 2 Oownwnc PS InitDigitOut 39 Ou amp Wh PS StartStopPwmClock 1 lt 5
14. c_Buck1_ch c X p Expl E DC_DC_Buck_1_ch 5 p r S DC_DC_Buck_1_ch 1 EEE SEE EERE SESS S ESSE EERE eS Seer tree reece Ma Binaries 2 if This code is created by SimCoder Version 10 0 for TI F28 3x F28 6x Hardware Target jh Includes amp 1_RamDebug 5 Lg DC_DC_Buck_1_ch c 6 Date November 28 2012 11 25 59 L a F28035_RAM_Lnk cmd J FEEKAAAAAL AEA AAE ALAA HAHAHA KAKA H LEAK AA KA KEK ES ck amp F2803x_Headers_nonBlOS cmd 8 define GLOBAL_Q 20 si a d E 2803x IQmath_BootROMsymbols tia R ra PE AE NG SEN ee ee ee EE DC_DC_Buck_1_ch pjt 11 include PS_bios h gj F28035_FLASH_Lnk cmd 12 define GetCurTime PS_GetSysTimer gj F28035_FLASH_RAM_Lnk cmd 13 Ee IQmath lib EN passwords asm 4 SimCoder is copyright by Powersim Inc 2009 2012 Bye 3 y ae 16 interrupt void Task Bm PsBiosRamF03xFixpt lib 17 void TaskS1 z PsBiosRomF03xFixpt lib 8 TMS320F28035 ccxml Active 19 2 const Uint16 PSD_CpuClock 60 MHz 21_iq fGblVfdbk 22 long FGb1UDELAY8 25 define Freq 250000 ED Console 3 Problems CDT Build Console DC_DC_Buck_1_ch w Unlicensed y 4 ie Powersim Inc POWERSIM www powersimtech com Auto Code Generation for F2803x Target e Select Project gt gt Properties Set the properties of the project DC_DC_Buck 1_ch as shown below i 1_ch c Code Composer Studio o0 S M SS A Properties for DC
15. ess f B a E DC_DC Buck 1_ch F DC_DC Buck 1_ch psimsch sf SL Sub_PTDO8A0LOW psims S E Graphs ja O GPI039 EAA S bo fURRRRT AAA TTAAATTAAAT LAAT TAAAATTALATAAATTAATAT ALTA TAATTTALTTLeTTTLTLTTeLTTTLrTITt ol SLL ee E j This code is created by SimCoder Version 10 0 for TI F2803x F2806x Hardware Target ie Jol k Tout O PWM Vfdbk i Vol Ea C F28035 DC_DC DC_DC Buck 1_ch psimsch 2 1 DC DC Buck Converter Channel SimCoder is copyright by Powersim Inc 2009 2012 fi ji Date November 27 2012 21 26 15 fe et ESTUT x 1 interrupt void Task void TaskSl 0 J const Uintl 6 PSD_CpuClock 60 MHz i fGbIVfdbk 0 fGbIUDELAYS8 0 define Freq 250000 define Vrefl PST_Bufitem aGbiSciOutBuf 1 28 PST_Data aGbliScilnValue 1 _1Q20 3 3 Uintl 6 aGbliSciOutAllow 2 0 0 PSIM will create a subfolder in the same folder as the PSIM circuit file and is named the same as the PSIM circuit but with C code added at the end For this project this subfolder is C F28035 DC_DC DC_DC Buck 1_ch C code In addition to the C code file PSIM also generates project files link command files as well as all other files necessary for four different project building configurations RAM Debug RAM Release Flash Release and Flash RAM Release All these files are stored in the newly created subfolder C F28035 DC_DC DC_DC Buck 1_ch C code 2 Setting Up
16. ow 10 Powersim Inc POWERSIM www powersimtech com Auto Code Generation for F2803x Target m Select output variables All variables Selected variables Ee Set input variables UpdateAll ____Update all m Timebase scale Variables Variable a i Change Background ieee Color Offset I Auto scale pe ac Gnd e Set the correct serial port number baud rate and parity check They must be identical to these in the SCI Configuration block in the PSIM circuit e Click the Connect button at the left bottom of the scope panel All names of SCI output and input variables will be listed on the left side of the panel as shown below The two variables available for monitoring are Vfdbk and Ref_out Select the variables to display on the scope screen ile Powersim Inc POWERSIM www powersimtech com Auto Code Generation for F2803x Target To change the DC DC converter output voltage modify the value Vref to 2 and click the Update button The LED display of the converter board will change to the new value The figure below shows the waveforms with the new value of Vref J Bike a E PSIM CAF28035 DC_DC DC_DC Buck 1_ch psimsch i File Edit View Subcircuit Elements Simulate Options Utilities Window Help EXTRA pOee Steen al v XK ORR E MY F28335 Data Port settings Serial port 10 Ales Test Baud rate 115200 Parity check None v
17. tion Profile Tools DSP BIOS Window Help J R Ae wa Sw se 1_RamDebug 7 lt Q GEL files E f28035 gel Projects aaj DC_DC_Buck_1_ch pjt 1_RamD Dependent Projects Documents C3 DSP BIOS Config C Generated Files Include Libraries H E Source E DC_DC_Buck_1_ch c passwords asm F28035_FLASH_Lnk cmd sa F28035_FLASH_RAM_Lnk cmd F28035_RAM_Lnk cmd F2803x_Headers_nonBIOS cmd _ Z x D l a oI id A H EEKE ZI EAFF M A Dde eo Go to Project gt gt Open Navigate to the folder c F28035 DC DC DC_DC Buck 1_ch C code Select the project file DC_DC Buck 1_ch pjt The CCS window will appear DER x FETE TE TE BFF BIE BPI BB I BB TE BBB BIB BBB BBB BBB BBB BBB BBB BBB BEB BEBE wi This code is created Aw SimCoder Version ft t far TI FeeeIs FLae SamCoder is copyright by Fowersim TBc 2009 2012 ve Bates November 28 2012 2172240 22 FPP BBB BBB BB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BB BEB BBB BEE EE EB BEBE EEE EER define GLOBAL_Q 20 long GlobalQ GLOBAL_Q include TQmathLib h include PS bios h define GetCurTime PS_GetSysTimer interrupt void Task void TaskS1 const Uintl6 PSD_CpuClock ig fGblVfdbk 0 long fFGbhlUDELAYS 60 D define Freq 250000 define Vrefl Bie PST_BufItem aGbhlSciOutBuf 128 PST_Data aGhlScilInValue 1 _IQ20 3 3 File C F28035 DC
Download Pdf Manuals
Related Search
Related Contents
Source Four HID PARTM CE User Guide INSTRUCTION MANUAL Digital Set Top Box Guía del usuario DS-820W / DS-920DW USER`S MANUAL フッ化ジルコニウムカリウム Epson EH-TW490 Princess 242000 coffee maker Fujitsu Intel Xeon E5504 Copyright © All rights reserved.
Failed to retrieve file