Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not...

63
1 Version 9.0 New Features/Errata Products VisSim VisSim/Analyze VisSim/ECD VisSim/State Charts

Transcript of Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not...

Page 1: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

1

Version 9.0 New Features/Errata

Products

VisSim

VisSim/Analyze

VisSim/ECD

VisSim/State Charts

Page 2: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

2

Contents VisSim ............................................................................................................................................................ 8

Working with blocks > Inserting blocks .................................................................................................... 8

Working with blocks > Editing blocks > Finding and replacing blocks > Finding blocks ........................... 8

Managing block diagrams > Linking to Requirements Documents........................................................... 9

Working with Other Applications > Using Look-Up Tables ..................................................................... 10

Working with Other Applications > Managing Block Diagrams > Embedding Block Diagrams .............. 10

Working with Other Applications > Saving Block Diagrams > The Save Embedded commands ............ 10

Blocks ...................................................................................................................................................... 11

Boolean Relational blocks ................................................................................................................... 11

Buffer .................................................................................................................................................. 11

Comment ............................................................................................................................................ 11

Compound block ................................................................................................................................. 12

Conditional Flow blocks ...................................................................................................................... 12

Const ................................................................................................................................................... 12

CRC-16 ................................................................................................................................................. 12

DelayedSwitch ..................................................................................................................................... 13

DialogConstant .................................................................................................................................... 13

Dynamic Limit...................................................................................................................................... 14

Embed ................................................................................................................................................. 14

Gain ..................................................................................................................................................... 14

Histogram ............................................................................................................................................ 15

Import ................................................................................................................................................. 15

Ln block ............................................................................................................................................... 15

Page 3: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

3

Map ..................................................................................................................................................... 15

Plot ...................................................................................................................................................... 15

polarPlot .............................................................................................................................................. 16

Plot3D .................................................................................................................................................. 20

Polyfit .................................................................................................................................................. 20

Rate Limiter ......................................................................................................................................... 21

sampleHold ......................................................................................................................................... 21

stripChart ............................................................................................................................................ 21

scalarToVec ......................................................................................................................................... 22

stop ..................................................................................................................................................... 22

unitDelay ............................................................................................................................................. 24

variable block ...................................................................................................................................... 24

vectorToScaler block ........................................................................................................................... 24

Toolbar .................................................................................................................................................... 24

Other ....................................................................................................................................................... 24

Block Types.......................................................................................................................................... 25

VisSim/ECD .................................................................................................................................................. 25

Quickstart > Compiling the Source Diagram ........................................................................................... 25

Performing Model-Based Development > Creating an Embedded Algorithm > Using the Code Gen

dialog box ................................................................................................................................................ 26

Using the Target Support blocks and commands > Using the Target Support blocks ............................ 27

Using the Target Support Blocks ............................................................................................................. 27

aio in .................................................................................................................................................... 27

aio out ................................................................................................................................................. 28

analogComparatorDAC ....................................................................................................................... 28

Page 4: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

4

analogInput for Cortex M3 .................................................................................................................. 29

Analog in ............................................................................................................................................. 30

CANreceive block ................................................................................................................................ 30

CANtransmit block .............................................................................................................................. 31

DAC ...................................................................................................................................................... 32

Digital Input ......................................................................................................................................... 32

Digital Output block ............................................................................................................................ 33

DMA enable ........................................................................................................................................ 34

eCapPWM ........................................................................................................................................... 34

ePWM ................................................................................................................................................. 35

eQEP .................................................................................................................................................... 36

ExternDefinition block ........................................................................................................................ 36

ExternFunction block .......................................................................................................................... 37

externRead .......................................................................................................................................... 37

externWrite ......................................................................................................................................... 38

EventCapture ...................................................................................................................................... 38

fullCompareAction .............................................................................................................................. 38

fullComparePWM................................................................................................................................ 39

GPIO in ................................................................................................................................................ 39

GPIO out .............................................................................................................................................. 39

getCpuUsage ....................................................................................................................................... 40

I2C Read Buffer ................................................................................................................................... 40

I2C Start Communication .................................................................................................................... 40

I2C Write Buffer .................................................................................................................................. 41

monitorBufferEmpty ........................................................................................................................... 41

Page 5: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

5

monitorBufferRead ............................................................................................................................. 41

monitorBufferWrite ............................................................................................................................ 41

PWM block for C2407, C24X, Cortex M3, Delfino, F28XX, and Piccolo .............................................. 41

QuadratureEncoder for C2407, C24X, Cortex M3, and F281x ............................................................ 41

QuadratureEncoder for MSP430 ........................................................................................................ 41

readTargetMemory ............................................................................................................................. 42

Serial UART Read (was serialPortRead) .............................................................................................. 42

Serial UART Write (was serialPortWrite) ............................................................................................ 43

SPIread ................................................................................................................................................ 43

SPIwrite ............................................................................................................................................... 43

targetInterface block........................................................................................................................... 43

USB Read ............................................................................................................................................. 44

USB Write ............................................................................................................................................ 44

Web Server .......................................................................................................................................... 45

Microchip dspPic32 support ............................................................................................................... 46

Concerto c28 M1 ECC boot error ........................................................................................................ 46

Save minimize RAM usage state to file ............................................................................................... 46

Fix Point fft .......................................................................................................................................... 46

Using the Config blocks and commands ................................................................................................. 46

Using the ADC Config commands ....................................................................................................... 46

Using the ARM Cortex M3 Config block .............................................................................................. 47

Using the CAN Config command ......................................................................................................... 49

Using the DMA Config command ........................................................................................................ 50

F28x Config command – it needs to be removed from C24 menu; doesn’t belong here................... 51

Using the GPIO Mux Config block ....................................................................................................... 51

Page 6: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

6

I2C Config command for Cortex M3, Delfino, F28XX, and Piccolo ..................................................... 52

Using the F28x Config block for the Delfino, F280x, and Piccolo........................................................ 53

Using the F28x Config block for the F281x ......................................................................................... 54

Using the Serial UART Config command ............................................................................................. 55

SPI Config command ........................................................................................................................... 55

USB Config ........................................................................................................................................... 56

Using the TI MotorWare Blocks .............................................................................................................. 57

Angle Estimator ............................................................................................................................... 57

Controller Read Property ................................................................................................................ 58

Controller Write Property ............................................................................................................... 58

Estimator Read Property ................................................................................................................. 59

Estimator Write Property ................................................................................................................ 59

Motor Control ................................................................................................................................. 60

Config block for F28069 ...................................................................................................................... 61

Using the Target Commands ................................................................................................................... 61

Using the Download Command .......................................................................................................... 61

Using the TI DMC Block Set ..................................................................................................................... 61

Ramp Generator block ........................................................................................................................ 61

Resolver Decoder block ...................................................................................................................... 61

VisSim/Analyze ............................................................................................................................................ 61

VisSim/State Charts..................................................................................................................................... 61

Trigger block ............................................................................................................................................ 61

Floating Debug Window .......................................................................................................................... 61

Watch State Chart Variables ................................................................................................................... 61

Duplicate or Perhaps Unnecessary ............................................................................................................. 62

Page 7: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

7

CRC block: new – not sure what target it goes under ........................................................................ 62

CANreceive block ................................................................................................................................ 62

Page 8: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

8

VisSim

Working with blocks > Inserting blocks

To find and insert a block from the Blocks Browser

1. Place the cursor in the Find toolbar text box.

2. Start to type the block name. As you type, a corresponding list of blocks appears in the drop

down menu.

3. Do one of the following:

Double-click on the block name from the list of blocks.

Finish typing out the block name and then click on the Insert toolbar button .

4. A shimmering rectangular box appears with the pointer anchored to the upper left-hand corner

of the box.

5. Point to the location in the diagram where you want to insert the block and click the mouse.

Working with blocks > Editing blocks > Finding and replacing blocks >

Finding blocks

You can find blocks with the Edit > Find command or with the Find toolbar button.

When you choose the Edit > Find command, VisSim displays a dialog box you can use to search for a

block, block label, text string, or variable in the diagram. You can also use it to search for blocks in the

Blocks Browser.

<need new dialog box. Get rid of “VisSim” in last entry in dialog box>

<10/1/2014: Andy is changing how Find/Replace works. Need latest build.>

Page 9: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

9

To find a block in the Blocks Browser with Edit > Find

New parameter: In the Find What box, enter the name of the block you want to find; then activate the

Search in VisSim Browser Tree and click the Find Next button.

To find a block in the Blocks Browser with the Find toolbar button

1. Place the cursor in the Find toolbar text box.

2. Start to type the block name. As you type, a list of blocks appears in the drop down menu.

3. Type out the full block name.

4. Click on the Find toolbar button .

The selected block is highlighted in the Blocks Browser.

Managing block diagrams > Linking to Requirements Documents

You can navigate from a VisSim model to a corresponding Requirements Document by adding a

requirements traceability link to the VisSim model.

To create a traceability link from a Microsoft Office-compatible document

1. Go to the Requirements Document. The document can be any Microsoft Office-compatible

document, such as a Word document, an Excel spreadsheet, or a Powerpoint presentation.

2. Select the text to which VisSim will link.

3. Select the Edit > Copy command.

4. Go to VisSim.

Page 10: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

10

5. Click the Edit > Paste Link command.

A label block is inserted into the VisSim diagram that contains the link information, including the path to

the linked Requirements Document and whether the link is active.

Working with Other Applications > Using Look-Up Tables

VisSim supports 1D, 2D and 3D lookup tables using the map block.

You can use floating point or fixed point values as input. If you index in with fixed-point, VisSim

automatically converts to fixed-point with optimal scaling. You always enter the table data in floating

point.

You can find an example under Diagrams > Examples > Blocks > Nonlinear > {map1D, map2D, map3D}

Working with Other Applications > Managing Block Diagrams >

Embedding Block Diagrams

New text: When you embed a block diagram, a read-only version of the diagram is inserted into the

destination diagram along with a link to the source diagram. You can drill into the embedded diagram

just as you would a compound block. You can even override the read-only status of the embedded

diagram and make changes directly to it. These changes, however, are not saved until you execute the

File > Save Embedded command <ADD CROSS-REFERENCE TO “Working with Other Applications > Saving

Block Diagrams > The Save Embedded commands.”>

To embed a block diagram

New text in step 4: You can alternatively enter a path alias in the filename in the following format:

$(path-alias)

You define path aliases using the Edit > Preferences command. <THIS COMMAND CROSS-REFERENCES

TO “Working with Blocks > Specifying Block Parameters > Using Path Aliases to Reference Files.”>

Working with Other Applications > Saving Block Diagrams > The Save

Embedded commands

You have two options: If the diagram contains one or more embedded diagrams, any changes you make

to those diagrams are not saved until you do one of the following:

Save Embedded Blocks to Source Files: Saves the changes back to the source diagrams.

Save as a Single Combined File: Saves the changes to the current diagram only. The link between the

embedded blocks and source diagrams is broken.

Page 11: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

11

Blocks

Boolean Relational blocks

(>,<.>=,<=,==,!=) work with matrix operands and produce a result matrix of 0's and 1's.

Buffer

Block Category: Matrix Operations

Add Input Trigger: Block runs if trigger input is true (1) and does nothing if false (0).

Add “Buffer Full” Output Pin: Adds an output pin that goes high when the buffer is full.

Use Circular Buffer: When activated, the buffer block performs full buffer chunks at a time. It starts

writing at the far end of the buffer and finishes at the first element. If you also activated the Add “Buffer

Full” Output Pin, then a flag is set indicating the buffer is ready.

Reverse Buffer: It reverses the order of elements in the buffer. Instead of newest to oldest they are

ordered oldest to newest.

Comment

Block Category: Annotation

When a comment exceeds the size of the block, a horizontal scroll bar appears on the right side of the

block to allow you to scroll through the text.

Page 12: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

12

Compound block

Create buttons for compound dialogs: new parameter

auto vars in compound blocks

Expand $var macros in compound name

Expand vars in compound name

Expression evaluation in dialogConstant

Conditional Flow blocks

Not part of v9

Const

Block Category: Signal Producer

You can edit the constant value by double clicking on the constant block and then entering a new value.

CRC-16

Block Category: Fixed Point

The CRC block performs a cyclic redundancy check (CRC) on the data and compares the resulting

checksum with the appended checksum. The CRC block lets you select the CRC method and whether

the result is available via an output pin.

The CRC block has three inputs:

enable: Must be 1 in order for the block to read "newVal" and apply it to existing CRC value.

reset: If it goes to 1, the internal CRC value is zeroed.

newVal: new value to be applied to internal CRC value.

Page 13: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

13

CRC Output Pin: Current 16-bit CRC value

CRC Type: Indicates the CRC method. Choose among CCITT, ANSI, and DECT. These methods are

described at http://en.wikipedia.org/wiki/Cyclic_redundancy_check

Initial CRC Value (hex): Initial 16-bit CRC seed

Unit: Each unit maintains an internal CRC buffer. If you need multiple concurrent CRC streams, make

sure each one has a unique unit number.

DelayedSwitch

Block Category: Nonlinear

No new feature yet.

DialogConstant

Block Category: Signal Producer

A dialogConstant block is the only type of block that can appear in an Auto Dialog dialog box. A

dialogConstant block has three properties — a name, a graphical element type, and a value — that

control how the dialogConstant block is presented in the Auto Dialog box.

You can have multiple dialogConstant blocks with different graphical element types within a single Auto

Dialog dialog box. VisSim automatically adjusts the size of the Auto Dialog dialog box to accommodate

all the dialogConstants

Graphical Element Type Resulting Data Type How the Data is Displayed

Integer List Integer Creates a drop-down list box. To create entries into the list box, enter them in the Value text box, as described below.

Double Double precision floating point

Creates an editable text box in which numeric values can be entered. To create an entry in

Page 14: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

14

the text box, enter it in the Value text box, as described below.

String String Creates an editable text box in which text can be entered. To create an entry in the text box, enter it in the Value text box, as described below.

Label None None

Value

If the Graphical Element Type is Enter

Boolean 1: puts it in a checked state; 0: puts it in an unchecked state.

Label Nothing

String Text string

Dynamic Limit

Block Category:

Not yet added.

Embed

New save methods and $file expansion described in earlier sections – DONE.

Error

Block Category: Signal Consumer

New dialog box

Pop-Up Message: Specfies a message that pops up on the screen when the error block flags an error in

the simulation.

Include Link to this block: When activated, a link appears in the pop up message that lets you go to the

error block that flagged the error. This is particularly useful when you have multiple error blocks in your

diagram.

Gain

Block Category: Signal Producer

You can edit the value by double clicking on the gain block and then entering a new value.

Page 15: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

15

Histogram

Block Category: Signal Consumer

Not yet added.

Import

Block Category: Signal Producer

New Parameter

Start Column:

Start Row: In a multi-row file, points to where the import data (numbers) start. The Use First Row As Pin

Labels should be disconnected from the Start Row control.

<<Mike Borrello has this problem: I’m using the import block to bring 24 columns of data into VisSim

and using the “Use First Row as Pin Labels” to label the pins. But only get labels if I set the “Start Row” to

1 – which indeed is where the labels are. But my data starts on row 3 –row 2 has some header junk I just

want to ignore.

So if I set Start Row to 3 I get that row of numbers as the pin labels.

See the problem? – not the first time this has been an issue.

I believe “Start Row” should be pointing to where the import data (numbers) start. “Use First Row As Pin

Labels” should be disconnected from the “Start Row” control.

What do you think? PAD agrees.>>

Ln block

Accepts matrix input

Map

Block Category: Nonlinear

Additional text: You can use floating point or fixed point values as input to the map block. If you index in

with fixed-point, VisSim automatically converts to fixed-point with optimal scaling. You always enter the

table data in floating point.

Plot

Block Category: Signal Consumer

Page 16: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

16

Equation: plot = X1…X8

Plot Options tab

Geometric Markers: Overlays signal traces with geometric markers. Marker Count: Determines the number of markers overlaid on each signal trace. By default, VisSim overlays each data point in a signal trace with a marker; however, if this is not satisfactory, you can enter a new number in the Marker Count box. A -1 in this box indicates all data points have markers associated with them.

Plot Axis tab

2 Axis: Enables right side plot axis. You can then select Axis 1 or Axis 2. The 2 Axis checkbox is available

only if the Sub Plot Count parameter is set to 1.

Uniform Subplot Scales: Controls whether subplots are uniformly scaled.

Double buffer plots for smoother, faster repaint

Update plot in background thread hrcap

polarPlot

Block Category: Signal Consumer

Equation: polar plot = X1Y1,X2Y2…

Takes theta and r pairs and, in turn, displays pairs of inputs in either a locus or vector format

maintaining an orthogonal aspect ratio. You can customize the plot and control how data is displayed.

Memory Usage: The polarPlot block uses eight bytes per data point of RAM. If you are running a long

simulation at a small step size, it is possible to exceed your RAM limit. For example, a simulation with a

step size of 0.005 and duration of 32236 would require 6.4 million points of data per plot trace. At eight

bytes per point, each plot trace uses 51MB of RAM. If you used all eight traces on a polarPlot block, you

would exceed 412MB of RAM.

Page 17: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

17

Polar Plot Options tab

Polar Type:

Curve: Plots a trace of the signal.

Compass: Plots vector arrows emanating from the origin.

You can select both Curve and Compass to plot both the signal trace and the vector.

Input Type: Lets you choose between Polar Coordinates (distance-angle) and Cartesian Coordinates (X-

Y) for the inputs. If you select Polar Coordinates, you can express the angle in Radians or Degrees.

Grid:

Coordinate Grid: Lets you choose between Polar and Cartesian grids.

Angular Coordinates: Lets you choose between radians and degrees.

Show Axis: Displays the axis upon which the polar plot is drawn.

Show Grid Lines: Displays polar grid lines.

Page 18: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

18

Fixed Radial Bounds: Specifies the region of the polar plot you want to view by letting you select the

radial plotting bounds. When Fixed Radial Bounds is activated, VisSim uses the value for the Upper

Bound parameter as the radial boundary.

Max Plotted Points: Determines the smoothness and accuracy of the polar plot. The more data points you plot, the smoother and more accurate the plot. However, increasing the number of plotted data points also increases the time it takes to print and display the plot. Entering 0 plots every data point. The maximum number of data points that can be plotted is 250 million. If you know the maximum number of data points you want plotted in all your plots, you can set it as the default, as described under Setting simulation defaults." Actual Point Count: Displays the number of data points plotted.

Polar Plot Appearance tab

Block Title: Provides a name for your polar plot. Titles can be up to 80 alphanumeric characters and appear title bar in the top area of the polar plot. By default, polar plots are titled Polar Plot. Block Color: Click on Foreground to color the axis labels and scaling text; click on Background to color the plotting area. Activate the Override Default Colors to override the color specified in the View > Colors command.

Page 19: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

19

Trace / Color: Lets you specify a color for the input pin and corresponding signal trace in the polar plot.

Examples

Curve plot

Compass polar plot

Page 20: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

20

Curve and compass polar plot

Plot3D

Block Category: Signal Consumer

MB autorate

Rescaling for plot3D

Polyfit

Block Category: Matrix Operation

Regarding the polyfit block – the X and Y input and Coeffs output pins are clearly defined and

understood, but neither of the “Signal In” nor “Signal Out” pins are defined in either the help or user

guide and its not clear what they are for. I played around with it a little bit and at least for a linear

model the Signal Out appears to be giving me the bias (offset) estimate.

Answer: You can think of poly fit and spline fit as fancy table lookups. "Signal in" is the x input, y is the

output. Attached is an example with a ramp as input to sweep through the mapping. We obviously need

to doc this better.

Page 21: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

21

See attached example. See email dated 7/1/2013 for example

Rate Limiter

Block Category: Fixed Point

Not yet added. It’s been made but not added to build

sampleHold

Block Category: Fixed Point

The equation is incorrect. It should be:

stripChart

Block Category: Signal Consumer

Traces

Page 22: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

22

Trace, Color, Marker: Specifies a color and geometric marker for each signal trace.

scalarToVec

Block Category: Annotation

Cols: Indicates the number of columns in the corresponding matrix.

Rows: Indicates the number of rows in the corresponding matrix.

No Pin Labels: Indicates whether the input pins are labeled with the corresponding row and column in

the matrix.

stop

Block Category: Signal Consumer

You can insert a custom message that pops up when the simulation halts

Page 23: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

23

Pop-Up Messsage: Specifies the message that is to pop up when the simulation halts.

Include Link to this Block: Includes a link back to the stop block.

Example

When the input to the stop block is one, the simulation stops and displays the above message with a link

back to the stop block. Below is the message that appears when the simulation halts:

Page 24: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

24

unitDelay

Block Category: Time Delay

variable block

Block Category: Annotation

You can edit the variable name by double clicking on the variable block and then entering a new name.

$isCodeGen: It returns TRUE (1) if the diagram is being code generated, and FALSE (0) if simulated.

vectorToScaler block

Block Category: Annotation

Cols: Indicates the number of columns in the corresponding matrix.

Rows: Indicates the number of rows in the corresponding matrix.

No Pin Labels: Indicates whether the input pins are labeled with the corresponding row and column in

the matrix.

Toolbar

Allow embedded menu items in user toolbar

Other

Reset 1/Z trig and value

Qnx remote I/O

Group blocks

Add color to blocks

Error control panel

Page 25: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

25

Block Types

This goes in VisSim UG and ECD UG

I understand that the Delfino F28335 has a floating point unit inside. In the VisSim menu, under "Blocks", there's only fixed point math functions available for an embedded target. How can I use floating point math with the 28335 as the target?

Aside from the fixed-point blocks, VisSim blocks can be floating-point, matrix, string or integer. You can

use all blocks on either a fixed point MCU or a floating point MCU. It's just that floating point blocks will

run pretty slowly on a fixed-point MCU. If you turn on menu item View > Data Types, the block connectors

will be colored by data type:

Type Color

floating-point red

matrix purple

integer green

string blue

fixed-point/scaled-integer yellow

So if you see any red or purple in your diagram, you can rest easy knowing you are using the FPU on

your MCU.

For example, if you use the Blocks -> Arithmetic -> multiplier block, it will generate a floating point multiply

regardless of the input type. Even if you use fixed-point inputs, they will be converted to floating point,

then multiplied in floating point.

VisSim/ECD

Quickstart > Compiling the Source Diagram

Step 2 has new Code Generation dialog box.

Page 26: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

26

Performing Model-Based Development > Creating an Embedded Algorithm

> Using the Code Gen dialog box

New dialog box

Optimization Level: Specifies an optimization level between 0 and 4. For least optimal, specify 0. During

initial development, keep the optimization level low; as you near completion, increase the optimization

level.

Subtarget (set in the target Config…): This is a read-only parameter. It indicates the subtarget name

specified in the target Configuration dialog box (cross reference to Using the Config commands)

Page 27: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

27

Using the Target Support blocks and commands > Using the Target

Support blocks

Add the following to the bullet list:

CortexM3

TI MotorWare

Using the Target Support Blocks

aio in

Target Category: Piccolo

The aio in block inputs digital or analog data to the diagram.

Title: Indicates the channel title.

Channel: Indicates the channel number.

Type: Indicates whether the channel is analog or digital. For digital channels, you can specify the offset

and the port, as well as the bit width.

Page 28: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

28

aio out

The aio out block receives digital or analog data.

Target Category: Piccolo

Title: Indicates the channel title.

Channel: Indicates the channel number.

Type: Indicates whether the channel is analog or digital. For digital channels, you can specify the offset

and the port, as well as the bit width.

analogComparatorDAC

Target Category: Piccolo

Unit: Indicates the comparator unit.

Invert Output: Controls whether the output is inverted.

Put COMPxOUT on block pin: Indicates that the results of the comparator can be put on a pin.

Page 29: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

29

Input A: Indicates the voltage to be compared on input A. The voltage must be the same as what is

presented on ADCINA2.

Input B: Indicates the voltage to be compared on input b. The voltage must be the same as what is

presented on internal DAC.

Output Synchronization: Indicates how often the compactor results are updated and how long the

comparator results must be consistent before a change occurs.

Drive DAC with Ramp: If input B is selected to be internal DAC, then you can change Drive DAC with

ramp.

Ramp Sync Source: Indicates when the ramp goes back to 0 for synchronization.

Mux Pins: Selects the pin that a given function is on.

DOES THE FOLLOWING ALSO PERTAIN TO DELFINO: Certain parts have different functions for the same

physical pin on the chip. This is because pins are expensive. Sharing time or space is called multiplexing,

or muxing, for short. Because multiple functions compete for a given pin, you must choose what

function a pin has. For flexibility, in some cases TI has provided multiple possible pins for a given

function. For instance, the CANTXB function can be on pin 8, 12, or 16. Pin 8 is shared with ePWM5A and

ADCSOCA0, pin 12 is shared with TZ1 and SPISIMOB, pin16 is shared with SPISIMOA and TZ5. So if you

want ePWM5A on a pin, then you cannot use pin 8 for CANTXB and rather must use 12 or 16 instead.

analogInput for Cortex M3

Target Category: Cortex M3

Title: Indicates the channel title.

Channel: Indicates the channel number.

Type: Indicates whether the channel is analog or digital. For digital channels, you can specify the offset

and the port, as well as the bit width.

Page 30: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

30

Analog in

Target Categories: C2407, CortexM3, Delfino, F28XX, and Piccolo

Block Category: Sim

Description: The analog in block receives analog data.

Simulated Analog Channel: Indicates the analog channel to be simulated.

CANreceive block

Target Category: C2407, C24X, CortexM3, Delfino, F280X, F28XX, and Piccolo

New Paramenters

Data Pins: Controls the number of 2-byte integers to be received.

Data Pin Configuration

Pin: Indicates the pin to be configured.

Type: Specifies the data type. The Scaled_Int data type is 16- or 32-bit, depending on word size,

which is specified separately.

Page 31: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

31

Radix Point: Sets the binary point.

Word Size: Specifies the word size in bits.

Byte Offset into CAN Package: Specifies the byte offset into the 8-byte packet. Offset 0 starts with

the first element in the packet.

CANtransmit block

Target Category: C2407, C24X, CortexM3, Delfino, F280X, F28XX, and Piccolo

New Paramenters

Data Pins: Controls the number of 2-byte integers to be transmitted.

Data Pin Configuration

Pin: Indicates the pin to be configured.

Type: Specifies the data type. The Scaled_Int data type is 16- or 32-bit, depending on word size,

which is specified separately.

Radix Point: Sets the binary point.

Word Size: Specifies the word size in bits.

Page 32: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

32

Byte Offset into CAN Package: Specifies the byte offset into the 8-byte packet. Offset 0 starts with

the first element in the packet.

DAC

Target Category: F280x, Piccolo

Description: Performs digital to analog conversions.

<Still lots of issues with this block. Recheck with Peter for updates>

Unit: Specifies the unit.

Output Pin: Specifies the output pin.

Sync Update: <Unclear if this parameter is staying>. Lets you specify the sync source. <For 377 only???>

Sync Source: < Unclear if this parameter is staying>. Determines which PWMSYNC will cause the DAC

block input to be presented on the hardware . <For 377 only???>

Gain: Selects the output gain with respect to the reference voltage. <For 377 only???>

Voltage Reference: Chooses the ???

Digital Input

Target Category: CortexM3, MSP430

The digital in block receives digital data.

For more information on using digital in for hardware-in-the-loop simulation, see Performing hardware-

in-the-loop simulations.

Page 33: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

33

Bit Width: Specifies the bit width.

Offset: Specifies the offset.

Pin Function: Specifies the pin function.

Port: Specifies the port.

Pull Up/Down Current: Lets the specified pin draw current in ON or OFF mode. It is typically used for

communications protocols, like I2C.

Title: Indicates the channel title.

Digital Output block

Target Category: CortexM3, MSP430

The digital output block writes digital data.

For more information on using digital output for hardware-in-the-loop simulation, see Performing

hardware-in-the-loop simulations.

Bit Width: Specifies the bit width.

Page 34: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

34

Offset: Specifies the offset.

Pin Function: Specifies the pin function.

Port: Specifies the port.

Pull Up/Down Current: Lets the specified pin draw current in ON or OFF mode. It is typically used for

communications protocols, like I2C.

Title: Indicates the channel title.

DMA enable

Targets: Delfino, F28XX, and Piccolo

The DMA enable block lets you turn Direct Memory Access (DMA) on and off. DMA enable writes or

reads data to memory automatically while the CPU is performing other tasks.

DMA Channel: Specifies the channel.

eCapPWM

New Parameters

Page 35: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

35

Sync-Out: Each eCapPWM block is potentially linked to the next highest one. The link is via a

synchronization pulse to load the counter with the contents of the CTRPHS phase register. The pulse can

either be passed through the previous unit or generated when the counter equals the period (PRD).

Change Phase Dynamically: Changes the phase dynamically.

CTRPHS (phase): The phase register is loaded into the counter register when a synchronization pulse is

received from the prior unit. The phase register can be continuously updated if desired.

ePWM

New Parameter

Deadband

Page 36: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

36

Input Select: There are two inputs to the Deadband unit: PWMA and PWMB. These two inputs are

DbA and DbB. They can be driven by any combination of PWMA and PWMB.

eQEP

New Parameter

Angle Offset Pin: Is this parameter staying???

ExternDefinition block

Target Category: C2407, C24X, Delfino, F280X, F28XX, and Piccolo

The ExternDefinition block lets you supply any data structure definition with initializers. This block is

useful for pre-defining DMA waveforms.

Page 37: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

37

External Name:

ExternFunction block

Target Category: C2407, C24X, CortexM3, Delfino, F280X, F28XX, and Piccolo

New parameter

Do not declare function: It prevents the code generator from creating a declaration for the function.

This is useful if the function is already declared in a header file.

externRead

Target Category: C2407, C24X, CortexM3, Delfino, F280X, F28XX, MSP430, and Piccolo

Page 38: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

38

New Parameter

Assign Address: For MSP430 target only.

Declare This Variable:

externWrite

Target Category: C2407, C24X, CortexM3, Delfino, F280X, F28XX, MSP430, and Piccolo

New Parameters

Assign Address: For MSP430 target only.

Declare This Variable:

EventCapture

Target Categories: C2407, C24X, F281X, and MSP430

fullCompareAction

Target Categories: C2407, C24X, and F281X

Page 39: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

39

Add the text “Not for CortexM3, Delfino, F280x, MSP430, and Piccolo.

fullComparePWM

Target Categories: C2407, C24X, and F281X

Add the text “Not for CortexM3, Delfino, F280x, MSP430, Piccolo.

GPIO in

Target Categories: C2407, CortexM3, Delfino, F28XX, and Piccolo

Block Category: Sim

Description:

Bit Width: Specifies the bit width.

Offset: Specifies the offset.

Pin Function: Specifies the pin function.

Port: Specifies the port.

Pull Up/Down Current: Lets the specified pin draw current in ON or OFF mode. It is typically used for

communications protocols, like I2C.

Title: Indicates the channel title.

GPIO out

Target Categories: C2407, CortexM3, Delfino, F28XX, and Piccolo

Block Category: Sim

Description:

Page 40: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

40

Bit Width: Specifies the bit width.

Offset: Specifies the offset.

Pin Function: Specifies the pin function.

Port: Specifies the port.

Pull Up/Down Current: Lets the specified pin draw current in ON or OFF mode. It is typically used for

communications protocols, like I2C.

Title: Indicates the channel title.

getCpuUsage

Target: C2407, C24X, CortexM3, Delfino, F28XX, and Piccolo

Can’t find it in the menus.

I2C Read Buffer

Target: CortexM3, Delfino, F280X, F28XX, MSP430, and Piccolo

Bad dialog box in v8

I2C Start Communication

New Target: CortexM3, Delfino, F280X, F28XX, MSP430, and Piccolo

Page 41: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

41

I2C Write Buffer

New Target: CortexM3, Delfino, F280X, F28XX, MSP430, and Piccolo

Engineering needs to make new dialog box. The current one says I2C Port Read Properties.

monitorBufferEmpty

Target Categories: C2407, C24X, Cortex M3, Delfino, F28XX, and Piccolo

monitorBufferRead

Target Categories: C2407, C24X, Cortex M3, Delfino, F28XX, and Piccolo

monitorBufferWrite

Target Categories: C2407, C24X, Cortex M3, Delfino, F28XX, and Piccolo

PWM block for C2407, C24X, Cortex M3, Delfino, F28XX, and Piccolo

The system clock used by the PWM and other devices is 80 MHz on the F28069. The system clock is

derived from eithe off-chip crystal, oscillator or on-chip oscillator. The on-chip oscillators run at 10 MHz,

so a crystal multiple of 8 must be applied to get to 80 MHz. TI provides an external 20 MHz crystal on the

28069 controlCARD so a 4x crystal multiple must be applied to get to 80 MHz.

You can read about clk source multipliers and PLLs for F28069 in section 1.3 of spruh18d.pdf

QuadratureEncoder for C2407, C24X, Cortex M3, and F281x

Target Categories: C2407, C24X, Cortex M3, F281X

QuadratureEncoder for MSP430

Target Categories: MSP430

Quadrature Pin A:

Quadrature Pin B:

Page 42: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

42

readTargetMemory

Target Categories: MSP430

Serial UART Read (was serialPortRead)

Target Category: C2407, C24X, Cortex M3, Delfino, F281X, F280X, MSP430, Piccolo

The Serial UART Read block is a serial communication block for reading RS32 information. There is a 16-

bit element transmit and receive queue. There is an interrupt-based driver that places receive

characters in a receive queue and transmit characters in a transmit queue for servicing by the interrupt

handler. You may read as many bytes as are available in the receive queue. You can query the current

receive queue length using the drop down setting in Serial UART Read block.

Use the Serial UART Config command to configure the serial port.

Block Output: Determines the type of information the block produces. Your choices are:

Data: Eight bits of data received.

Port Status: Actual bits returned by the status register on the peripheral device.

Receive Queue Empty: Outputs 1 if the queue is empty; and 0 if the queue is not empty.

Receive Queue Overrun: Outputs 1 if the queue has been overrun; and 0 if the queue has not

been overrun.

Receive Queue Length:

Receive Queue Max Length:

Page 43: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

43

Transmit Queue Full: Outputs 1 if the transmit queue is full; and 0 if it is not.

Transmit Queue Length:

Transmit Queue Max Length:

Mux Pin: Selects which pin a given function is on.

Port: Selects the Comm port on the peripheral device.

Serial UART Write (was serialPortWrite)

Target Category: C2407, C24X, Cortex M3, Delfino, F281X, F280X, MSP430, Piccolo

The Serial UART Write block is a serial communication block for transmitting RS32 information. This

block has two input tabs: one is an enable pin and the other is for data. When the enable pin is high, the

values entering the data pin are presented to the transmit queue. When the enable pin is zero, values

entering the data pin are ignored. The serial port queue is interrupt driven. You may write as many bytes

as are free in the transmit queue and the interrupt handler will send the bytes out automatically. You

can query the current transmit queue length using the Serial UART Write block.

Use the Serial UART Config command to configure the serial port.

Mux Pin: Selects which pin a given function is on.

Port: Selects the Comm port on the peripheral device.

SPIread

Target Categories: Cortex M3, Delfino, F28XX, MSP430, and Piccolo

SPIwrite

Target Categories: Cortex M3, Delfino, F28XX, MSP430, and Piccolo

targetInterface block

Target Categories: C2407, C24X, Cortex M3, Delfino, F28XX, MSP430, and Piccolo

Page 44: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

44

Question: The outfile path indicated in the target interface dialog box is correct, but the block

nonetheless shows inputs and outputs from a file that was run some time ago (several outfiles have

been generated since it was last run). I have no idea what is causing this behavior, or how to correct it.

In addition, when I set the outputs to 0 in the target interface dialog box, the block still shows one

output from the previous target interface. This also seems strange.

Answer: The Target Interface block only takes its pin count upon block insertion. After that, it doesn’t

change unless you manually change the pin count in the setup dialog under “Connectors”. So if you

change the pin count on your block in the source code diagram you will have to manually change the pin

count in the debug diagram.

Probably the output pin that won’t go away is the “% CPU usage” pin.

http://vissim.com/forums/what_is_cpu_usage_pin

You can remove it by unchecking the “Show CPU Utilization” option.

USB Read

Target Category: Cortex M3

Output Type:

Data Type:

USB Write

Target Category: Cortex M3

Page 45: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

45

Output Type:

Web Server

Target: Cortex M3

Data Transfer Variables

Web Interface Source

Window Header

Page Header

Get Data Automatically every…

IP Address

Subnet Mask

MAC Address:

Page 46: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

46

Microchip dspPic32 support

Concerto c28 M1 ECC boot error

Save minimize RAM usage state to file

Fix Point fft

Using the Config blocks and commands

Using the ADC Config commands

Target: Delfino, F280x, F28xx, and Piccolo

ADCCLK: Specifies the analog to digital converter clock.

Trigger Setup: Lets you choose the source, trigger, and sample clock. What is dual sample?

SYSCLK: Indicates the speed of the CPU clock.

Page 47: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

47

Target: MSP430

New Parameter:

On chip VRef:

VRef Source: Allows you to select the reference voltage for the unit. Because the internal voltage

reference can be inaccurate, this option lets choose a high-precision, external signal.

Using the ARM Cortex M3 Config block

After you enter the properties into the Config dialog box and click the OK button, the ARM Cortex M3

Config block is inserted into your diagram.

Target: Cortex M3

Page 48: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

48

Ctrl Clk Count Mode: Chooses the count mode for the PWM based control clock. If the PWM is also used

as an output peripheral, this setting must match the setting of the PWM block in the diagram.

Control Clk Prescale: Chooses the prescale factor for the PWM based control clock. If the PWM is also

used as an output peripheral, this setting must match the setting of the PWM block in the diagram.

Control Clk Src: Chooses periodic sampling interrupt source for the main control loop in VisSim

CPU: For some targets, there is a family of CPU types. It is important to select the exact CPU type for the

specified target.

CPU Speed: Indicates the speed of the CPU. Click on the down arrow to select a speed.

EPWM Interrupt Event: Choose PWM event if PWM interrupt is selected as the Control Clk Src.

HSPCLK: Drives the ADC sample timer.

JTAG Connection: Chooses the JTAG connection. These connections must be set up in Code Composer

Studio before starting VisSim.

LSPCLK: Drives the serial and SPI ports.

Page 49: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

49

Multiple of Crystal Freq: Indicates the multiple of crystal frequency. Click on the down arrow to make a

selection

Using the CAN Config command

Targets: C2407, C24X, Delfino, F280x, F28xx, Piccolo

New Parameter

Byte Order: Not available on C24x

Target: ARM Cortex M3

Page 50: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

50

New Parameters

RX Mux Pin: Only available for ARM Cortex M3.

TX Mux Pin: Only available for ARM Cortex M3

Using the DMA Config command

Targets: Delfino,F28X, F28XX, and Piccolo

Burst Size:

Burst Dst Step:

Burst Src Step:

Channel:

Continuous Mode:

Data Size:

Init Dst Address:

Init Src Address:

One Shot:

Transfer Dst Step:

Transfer Size:

Transfer Src Step:

Trigger Src:

Wrap Dst Size:

Page 51: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

51

Wrap Dst Step:

Wrap Src Size:

Wrap Src Step:

F28x Config command – it needs to be removed from C24 menu; doesn’t

belong here

New parameter: Boot Init Code

Using the GPIO Mux Config block

Targets: Delfino, F280X,F28XX, and Piccolo

GPIO Bank: Selects the bank of 16 GPIOs to configure

GPIO1 - 15: Selects synchronization or qualification duration for a given GPIO pin.

Page 52: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

52

I2C Config command for Cortex M3, Delfino, F28XX, and Piccolo

Targets: Cortex M3, Delfino, F28XX, and Piccolo

New Parameter

Bit Rate:

Existing Parameter:

Use Freeform Mode: Not available for the Cortex M3

Page 53: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

53

Using the F28x Config block for the Delfino, F280x, and Piccolo

New Parameter

Enable Interactive Peripheral Mode:

Remove: Use 16 Single Channel PWM mode:

Page 54: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

54

Using the F28x Config block for the F281x

Boot Init Code:

Control Clk Prescale: Chooses the prescale factor for the PWM based control clock. If the PWM is also

used as an output peripheral, this setting must match the setting of the PWM block in the diagram.

Control Clk Source: Chooses periodic sampling interrupt source for the main control loop in VisSim.

CPU: For some targets, there is a family of CPU types. It is important to select the exact CPU type for the

specified target.

CPU Speed: Indicates the speed of the CPU. Click on the down arrow to select a speed.

Ctrl Clk Count Mode: Chooses the count mode for the PWM based control clock. If the PWM is also used

as an output peripheral, this setting must match the setting of the PWM block in the diagram.

Multiple of Crystal Frequency: Indicates the multiple of crystal frequency. Click on the down arrow to

make a selection. If you are running the 2407 eZdsp, you must run at 4 times crystal speed, even though

the crystal speed (14.9 MHz) is 1/2 of the CPU speed (30 MHz).

JTAG Connection: Chooses the JTAG connection. These connections must be set up in Code Composer

Studio before starting VisSim.

Page 55: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

55

Using the Serial UART Config command

Targets: C2407, C24X, Cortex M3, Delfino, F28XX, MSP430, and Piccolo

Mux Pin Assignment:

New Parameters

Remove USCIA and Clock Source parameters

Mux Pin Assignment:

SPI Config command

Targets: C2407, C24X, Cortex M3, Delfino, F28XX, MSP430, and Piccolo

Question: Normally we don’t use the /SPISTE pin and wish it to remain as a GPIO pin, but how do we do

this. We are finding that this pin is forced to function as /SPISTE if we use the associated SPI module.

So how do we set the pin associated with /SPISTE as a GPIO pin while still retaining use of the other

three as part of the SPI module.

Solution: We can add an "unused" option in the mux dropdown for SPISTE in SPI Config.

Page 56: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

56

Clk Src:

STE Mode:

USB Config

Target: Cortex M3

The USB Config command lets you choose the transmit and receive queue lengths.

Receive Queue Length: Sets the receive queue length. The minimum length is 1 byte; the maximum

length is 255 bytes.

Transmit Queue Length: Sets the transmit queue length. The minimum length is 1 byte; the maximum

length is 255 bytes.

Page 57: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

57

Using the TI MotorWare Blocks

The TI MotorWare blockset allows you to easily set up and use the TI InstaSpin technology.

Angle Estimator

Block Inputs

vbus: Bus voltage scaled to unity. The value 1 is nominal bus voltage.

ia and ib: Clarke Transform 3-phase current measurement scaled to unity for the peak current.

va and vb: Clarke Transform 3-phase voltage measurement scaled to unity for peak voltage.

You use the Angle Estimator block to define parameters for the motor, motor controller, and motor

identification algorithm. To use the Estimator Read Property or Estimator Write Property blocks, you

must have either a Motor Control or Angle Estimator block in your diagram.

Controller: Indicates the controller. This value must match the Controller value in the Estimator Read

and Estimator Write blocks.

MotorWare: Specifies the version of MotorWare.

Parameter, Value, Description window: Lists the editable motor, motor controller, and motor

identification algorithm values. To change the value of a parameter, double click on the value. For more

Page 58: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

58

information on the motor, motor controller, and motor identification algorithm values, see the TI

InstaSPIN online documentation: http://www.ti.com/lit/ug/spruhj1d/spruhj1d.pdf .

Controller Read Property

The Controller Read Property block reads a property of the TI motor drive software.

Controller: Indicates the controller. This value must match the Controller value in the Motor Control

block.

Property: Specifies the property. For more information on the properties, see the TI InstaSPIN online

documentation: http://www.ti.com/lit/ug/spruhj1d/spruhj1d.pdf.

Argument: For Ki, Kp, and Kd properties, lets you specify the corresponding PID type.

Controller Write Property

The Controller Write Property block writes a property of the TI motor drive software.

Controller: Indicates the controller. This value must match the Controller value in the Motor Control

block.

Property: Specifies the property. For more information on the properties, see the TI InstaSPIN online

documentation: http://www.ti.com/lit/ug/spruhj1d/spruhj1d.pdf

Argument: For Ki, Kp, and Kd properties, lets you specify the corresponding PID type.

Page 59: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

59

Estimator Read Property

The Estimator Read Property block reads a property of the estimator.

Controller: Indicates the controller. This value must match the Controller value in the Angle Estimator

block.

Property: Specifies the property. For more information on the properties, see the TI InstaSPIN online

documentation: http://www.ti.com/lit/ug/spruhj1d/spruhj1d.pdf

Argument: For Ki, Kp, and Kd properties, lets you specify the corresponding PID type.

Estimator Write Property

The Estimator Read Property block writes a property of the estimator.

Controller: Indicates the controller. This value must match the Controller value in the Angle Estimator

block.

Property: Specifies the property. For more information on the properties, see the TI InstaSPIN online

documentation: http://www.ti.com/lit/ug/spruhj1d/spruhj1d.pdf

Argument: For Ki, Kp, and Kd properties, lets you specify the corresponding PID type.

Page 60: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

60

Motor Control

Block Inputs

vbus: Bus voltage scaled to unity. The value 1 is nominal bus voltage.

Ia, ib, ic: Clarke Transform 3-phase current measurement scaled to unity for the peak current.

Va, vb, vc: Clarke Transform 3-phase voltage measurement scaled to unity for peak voltage.

You use the Motor Control block to define parameters for the motor, motor controller, and motor

identification algorithm. To use the Controller Read Property or Controller Write Property blocks, you

must have a Motor Control block in your diagram.

Controller: Indicates the controller. This value must match the Controller value in the Control Read and

Control Write blocks.

MotorWare: Specifies the version of MotorWare.

Parameter, Value, Description window: Lists the editable motor, motor controller, and motor

identification algorithm values. To change the value of a parameter, double click on the value. For more

information on the motor, motor controller, and motor identification algorithm values, see the TI

InstaSPIN online documentation: http://www.ti.com/lit/ug/spruhj1d/spruhj1d.pdf ..

Page 61: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

61

Config block for F28069

So the reason for your error is in your source code diagram. If you were to right click into your config

block and set the clock source to external crystal your diagram will work. Reason for the error is because

your F28069 board does not have an external oscillator, but it does have an external crystal. So if you

switch to external crystal that should make it work. Hope this helps

Using the Target Commands

Using the Download Command

For Download Directly to FLASH: change “cannot have been” to “can be”

Using the TI DMC Block Set

Ramp Generator block

no longer in the 16-bit block set

Resolver Decoder block

no longer in the 16-bit block set

VisSim/Analyze Nyquist add freq readout and run from 0 to +inf, not -Inf

VisSim/State Charts

Trigger block

You can edit the trigger name by double clicking on the constant block and then entering a new name.

Floating Debug Window

The floating Debug window lets you add watch expressions that are automatically updated with each

single step or breakpoint. You can also right click and create a submachine state containing those states.

Watch State Chart Variables

Page 62: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

62

Duplicate or Perhaps Unnecessary

CRC block: new – not sure what target it goes under

The CRC block lets you select the CRC method via right click, and choose

whether the result is available via output pin.

There are 3 inputs:

- enable: Must be 1 for block to read "newVal" and apply it to existing CRC value.

- reset: If it goes to 1, the internal CRC value is zeroed.

- newVal: new value to be applied to internal CRC value.

CANreceive block

Target Category: C2407, C24X, CortexM3, Delfino, F280X, F28XX, and Piccolo

Page 63: Version 9.0 New Features/Errata Products VisSim VisSim ... 9 FS.pdf · to those diagrams are not saved until you do one of the following: Save Embedded Blocks to Source Files: Saves

63