Altium
Altium
Altium
Workspace panels
These include Files
and Projects panels. Home Page Design View
These panels can be Common tasks are listed
moved, docked or to get started quickly.
clipped by clicking on
the panel title and
dragging it to a new
location.
Click on the tab at the
bottom of the panel to
display its contents. Panel Control
Editor specific and
shared panels can be
displayed using these
Panel buttons.
Note: To move an individual panel, click and hold on the panel name. To move a set of panels,
click and hold on the panel caption bar away from the panel name. To prevent panels stacking
together, hold the CTRL key. To change a docked panel to pop-out mode click the small pin
icon at the top of the panel, to change it back to docked click the pin icon again.
Figure 5. Tabs showing various documents open, note how the PCB tab is highlighted, indicating that it is
the document currently being edited.
Menus
Schematic Editor
displaying the active
schematic document.
3.1.1 Menus
• Altium Designer menus are similar to standard Windows menus.
• Standard operations, e.g. opening, saving, cut, paste, etc. are consistent across editors.
• Right-click on an empty space on the menu bar or a toolbar caption to open the
Customization Editor and customize any of the resources for that editor.
3.1.3 Toolbars
• Toolbars can be fixed to any side of the workspace or they can be floated.
• Click and drag to move a toolbar. The cursor must be within the toolbar but not actually on a
button.
• Toolbars can be reshaped, hold the cursor over the edge of the toolbar and when the
resizing cursor appears click and hold to reshape.
• New toolbars can be created and existing toolbars edited.
• Multiple toolbars can be active, right-click on a toolbar to pop up the toolbar display control
menu.
3.1.10 Undo/Redo
• Most commands can be undone or then redone using the Undo and Redo toolbar
buttons. The number of schematic editor and PCB editor undos is set in the Preferences
dialog (DXP » Preferences).
• The shortcut keys for Undo are CTRL+Z or ALT+BACKSPACE, and CTRL+Y or
CTRL+BACKSPACE for Redo.
2. Select Save As from the File menu to name and save the project document.
3. The new project is ready to add new or existing documents to.
Figure 10. Use the Storage Manager to manage project files on the hard disk, and to interface to your
Version control system.
4.10 Libraries
• Libraries can exist as individual documents, for example, schematic libraries containing
schematic symbols, PCB libraries containing PCB footprint models, discrete SPICE models
(MDL and CKT), and so on.
• Altium Designer also supports the creation of integrated libraries. An integrated library is the
compiled output from a library package. It includes all the schematic libraries in the original
library package, plus any referenced models, including footprint, simulation and signal
integrity models.
• Most of the supplied libraries are provided as integrated libraries and are stored within the
\Program Files\Altium Designer 6\Library folder. Integrated libraries can be
converted back to their constituent libraries; simply open them in Altium Designer to do this.
PCB libraries are also provided in the \Program Files\Altium Designer 6
\Library\Pcb folder.
• The Schematic Library Editor and PCB Library Editor are covered during the Schematic
Capture and PCB Design training sessions. The basics of creating an integrated library are
also covered.
Note: You can use Protel 99 SE libraries directly in Altium Designer. Add them to the
Libraries panel to use them without converting them to the Altium Designer format. Note
that you will not get all the benefits of the enhanced parameter and model support.
The following sections describe the entries in the DXP system menu.
5.3 Preferences
Various global system preferences can be set for the DXP environment, including file backup
and auto-save options, the system font used, the display of the Projects panel, environment view
preferences including the popup and hide delay for panels, and enabling the version control
interface. You can also access the environment preferences for each of the editors available in
Altium Designer, such as the schematic and PCB editors.
To set Altium Designer environment preferences, select Preferences from the DXP menu. This
will open the Preferences dialog shown in Figure 13.
Figure 13. Preferences dialog, used to configure Altium Designer and all editor preferences.
5.5 Licensing
Selecting the Licensing command from the DXP System menu displays the Licensing View,
where you can select and configure the licensing type – Standalone or Network Client.
Figure 17. Customizing dialog with Right Mouse Click commands displayed
2. In the dialog, select DeSelect in the Categories list, then in the Commands list on the right
locate the All on Current Document command.
3. Click and hold on this command and drag it up to the Help menu. Once it opens, drag down
to Popups, then down to Right Mouse Click, then drop the command below the Clear
Filter menu entry.
4. Before closing the menu we will edit the caption that appears in the menu. To do this,
double-click on the new menu entry to open the Edit Command dialog.
5. In the Edit Command dialog, edit the caption to read De&Select All. Note the location of the
ampersand character (&). This defines the letter that will act as the accelerator key. The
letter S has been chosen because the letters D and A are already assigned in this menu. You
are free to reassign any of the accelerator keys that are used in the menu.
Note: Resource customizations are stored in the file DXP.RCS, which is located in the
C:\Documents and Settings\<your logon name>\Application
Data\AltiumDesigner6 folder.
The Bars tab can be used to create a new toolbar, control the display of toolbars and select
which bar will be the menu bar. Only one menu can be active at any one time but any toolbar
can be selected to be the menu bar. To set a new bar to be the menu bar, change the Bar to
Use as Main Menu drop down.
In this section, we will explore the basics of working in the Schematic Editor.
• If not already open, open the following project: 4 Port Serial Interface.PrjPcb,
found in the \Altium Designer 6\Examples\Reference Designs\4 Port Serial
Interface folder (as shown above in Figure 19), and then open the schematic sheet, ISA
Bus and Address Decoding.SchDoc by double-clicking on the document name in the
Projects panel.
While executing commands, auto panning becomes active (a crosshair is attached to the cursor)
by touching any edge of the Design Window. While auto panning, pressing the SHIFT key will
double the panning speed. Auto panning speed is controlled via the Auto Pan Options section of
the Graphical Editing tab within the Preferences dialog (Tools » Schematic Preferences).
Auto panning can also be turned off here.
The following shortcut keys provide a very useful alternative for manipulating the view of the
workspace. These shortcut keys can be used while executing commands.
Keystroke Function
END Redraws the view
PAGE DOWN Zoom out (holds the current cursor position)
PAGE UP Zoom in (holds the current cursor position)
CTRL+PAGE DOWN View Document
HOME View pan (pan to centre the current cursor position)
SPACEBAR Stops screen redraw
ARROW KEYS Moves the cursor by one snap grid point in direction of the arrow
SHIFT+ARROW KEY Moves the cursor by 10 snap grid points in the direction of the
arrow
Table 2. Shortcut keys for view manipulation
7.3 Selection
The Schematic Editor provides selection capabilities that are similar, although not identical, to
selection in other Windows applications.
Below are some key points about selection in the Schematic Editor:
• The main use of selection is to nominate objects for a clipboard operation, i.e. which objects
will be moved or copied to the clipboard when the Cut or Copy commands are invoked.
• Once objects are on the clipboard, they can then be pasted elsewhere onto the current
schematic or into another schematic, or to another Windows application which supports the
Windows clipboard.
• Selection is not cumulative. The selected object deselects when you click on another object.
• Hold the SHIFT key to select multiple objects.
• Press DELETE to delete all selected objects.
To select an object you can use:
Keystroke Function
Click and drag Select all objects enclosed by drag area
SHIFT+click on object Select an object (on a selected object, this will de-select it)
Edit » Select menu (S) Select Inside Area, Outside Area, All, Net or Connection
Note: To de-select objects, use the Edit » DeSelect menu commands (X for popup menu)
or the DeSelect All button on the Main toolbar.
Location markers
1. Set Location Mark 2 by selecting Edit » Jump » Set Location Marks » 2 (L2) and then click
in the schematic sheet to set the position for the location mark.
2. Zoom out to another part of the schematic.
3. Select Edit » Jump » Location Marks » 2 (JK2) and the screen will centre on Location
Mark 2.
6. Make sure all objects on the sheet are not selected using Edit » DeSelect » All (X, A) or
on the main toolbar.
7. Using the click and drag selection feature, select a section of the circuit. Using the Edit »
Copy menu command, copy the items to the clipboard.
8. Open a new sheet and paste the clipboard contents onto it. De-select the pasted objects.
9. Close the new sheet (no need to save it).
10. Try moving the selected objects on the original sheet using the Edit » Move menu
commands. Deselect all objects.
11. While holding the CTRL key, click on the component U10. You can now drag it around and
still maintain connectivity.
12. Click and hold on capacitor C12 and start to move it. While moving it press the ALT key,
noting how the movement is now constrained to the horizontal or vertical direction only. The
choice between constraining horizontal or vertical is defined by the proximity of the cursor to
the object – simply push the object in the desired direction to see the effect.
13. Double-click on one of the capacitors. The Component Properties dialog displays. You can
now edit any of the device’s properties.
14. Close the schematic without saving any changes.
Data7
Data6
Data5
Data4
Data3
Data2
Data1
Data0
Data0
1. Select the Place Line toolbar button or Place » Drawing Tools » Line.
2. Click once to start the line.
3. Click to place each vertex. The BACKSPACE key deletes the last vertex placed.
4. Right-click once to end the line.
5. Right-click again to end the command.
8.2.2 Polygons
To draw a polygon:
1. Select the Place Polygon toolbar button or Place » Drawing Tools » Polygon.
2. Click to place each vertex.
3. Right-click to end the polygon.
4. Right-click again to end the command.
5. Turn the Draw Solid option off in the Polygon dialog to draw a polygon that is not filled.
Note: The fill color and border color of polygons are independent.
8.2.3 Arcs
To place a circular arc:
1. Select the Place » Drawing Tools » Arc menu command.
2. Click to place the arc centre.
3. Click to determine the arc radius.
4. Click to place the start of the arc and click to place the end of the arc.
5. Right-click to end the command.
1. Select the Place Elliptical Arc toolbar button or Place » Drawing Tools » Elliptical
Arc.
2. Click to place the arc centre.
3. Click to determine the arc X-radius.
4. Click to determine the arc Y-radius.
5. Click to place the first end of the arc and click to place the second end of the arc.
6. Right-click to end the command.
1. Select the Place Bezier Curve toolbar button or Place » Drawing Tools » Bezier.
2. Click once to place the first control point at the start of the curve.
1. Select the Place Text Frame toolbar button or Place » Text Frame.
2. Press Tab to edit the contents and properties for the text frame and click OK.
3. Click to position the top left corner of the frame and then click to position the bottom right
corner of the frame.
4. Right-click to stop placing text frames.
The following keys apply when entering text into the frame:
Action Keystroke
Insert a tab CTRL+TAB
Cut SHIFT+DELETE or
CTRL+X
The Cut, Copy and Paste commands apply to the Windows clipboard. The clipboard can also be
used to bring text in from other applications.
8.2.8 Rectangles
To place a rectangle:
1. Select the Place Rectangle toolbar button or Place » Drawing Tools » Rectangle.
2. Click to place top left corner.
3. Click to place bottom right corner.
1. Select the Place Rounded Rectangle toolbar button or Place » Drawing Tools »
Rounded Rectangle.
2. Press Tab to set the corner radii and click OK.
3. Click to place top left corner and click to place bottom right corner.
4. Right-click to end the command.
8.2.10 Ellipses
Use this command to draw circles as well. To place an ellipse:
1. Select the Place Ellipse toolbar button or Place » Drawing Tools » Ellipse.
2. Click to place the ellipse centre.
3. Click to determine the ellipse X-radius.
4. Click to determine the ellipse Y-radius.
5. Right-click to end the command.
1. Select the Place Pie Chart toolbar button or Place » Drawing Tools » Pie Chart.
2. Click to place the pie centre.
3. Click to determine the pie radius.
4. Click to place the first edge of the pie and click to place the second edge.
5. Right-click to end the command.
1. Select the Place Graphic Image toolbar button or Place » Drawing Tools » Graphic.
2. Click to place the top left corner of the image and click to place the bottom right corner of the
image.
3. Locate the file that contains the image and click OK.
2. While in the Schematic Library Select the Setup Array Placement toolbar button or
Edit » Paste Array. The Setup Paste Array dialog displays. The Primary Increment field
allows you to specify how text will increment when pasting and array of objects in a
schematic design, e.g. the designators of components or net labels. Incremental values may
be alphabetic or numeric, positive or negative. The Secondary Increment field is only used
when placing pins in the Schematic Library Editor since pins have two incremental properties
— designators (primary) and names (secondary). This would allow you, for example, to
place a series of pins with incrementing numbers and decrementing names.
While within the Schematic Editor, the Paste Array options will be found in Smart Paste. Go to
Edit » Smart Paste. On the right side of the Smart Paste dialog you will see the section for
Paste Array, enable the Paste Array.
Columns
This specifies the number of columns you want in your paste array. Each column will be
separated by the Column Spacing setting. Enter positive or negative values for spacing, to
determine whether the array will be pasted to the right or left respectively for horizontal
placement, or upwards or downwards respectively for vertical placement.
Rows
This specifies the number of rows you want in your paste array. Each row will be separated by
the Row Spacing setting. Enter positive or negative values for spacing, to determine whether the
array will be pasted to the right or left respectively for horizontal placement, or upwards or
downwards respectively for vertical placement.
Text Increment
Select what method you would like to use to increment strings (such as designators) on the
copies you are pasting. You can select from the following options:
• Direction
- None – do not increment, meaning each copy will have the same strings
- Horizontal First – this will increment strings increasing the value of a string from its
predecessor by the Primary amount. The successor string to increment is found by
finding the next string in the sequence immediately to the right. Once a row has been re-
sequenced, move to the start of the next row above. Pins can also be incremented using
the Secondary setting.
- Vertical First – this will increment strings increasing the value of a string from its
predecessor by the Primary amount. The successor string to increment is found by
finding the next string in the sequence immediately above. Once a column has been re-
sequenced, move to the start of the next column to the right. Pins can also be
incremented using the Secondary setting.
• Primary
- Strings are incremented/decremented from its predecessor by the Primary amount. Pins
can also be changed using the Secondary setting.
• Secondary
- Strings are incremented/decremented from its predecessor by the Primary amount. Pins
can also be changed using the Secondary setting.
• All Wiring Tools toolbar functions can be accessed through the Place menu.
• Text in electrical objects can be over scored, typically to indicate an active low signal, by
adding ‘\’ after the character, e.g. R\ESET would display ‘R’ as over scored text. To
overscore the entire word with a single ‘\’ character, enable the Single ‘\’ Negation option in
the Schematic – Graphical Editing page of the Preferences dialog.
In the following sections, the use of each electrical object is explained.
9.2.1 Wires
• Select the Place Wire toolbar button or Place » Wire.
• Wires are used to represent an electrical connection between points.
Be careful to use the Place » Wire command and not use the Line command by mistake.
• Press the SPACEBAR to change the placement mode. There are six placement modes as
follows:
- 90 degree start
- 90 degree end
- 45 degree start
- 45 degree end
- any angle
- auto wire.
• The BACKSPACE key deletes the last vertex placed.
• A wire end must fall on the connection point of an electrical object to be connected to it. For
example, the end of a wire must fall on the hot end of a pin to connect.
• Wires have the Auto Junction feature, which automatically inserts a Junction object if a wire
starts or ends on another wire or runs across a pin.
• Select the Place Bus toolbar button or Place » Bus. Place a bus line in the same
manner as placing wires, i.e. press SPACEBAR to change placement mode and press the
BACKSPACE key to delete the last vertex placed.
• Buses can only represent connections to ports and sheet entries and only at their end points.
2. Select the Place Net Label toolbar button or Place » Net Label.
3. Press Tab to edit the net label text. The Net Label dialog displays.
4. Click on the down arrow in the Net field to display the names of nets already defined on the
sheet, or type in the new net name. Click OK.
5. Press spacebar to rotate the net label.
6. Click once to position the net label.
7. Right-click to stop placing net labels.
1. Select either the GND or VCC Power Port toolbar buttons, or Place » Power Port.
2. Press TAB to edit the power port properties for a net name other than GND or VCC.
9.2.6 Ports
• Ports provide a method of forming connections from one sheet to another sheet.
• Click on the down arrow in the Name field to list all the Port names defined on the sheet.
• The port I/O Type is used by the ERC when checking for connection errors.
• The port style only changes the appearance of the port.
To place a port:
• Parts can also be placed using the Place button in the Schematic Library Editor.
• When placing parts, use a snap grid that will cause the pin ends to fall on a grid point, e.g.
10. Press G to cycle through the snap grid settings of 1, 5 and 10.
1. Select the Sheet Symbol toolbar button or Place » Sheet Symbol (PS).
2. Press Tab to edit the sheet symbol name and sheet symbol file name.
1. Select the Place Sheet Entry toolbar button or Place » Add Sheet Entry (PA).
2. Click on the sheet symbol that the sheet entry is for and the sheet entry symbol
appears within the sheet symbol box.
3. Press Tab to edit the sheet entry properties.
4. Click on the down arrow in the name field to list all the Sheet Entry names used
on the current sheet.
5. Position the sheet entry on any side of the sheet symbol and click.
6. Right-click to stop placing sheet entries.
3. Click to place the Off Sheet Connector. Right-click to exit placement mode.
9.2.11 Junctions
• The software automatically adds an auto-junction at valid connection points, including ‘T’
joins, and when a wire crosses the end of a pin. Auto-Junctions are not added at crossovers.
• Manual junctions can be used to force a junction at a crossover, select Place » Manual
Junction (PJ). The crosshair cursor appears with a junction marker (red dot) on it. Click to
place the junction marker.
• The Auto-Junction display is set in the Compiler tab of the Preferences dialog (Tools »
Schematic Preferences).
3. Position the directives symbol so that its hot point (the end of the stem) touches the wire or
bus. Click to place it.
4. Right-click to stop placing routing directives.
Note: PCB routing directives are Parameter Set objects. The separate menu entry to place
PCB Routing Directives has been retained for user compatibility with earlier versions.
• Select the Place No ERC toolbar button or Place » Directives » No ERC. Click to place
the No ERC marker on a pin or existing ERC marker. Right-click to exit placement mode.
The PCB Editor panel is examined in detail during the PCB Design training session.
The following shortcut keys are very useful for manipulating the view of the document window.
These shortcut keys can be used at any time, i.e. even when executing commands.
10.2.1 Autopanning
Autopanning becomes active when executing commands, i.e. when the cursor appears as a
crosshair. When in this state, touching any edge of the document window will initiate
autopanning.
The autopanning speed is controlled via Autopan Options section of the Options tab within the
Preferences dialog (Tools » Preferences). Autopanning can also be turned off here.
10.3 Selection
Use the Select function to graphically edit an object. Below are some key points about using
select:
• An object becomes selected when you click on it with the left mouse button.
• Clicking on an object that is selected allows you to move it.
• When selected, handles appear at key points on the object. The method for editing objects
varies between objects, but typically, a click on a handle enables you to move the handle.
• When placing objects, the last object placed remains selected.
• To de-select an object, simply click in an area of the workspace where there are no objects.
Right-click ESCAPE
If a Jump command does not appear to jump to the correct location, zoom in to display the
correct coordinates.
• The object placement commands are selected using either the Place menu or the Wiring
and Utilities toolbars.
• To set the properties of an object while placing it, press the TAB key and the Properties
dialog for that object will be displayed.
• Once an object is placed, you can change its properties by double-clicking on it to display
the Properties dialog for that object. Alternatively, you can click once to select an object, then
edit the properties in the Inspector panel (F11 to open).
• Set the default properties for each object type in the Defaults tab of the Preferences dialog
(Tools » Preferences).
• The current layer determines the layer on which the object is placed.
To start Interactive Routing, select the toolbar button or Place » Interactive Routing (PT).
Click where you wish to begin the first track and then use the track placement and start/end
modes detailed below.
Pressing TAB during interactive routing will display the Interactive Routing dialog where you can
set widths, sizes and related design rules.
You can change the signal layer that you
are routing on by pressing the * (asterisk)
shortcut key on the keypad and a via will
be automatically added.
Break
Use this command to insert a new vertex anywhere on an existing track and break the track into
two segments. The new vertex may be dragged to a new location when the break is formed.
1. Select Edit » Move » Break Track from the menu.
2. Click on segment of track to insert a vertex and move it.
3. Right-click or press ESC to end the command.
Alternatively, as a shortcut, hold down CTRL+SHIFT before clicking to break one track at a time.
Drag End
This command will only move the end of the track that you click on.
1. Select Edit » Move » Drag Track End from the menu.
2. Click on an existing track end and then move it. The other end of the track remains in its
original position.
3. Right-click or press ESC to end the command.
11.3 Lines
The Place Line command is provided for placing lines other than tracks, such as the board
outline or keepout boundaries on non-electrical layers. Line placement behaves exactly the
same as track placement during interactive routing, however, lines have no nets associated with
them. When placed on non-electrical layers, lines are not constrained by the design rules.
Pressing TAB when placing lines displays the Line Constraints dialog. Note, however, that when
you double-click on a line to edit its properties, the Track dialog displays.
• Pad properties are set in the Pad dialog that is displayed by pressing the TAB key while
placing the pad or double-clicking on a placed pad.
• If a pad is to have different sizes on the mid layers or bottom layer, check Top-Middle-
Bottom in the Size and Shape section. Click on Full Stack and then Edit Full Pad Layer
Definition to edit more complicated stack ups.
• Assign a net to the pad, define the pad’s electrical type (i.e. load, terminator or source) and
set whether or not the pad’s hole is plated. The NC drilling software selects separate drill
tools for plated and non-plated holes.
• Pads can be assigned as Top and/or Bottom Layer Testpoints.
• Setting the Start and Finish layers to any layers other than Top Layer and Bottom Layer
automatically assign the via as a blind or buried via. Blind and buried vias can be easily
identified as their hole is displayed as two half circles with different colors.
• Vias can be assigned as Top and/or Bottom Layer testpoints.
• If a net being manually routed is to connect to an internal power plane, press the / (forward
slash) key on the numeric keypad to place a via connecting to the appropriate power plane.
This will work in all track placement modes except ‘any angle’ mode.
Tenting
Checking the Tenting check boxes causes any Solder Mask settings in the design rules to be
ignored and results in no opening in the solder mask for this via.
Arc (Centre)
Full Circle
If components have been copied, the other options will become selectable. The Duplicate
Designator option should be selected when panelizing an entire design to keep the designator
names the same on each panel. Otherwise, generic default designator names are used.
Select the Add to Component Class option to make sure pasted components are added to the
same class as the components from which they were copied.
12.2 Navigating
The DXP Navigator panel supports the traditional click-to-highlight style of browsing the design.
As you click, the selected object(s) is presented on screen. You can also analyze and trace the
connectivity in the design – either spatially in the actual workspace, or in the Navigator panel.
• The Navigator panel can be used to browse and cross probe to documents, components,
buses, nets and pins. A single click on an entry in the panel will browse to that object in the
source schematics and VHDL documents.
• Hold the Alt key as you click to simultaneously cross probe to the same object(s) on the
PCB. The current document remains active, so both must be displayed for this to have any
visible effect.
Figure 43. Holding down the Alt key as you click in the Navigator panel will highlight corresponding objects
in both schematic and PCB documents.
• Navigation highlighting options are controlled from within the DXP » Preferences » System
» Navigation. Alternately this dialog can be accessed by clicking the … button to the right of
the Interactive Navigation button.
The Connective Graph option is useful for showing the connection relationships between
different components (green links) and Nets (red links).
• Pressing the Interactive Navigation button causes the component instance information to be
updated in the Navigator panel when design elements are selected in the schematic sheet.
• The Navigator panel lets you view components and nets by individual sheets or hierarchical
groups. Use the flattened hierarchy to see all the components and nets in your design.
Highlighting Engine
Design data Filtering Engine (Mask, Select, Zoom)
Display data
Query Engine
One of the greatest challenges you face as a designer is managing the large amounts of design
data that is created during the design process. To facilitate this, Altium Designer has a powerful
data editing system. This system allows you to manage, find and edit design data in a variety of
ways.
To provide flexible and appropriate methods of editing data, three alternate views of the data can
be used to access and edit design objects:
• The traditional graphical view
• The Inspector panel (press F11 to toggle it on and off)
• The List panel (press Shift+F12 to toggle it on and off)
The Inspector displays the attributes of the currently selected object(s), with the total number
selected being listed at the bottom. Note that the Inspector can be used to edit different kinds of
objects simultaneously.
The List panel gives a spreadsheet-like, or tabular list of objects in the schematic sheet or PCB
workspace. Individual or multiple cells can be edited in the List panel.
A powerful filtering engine is used to control the amount of data that is presented for editing in all
three views. Data can be filtered using the Find Similar Objects dialog, the PCB editor panel, or
by writing a query in the Filter panel. Figure 45 shows a diagram of the data editing system.
The Filter panel is used to type in a query that filters the entire data set, reducing both the
graphical display and the List panel to display only those objects that satisfy the query. In the
graphical display this can be shown by the fading of objects that have been filtered out (and are
no longer editable).
One of the powerful features of this data editing system is the ability to edit multiple objects
simultaneously. The basic approach to use the data editing system is to:
Select the required objects for editing
Inspectthe objects
Edit the object attribute(s).
Figure 47. Using the panel to highlight two nets. Note that all other objects have been faded (masked).
Figure 49. Use the Filter panel to query the design data and access specific objects.
The List panel can also be used to examine and edit the properties of objects. Use the List panel
when you want to examine/compare attributes, or edit only some of the objects.
• Press Shift+F12 to toggle the List panel on/off.
• An individual cell in the List can be edited, press the SPACEBAR or right-click and select Edit.
• Multiple cells can be edited simultaneously, select them, press the SPACEBAR, type in the
new value and press ENTER on the keyboard.
• Blocks of cell data can be copied and pasted to/from a spreadsheet.
• For group-type components, such as components or nets, you can include their primitive
parts (child objects) by right-clicking and choosing the appropriate Show Children option.
• When there are multiple object types displayed, only attributes that are common to all are
displayed. You can remove objects from display in the List panel, select those you wish to
keep, right-click and choose Remove Non-Selected from the menu.
• Column display is managed by right-clicking on the column headers and selecting Choose
Columns.
Figure 51. Using the List to examine/edit all designator and comment strings.
Figure 52. The Text Editor displaying a simple Bill of Materials (BOM) report
The Text Editor options can be set by selecting Tools » Editor Preferences.
Figure 53. The Knowledge Center panel is used to access the Documentation Library.
15.3 Using F1
The Altium Designer environment includes extensive F1 help support. Virtually every aspect of
the interface has F1 help support, for example:
• Press F1 over a menu entry, toolbar button or dialog, to directly open the help topic about
that command/dialog.
• Press F1 over a panel to obtain detailed help specific to that panel.
• Press F1 in the Editor environment for help on that editor. If there is a design object under
the cursor then you will be presented with help on the object.
• Use the four text entry boxes on the left-hand side of the search form to enter keywords and
phases that you wish to search for. Use the drop-down lists on the right-hand side of the
search form to further restrict your search, if necessary.
• The search words are not case sensitive.
• You can enter words in any or all of the text entry fields to form complex search criteria. For
example, the search shown in Figure 54 would find items that contain the words "fpga" and
contain the phrase "place and route". You may enter partial words to find multiple forms of
the word, e.g. "rout" will match route, router, autoroute and unroute.
• To find new and updated items, set the Item Updated dropdown list to the desired time span
and leave all other fields at their defaults.
• If the information you require is not available, you can email your local Altium Sales
Representative and your question will be investigated.
Integrated libraries (*.IntLib) are compiled binary files, which cannot be edited. If you attempt
to open an integrated library, it will be de-compiled, i.e. all the source libraries will be extracted
and a new Library Package will be created. All the libraries supplied with the software are
integrated libraries.
Schematic Libraries (*.SchLib) can be opened for editing using the File » Open menu
command. Navigate to the folder that the required library is stored in and locate the library, e.g.
C:\Program Files\Altium Designer 6\Examples\Training\Temperature
Sensor\Libraries\Temperature Sensor.SchLib and click on Open.
Note: Use the What’s This Help for more information about options in the dialog.
9. Create the graphical representation for the component as shown in Figure 7. The component
body is a Rectangle, placed at the origin in the center of the sheet. The origin is indicated by
the two darker lines that form a crosshair, zoom in/out to show the crosshair and the gridlines.
Start placing the rectangle at the origin, the body is 80 units wide by 70 units high, you can
use the coordinates shown on the Status bar to guide you.
10. Place the pins for the part. It is important to orient pins so that the 'hot' end is away from the
component body. When placing pins, the cursor will be on the 'hot' end of the pin. Press
SPACEBAR to rotate the pin or X or Y to flip it.
11. Press TAB to edit the pin properties before placing a pin. The Pin Properties dialog will open.
Remember to:
Check that the Pin Number is correct and the Pin Length is set appropriately (e.g. 20).
Set the Electrical Type according to the table below:
Pin Number Pin Name Electrical Type Note: Use the auto-
increment/decrement
1 SDA IO
feature when placing
2 SCL Input pins 5, 6 and 7.
3 INT/CMP Output
4 GND Power
5 A2 Input
6 A1 Input
7 A0 Input
8 VDD Power
12. When you have completed drawing the component, set the
- Designator to U?
- Comment to TCN75
- Description to Serial temperature sensor
At the moment this component is really just a symbol, it has no models or parameters – as a
minimum it needs a footprint. You will create the footprint for this component in the next section
and then come back to the schematic library editor to link it to the symbol.
The view commands, primitive objects, layers, selection and focus, grids and general editing
functions are all identical to the PCB Editor.
Settings in the Preferences dialog and Board Options dialog also apply in the PCB Library Editor.
The results of the component rule check are displayed in a text document.
Figure 12.Choose the footprint type, and set the units in the Component Wizard
7. Referring to information in Figure 14, create the footprint with a name of SOIC8. Note that it
will be created with one rectangular pad and 7 round-ended pads. We will use the Inspector
to change the round-ended pads to rectangular once it has been created.
Figure 15. Add and manage component models at the bottom of the editing window, or in the Model
Manager
6. If you know the footprint name, and you are confident that is in a currently available footprint
library, you can type the name directly into the Name field, an image of it will appear if it is
located. Otherwise, you can click Browse to open the Browse Libraries dialog, as shown in
Figure 17.
Note: There are different ways you can reference a footprint from the symbol, this is
determined in the PCB Library region of the PCB Model dialog. Any means find the
footprint in Any currently available library, Library Name means it must come from the
specified library, Library Path means it must come from the specified library in the specified
location, and Use from integrated is set automatically if you have compiled the library into
an integrated library.
Note: The Libraries dropdown at the top of the dialog allows you to choose which library
you are currently browsing, from the available footprint libraries. The Find button is used to
search, this will be demonstrated in the Schematic Capture training module.
7. Once you have located your new SOIC8 footprint select it, and it will appear in the PCB Model
dialog. Click OK to close the dialog.
Note: If your footprint was using a different numbering scheme from the pin numbering on
the symbol you would need to define the pin-to-pad mapping, click the Pin Map button in
the PCB Models dialog to do this.
8. Click Close to close the Model Manager, you have now assigned the SOIC8 footprint to your
TCN75 component.
9. Save the library.
Any component parameters can be included in the Bill of Materials, or any custom report you
generate via the Report generation dialog.
Figure 19. generate reports that include any component data you require.
Figure 20. Add the HelpURL parameter to link the datasheet to the component.
8. Clear the Visible checkbox in the Parameter Properties dialog since there is no need to show
this string on the schematic.
9. Click OK to close the dialog, then click OK to close the Library Component Properties dialog.
10. Save the library.
We are now ready to use this new component symbol on a schematic sheet and check the
footprint and parameter.
6. To confirm that the link to the datasheet is working, position the cursor over the component
and press F1 on the keyboard. If Adobe Acrobat Reader is installed the datasheet will open.
Note: for detailed information on creating components, creating footprints with unusual pad
shapes, attaching different model-kinds, and the different techniques for linking datasheets
to the component, refer to the tutorial TU0103 Creating Library Components.pdf.
7. Save the new schematic sheet with the temperature sensor component on it, you will
complete the rest of this sheet in the Schematic Capture training module.
• Right-clicking in the Parameter Table Editor will display options, such as Add Columns, Add
Parameter Values, Copy, Paste, and so on. Data can also be pasted from standard text and
from most spreadsheet applications, such as Microsoft Excel.
• All parameter changes are controlled by an Engineering Change Order (ECO) process that
supports the controlled execution of ECO’s, including the ability to selectively include and
exclude operations as well as generate reports of all changes prior to their being executed.
Running this generates a .ERR report which reports on all components in the active library.
This report can be used to aid in library verification and library management.
Figure 25. Library report, and the Library Report Settings dialog
Note: You can also generate a library report from the Libraries panel, right-click on a
component in the panel and select Library Report from the context menu.
Design Concept
& Specification
Wire design
Annotate design
Add component
parameters
Template section
Displays the filename of the associated template, if any. Use the Template options in the Design
menu to apply, update or remove the associated template. Set the default template in the System
– New Document Defaults page of the Preferences dialog.
Title Block
When checked, a standard title block is attached to the sheet. The format of that title block is set
using the drop-down list next to this option. Note that this is typically only used when there is no
associated template.
Show Border
When checked the sheet border is displayed.
Border Color
Allows you to set the border color from the Choose Color dialog.
Sheet Color
Allows you to set the background color of the sheet.
Grids section
Grids Options allow you to set the size and turn on or off the Snap Grid and the Visible Grid.
SnapOn
The Snap Grid forces the mouse click location to the closest snap grid point. The Snap Grid is set
and can be turned on or off in the Document Options dialog. You can also cycle though three
predefined grids by pressing the G shortcut key at any time.
Visible
The Visible Grid displays a grid when turned on. This is independent of the Snap Grid. The Visible
Grid can also be turned on or off in the View menu (VV).
Figure 4 shows how Special Strings are entered in a title block. Text entered as the value of a
parameter in the Parameter tab will display where the special string is placed. The properties of
the special strings (i.e. font, color) determine the properties of the text that is displayed.
You place special strings by selecting Place » Text String and then pressing the TAB key. The
Annotation dialog displays. Clicking on the down arrow in the name field lists a special string for
each of the parameters defined. Click on the string required and place it. Special strings display
their content when the Convert Special Strings option is selected in the Graphical Editing tab
of the Preferences dialog (Tools » Schematic Preferences), or when the schematic is printed or
plotted.
Figure 4. Special strings in a title block, with and without the Convert Special Strings option enabled
Options section
Drag Orthogonal
When this option is enabled, dragging electrical objects will force wires to remain at 45/90
placement angle modes. Any angle or rubber banding wire placement is used if this option is
disabled. The SPACEBAR can be used at any time while dragging objects to toggle through the
45/90/any angle placement modes. CTRL+SPACEBAR can be used to rotate a component while
dragging.
Pin Direction
When enabled, small arrows are displayed at each pin, indicating its IO direction.
Port Direction
When enabled, the Port’s Style is automatically determined from its I/O Type, combined with the
direction that the Port is wired from.
Auto-Increment section
Defines the default increment value to use when placing an object that supports auto-increment.
Supported objects include component designators, component pins and all net identifiers (net
labels, ports, power ports, etc). The Secondary increment value is used for objects that include
two values that can increment/decrement, for example component pins (pin name and pin
number).
The Primary and Secondary fields both support positive and negative numeric and alpha values.
Clear button
Removes any default template file already set.
Browse… button
Allows you to browse available template (.SchDot) files.
Options section
Clipboard Reference
When this option is enabled, you are prompted to select a reference point when copying and
cutting selected objects to the clipboard.
Center of Object
If enabled, when you move or drag an object you will hold it by its reference point (for objects that
have one) or its centre (for objects that do not).
Always Drag
Enable this to default to dragging (keep the wires attached to the component pins) when you click,
hold and move a component.
Speed
Allows you to set the Auto Pan speed.
Undo/Redo section
Stack Size
This field shows the number of actions held in the Undo Buffer. The default value is 50. Enter a
value in this field to set the Undo Buffer size. There is no limit to the size of the Undo Buffer,
however, the larger the size, the more main memory is used to store undo information.
Group Undo
Check this box to undo multiple operations in which action(s) may be nested as a part of other
commands (nested Sub-Commands). For example while placing objects, Altium Designer allows
you to perform other operations, invoked using keyboard shortcuts during the placement process.
Group undo will undo all of the operations, include any nested subcommands, as a part of a
single Undo operation. Repeated commands, such as placing a wire, then another wire, and so
on, are all undone if Group Undo is enabled – disable it to remove only the last wire with each
Undo.
Cursor section
Cursor Type
Three options are available for the shape of the physical (or sheet) cursor — a large 90-degree
cross that extends to the edges of the window, a small 90-degree cross or a small 45-degree
cross. The sheet cursor is displayed when executing commands.
Use this page to configure the Mouse Key+Wheel combinations that can be used to operate
zooming, scrolling and switching channels on a multi-channel design.
Hints Display
Information about errors and warnings can be displayed in floating hint boxes, when the cursor is
held over the object in error/warning.
Auto Junctions
Junctions are automatically added at all valid connection points, their display is controlled by
these options.
The autofocus tab is used to configure a number of options that control the state of the schematic
display.
It can, for example, be configured to automatically zoom when editing text on the schematic sheet
(enable the Zoom Connected Objects – On Edit in Place & Only Text options), or to dim all
wiring not related to the wire currently being placed (enable the Dim Unconnected Objects – On
Place option).
Figure 12. Use the autozoom options to control how a component is auto-zoomed when you switch
components
Grid Color
The visible grid can be assigned a default color. To assign a new color to the visible grid, click in
the color box to open the Choose Color dialog. The Schematic Editor will display all the available
colors that your computer’s graphics adapter supports.
Presets buttons
These buttons present a number of pre-defined grid-cycle options.
The schematic editor includes a Break Wire command (Edit menu), which is used to cut an
existing wire or bus (it is also available in the wire right-click menu). These settings control the
break wire behavior.
This tab allows you to set the default state of the properties of each object. Objects take on the
property settings defined here when they are placed (these settings do not affect objects that
have already been placed). Remember that you can also change these property settings by
pressing the TAB key before placing the object.
If you enable the Permanent option, default values will not be updated when you press the TAB
key to change the properties of a placed object.
Orcad Ports
When the Mimic Orcad ports option is enabled, existing ports in a schematic design/project have
their width recalculated based on the number of characters in their name and the size of the port
is restricted from being manually edited.
3.4.1 Locating and loading libraries when the required library is known
The training design is a microcontroller driven temperature sensor. To install one of the supplied
libraries and see if it includes a PIC microcontroller library, complete the following steps:
1. Open a schematic document to activate the Schematic Editor.
2. Click the Libraries button on the Libraries panel to display the Available Libraries dialog.
3. Select the Installed tab of dialog, then click the Install button and navigate to the \Program
Files\Altium Designer 6\Library\directory. This directory contains sub directories
containing the integrated libraries supplied with Altium Designer’s Schematic Editor.
4. Scroll down through the library directories. Open the Microchip folder, select and add the
Microchip Microcontroller 8-Bit PIC16 2.IntLib.
5. Click the Close button to close the Available Libraries dialog.
6. Select this Microchip library in the list of libraries at the top of the Libraries panel. The library’s
contents will be displayed in the box below the Filter field section. Confirm that the library
includes a PIC16C72-04/SO.
Note: Refer to the Component, Model and Library Concepts article in the online documentation
for further information on definitions, library search order and component to model linking.
1. If it is not already open, re-open the project created during the Environment and Editor Basics
training session, \Program Files\Altium Designer
6\Examples\Training\Temperature Sensor\Temperature Sensor.PrjPcb.
2. Add a new schematic document to the project, to do this right-click on the project file name in
the Projects panel and select Add New to Project » Schematic.
3. Right-click on the new schematic sheet in the Projects panel, and select Save As from the
context menu. Save the schematic as MCU.SchDoc in the \Program Files\Altium
Designer 6\Examples\Training\Temperature Sensor folder.
4. Set the template for your schematic to A4.SchDot by choosing Design » Template » Set
Template File Name and choosing the A4 size template from \Program Files\Altium
Designer 6\Templates folder.
5. Verify that the electrical grid is on and set to 4 and that the snap grip is on and set to 10
before placing any objects (double-click in the sheet border to open the Document Options
dialog).
6. Draw up the schematic shown in Figure 22 above. When placing the components, press TAB
to define the Designator and Comment (component value) before placing the component.
Component Library Reference
Microcontroller PIC16C72-04/SO
Resistors Res1
Capacitor Cap
7. To rotate a component press the SPACEBAR, press the Y key to flip it vertically, and the X key
to flip it horizontally.
8. Set the Port I/O Type to match their display Style. Set the Ground Style power port net
attribute to GND.
Figure 23. Buses are defined using the referencing system shown.
11. Enter the necessary document information in the Parameters tab of the Document Options
dialog. Enter the title as PIC Microcontroller and the Sheet No. as 2 of 5.
However, the Sensor.SchDoc is incomplete, so far it only has the temperature component on it.
To complete it:
1. Add the Ports, Power Ports and Wiring to finish the schematic, as show in Figure 25.
2. Save and close the Sensor.SchDoc sheet.
The last step to complete the sensor design is to add the top schematic sheet.
port
• Power Port – All power ports with the same
name are connected throughout the entire Figure 27. Net identifiers
design.
• Hidden Pin – Hidden pins behave like power ports, connecting globally to nets of the same
name throughout the entire design.
Note: Two special net identifier objects are always deemed to be global: power ports and
hidden pins.
Summary
• If you are using sheet symbols with sheet entries, the net identifier scope should be set to
Sheet Entries/Port Connections. If this mode is chosen, the top sheet must be wired.
• If you are not, connectivity can be established via Ports and/or Net labels, so you will use one
of the other two net identifier scopes.
• Net labels do not connect to ports of the same name.
5.3.1 Exercise – creating the top sheet for the Temperature Sensor project
Refer to Figure 26 to complete this exercise.
1. To create the top sheet, add a new schematic document to the Temperature Sensor project,
set the template to A4 and save it as Program Files\Altium Designer
6\Training\Temperature Sensor\Temperature Sensor.SchDoc.
2. Rather than manually placing sheet symbols and editing them to reference the lower sheets,
we will use the Design » Create Sheet Symbol from Sheet or HDL command. Select this
command from the menus.
3. In the Choose Document to Place dialog, select Sensor.SchDoc.
4. You will be asked if you want to Reverse Input/Output Directions, if you say No the IO Type
of the Sheet Entries will match the Ports on the sheet below, if you say Yes they will be
reversed. Choose the No option.
5. The sheet symbol will appear floating on the cursor. Place the sheet symbol in an appropriate
position on the sheet, as shown in Error! Reference source not found..
Figure 28. The project hierarchy is displayed once the project has been compiled.
13. Save the Project (right-click on the project in the Projects panel)
The design is now complete. However, before it can be transferred to PCB layout there are a
few other tasks to complete, these include:
- Assigning the sheet numbers for each sheet in the hierarchy
- Assigning the designators
- Checking the design for errors
Figure 29. Use the Sheet Numbering feature to review and update sheet numbers.
Note: Schematics appear in the Projects panel in the order they were added to the project. You
can change this order if you want, simply click, drag and drop to re-order them.
Figure 30. Use the Synchronize dialog to ensure that sheet entries match with ports. Uncheck the checkbox
down the bottom left to show all sub-sheets in the entire design.
Note: To prevent a component from having its designator changed by the Annotation process,
enable the Locked checkbox adjacent to the Designator in that component’s Component
Properties dialog.
Note: To prevent multi-part component parts being swapped during the annotation process
enable the Locked checkbox adjacent to the Part selector in the Component Properties dialog.
Some tips
• Examine each of the objects associated with the error.
• Enable the Graph option to examine the connectivity of a net. Once a net is selected in the
Navigator panel, it is highlighted throughout the design. You can also ALT+click on a net to
highlight it on the current sheet.
• Errors with input pins are often due to problems with their source. If the input looks OK, trace
the signal back to the source (output pin / port).
Note: To open a sub-sheet, hold CTRL as you double-click on the sheet symbol.
Figure 36. The Comparator options define what information is transferred to PCB.
By default, all options are on. For a simple design such as the training design, you might not want
Placement Rooms to be created for each schematic sheet.
Figure 37. Parameters can are added to schematic components via their Properties dialogs in the
Schematic Editor or the Schematic Library Editor.
• System-level parameters are special strings which have the suffix = before the parameter
name, such as =CurrentDate or =Revision. These can be added to your sheet’s title block and
are updated through the Parameters tab of the
Document Options dialog (Design »
Document Options). See 2.1.2 Parameters
tab for more information. You can update
system-level parameters in multiple documents
by using the Parameter Manager.
• Parameters are used to define PCB rules on
the schematic. Where you add the parameter
dictates the scope of the PCB rule that is
created – for example a Parameter attached to
a wire will create PCB rule that applies to that
net (). Whereas attaching the parameter to a
bus would result in a PCB design rule that
targets a NetClass.
• To define a rule targeting a net, select Place »
Directives » PCB Layout from the menus. Figure 38. Define PCB rules on the schematic
using parameters.
Figure 39. Include project parameters in your BOM by defining Fields in the Excel template.
• When you modify a parameter, markers in the right-hand top corner of the cell indicates what
changes will be made.
the parameter will be added to the object but, in this case, no value will
be assigned.
• Note that any changes made within the table are virtual changes that will not be implemented
until the execution of an Engineering Change Order.
• Press F1 in the Parameter Manager dialogs for more information.
• Right-click in the preview window and select Page Setup to configure the scaling and color.
• Right-click in the preview window and select Printer Setup to configure the target printer,
which documents to print (current or all), the number of copies, and so on.
• Right-click in the preview window to Copy the active document to the clipboard, or save it as
a metafile.
Note: Schematic printout setups can be defined in a project OutJob file. This is handy if you
need a number of different configurations of printouts for a project.
2.1.2 MiniViewer
The MiniViewer is located at the bottom of the
panel and provides an overview of the workspace.
The double-lined rectangle indicates the current
region being displayed in the workspace.
The MiniViewer also has the following display
control functions:
• Click and drag in the rectangle to pan around
the workspace.
• Click and drag on a corner of the rectangle to
change the magnification of the workspace.
Editing options
Online DRC
When checked, any design rule violations are flagged as they occur. The design rules are defined
in the PCB Rules & Constraints Editor dialog (select the Design » Rules menu command).
Snap to Center
When checked, the cursor snaps to the centre when moving a free pad or via, snaps to the
reference point of a component, or snaps to the vertex when moving a track segment.
Remove Duplicates
With this option enabled, a special pass is included when data is being prepared for output. This
pass checks for and removes duplicate primitives from the output data.
Eight selection memories are available – click the button at the bottom of the workspace to
display the Selection Memory controls (press F1 over the panel for details of the shortcuts for
using the selection memory). The Selection Memories work just like a calculator — the selection
state of objects can be stored, recalled and added to on storage or recall. Enable this option to
display a warning dialog when the contents of a section are to be cleared.
Shift+Click to Select
Rather than simply clicking on an object to select it, you can configure Altium Designer to require
that the SHIFT key must be depressed when clicking to select it. Press the Primitives button to
choose which objects will require Shift+Click to select. Popular choices include rooms, polygons
and components.
Rotation Step
When an object that can be rotated is floating on the cursor, press the SPACEBAR to rotate it by
this amount in an anti-clockwise direction. Hold the SHIFT key while pressing the SPACEBAR to
rotate it in a clockwise direction.
Cursor Type
Set the cursor to a small or large 90-degree cross, or a small 45-degree cross.
Component Drag
This option determines how connected tracks are dealt with when moving a component. When
Connected Tracks is selected, tracks drag with the component; otherwise, they do not.
- If the Connected Tracks option for components is set, components cannot be rotated
while being moved.
Autopan options
Style
If this option is enabled, Autopan becomes activated when there is a crosshair on the cursor.
There are six Autopan modes:
• Re-Center — re-centers the display around the location where the cursor touched the window
edge. It also holds the cursor position relative to its location on the board, bringing it back to
the centre of the display.
• Fixed Size Jump — pans across in steps defined by the Step Size. Hold the SHIFT key to pan
in steps defined by the Shift Step Size.
• Shift Accelerate — pans across in steps defined by the Step Size. Hold the SHIFT key to
accelerate the panning up to the maximum step size, defined by the Shift Step Size.
• Shift Decelerate — pans across in steps defined by the Shift Step Size. Hold the SHIFT key to
decelerate the panning down to the minimum step size, defined by the Step Size.
• Ballistic — pans at maximum speed.
• Adaptive — pans at the rate set in the Speed field.
Speed
When Adaptive is enabled, the panning speed for Autopanning is set in mils/sec or pixels/sec.
Polygon Repour
This has three options for determining whether a polygon repours when edited:
• Never — no automatic repour.
Redraw Layers
Forces a screen redraw as you toggle through layers with the current layer being redrawn last
Transparent Layers
Gives layer colors a ‘transparent’ nature by changing the color of an object that overlaps an object
on another layer, allowing objects that would otherwise be hidden by an object on the current
layer to be readily identified. The background color changes to black for easier viewing.
Show section
The check boxes in this section perform the following when checked.
Testpoints Displays testpoints
Origin Marker Displays the Origin Marker
Status Info Displays information about the object under the cursor in the status bar
Strings
The number entered in this field determines which strings are displayed as text and which are
displayed as an outline box. Strings that are placed at or greater than the height entered in pixels
(default 11) will be displayed as text; strings that are placed at a lesser value will be represented
by an outline box.
Pad Numbers
Enable this option to show the pin numbers for all pads
Via Nets
Enable this option to show the Net name for all vias.
Font Name
The font to be used to display the Pad and Via details. This setting is not used if the Smart
Display Color option is enabled.
Font Style
The font style to be used to display the Pad and Via details. This setting is not used if the Smart
Display Color option is enabled.
Available
Select which Single Layer Modes to cycle through when pressing SHIFT+S in the PCB editor.
• Hide Other Layers
2. Enable this option to include the Hide Other Layers as an available single layer mode
option. The SHIFT+S keyboard shortcut cycles through the available layer modes.
• Gray Scale Other Layers
3. Enable this option to include the Grey Scale Other Layers as an available single layer
mode option. The SHIFT+S keyboard shortcut cycles through the available layer modes.
• Monochrome Other Layers
Note: The available Single Layer Modes here are shared with and set the same for the Board
Insight Lens although they maintain a separate setting for the current mode they are in.
Display Section
Display Heads Up Information
Enable this option to display context-sensitive information in your workspace. The information
that is displayed can be controlled with the Browse Mode settings. Most of this information is
already displayed in the status bar, however you can now raise your head up and look at this
information in the same area that you are working.
Heads Up Transparency
Slide this bar to the right increases the level of transparency of the Heads Up display, making it
less visible.
Hover Transparency
If you pause for a moment as you are moving the cursor, the Heads-Up display will switch to
Hover mode. In Hover mode extra information is displayed, this can include a summary, available
shortcuts, rule violations, net, component and primitive details. This setting determines the
transparency of the Heads Up Display when it enters Hover Mode.
Configuration section
Visible
Enable this option to activate the Board Insight Lens facility and you can see magnified objects in
this lens facility from where the cursor is hovering on the PCB document.
X/Y Size
Click on the up or down arrow buttons to increment the X or Y coordinate by 10 units at a time to
change the size of the Board Insight Lens. Or use the slider to the right to adjust these values
Behavior section
Zoom Main Window to Lens When Routing
Enable this option and the Insight Lens is not displayed when auto-routing.
Animate Zoom
Enable this setting to adjust the zoom of the Insight lens as the zoom level of the main board is
adjusted.
Content section
Zoom
Click on the up or down arrow buttons to increment the zoom factor by 10 units at a time, or use
the slider on the right, to change the size of the viewable contents of the PCB document captured
by the Board Insight Lens.
Note: The Board Insight Lens maintains its own separate Single Layer Mode apart from the PCB
Editor, although they share the same Available Single Layer modes from the Board Insight
Display section
Auto Complete
With this option enabled the Smart Interactive Router will try to complete the connection to the
target with the look-ahead segments.
Note: Automatic Loop Removal can be disabled on an individual net to allow loops to be created
on that specific net. Access the net properties to alter this setting. An example of when this
would be necessary would be when a ground loop needs to be created.
Note: You can cycle between the above modes while interactive routing by pressing the 3 key.
Substitution font
The selected font will be used in those cases a PCB file is opened which has true type fonts
which are not installed in your computer.
This is a list of mouse wheel configurations (a mouse that normally has a wheel between two mouse
buttons) for various actions on a PCB document such as Ctrl key and mouse wheel to zoom in or out
on the main PCB window.
To modify the mouse wheel configuration, you can toggle the keyboard buttons as well as the
wheel/wheel click for each action.
Measurement Unit
Sets the coordinate system to either metric or imperial.
Snap X X value for the snap grid
Snap Y Y value for the snap grid
Component X X value for the component grid
Component Y Y value for the component grid.
Electrical Grid
When the electrical grid is enabled and you are executing a command which supports the
electrical grid and you move the cursor within the Grid Range value of an object assigned to a
net, the cursor will jump to that object.
Visible Grid
Sets the size and style of the visible grids.
Sheet Position
The sheet is a calculated object, drawn to represent the printed page. The sheet size can either
be defined by the Size and Location settings in this dialog, or it can be linked to the contents of
mechanical layer(s). If it is linked to the contents of mechanical layer(s), you can use the Design
» Board Shape » Auto-position Sheet command to recalculate it when the contents of the linked
mechanical layers change.
Typically, the linked mechanical layers would be used for drawing detail that is required on the
printout. Another advantage of linking the sheet to mechanical layers is that both the sheet and
the mechanical layers can be hidden by disabling the Display Sheet option.
Designator Display
The designator display can be either the logical designator shown on the schematic or the
physical designator assigned when the design is compiled. Normally, these are the same except
in a multi-channel design when the physical designator includes channel identifier information.
Note: Press the accelerator key in brackets () next to the layer name to toggle that layers show
property while in this dialog
Mechanical Layers
There are 16 mechanical layers, disable the Only Show Enabled option to display the entire set
and enable a new mechanical layer for this PCB. Press F2 to edit the name of a mechanical layer.
Layer Pairs
Layer pairs are mechanical layers that have been associated to handle layer-specific component
data. For example, if you have component footprints that require glue information, define this on a
mechanical layer in the Library Editor, then pair this mechanical layer with another. When the
footprint is flipped to the bottom of the board, the information on the first mechanical layer is
automatically transferred to the paired mechanical layer.
Color Sets
The Default Color Set button sets the colors to the default settings with a pale yellow
background. Default colors cannot be used if the Transparent Layers option (Display tab) is
selected. The Classic Color Set button sets the colors to the traditional black background setting.
2.7 Grids
Figure 20. A new PCB created by using the New from Template option.
Figure 21. Board shape (black region) and keep out boundary for the 4 Port Serial Interface example PCB.
The row of small fills is there to prevent routing between the contacts of the edge connector.
6. When the Import from AutoCAD dialog appears, set the following:
7. Set the Scale to inch (the imported shape should be approximately 2021mil x 2755mil)
8. In the Layer Mapping, map the source DXF layer to mechanical layer 4
9. Set the Insertion Point to something sensible, for example X=1000, Y=1000. The value is
not crucial, as you will move it after importing.
10. leave other options at their defaults
Note: If there are large scale net connectivity changes it can be easier to clear the netlist in the
PCB editor, the synchronisation process will reload them all. You will then need to reapply the
net information to any routing, to do this use the Update Free Primitives from Component
Pads command (Design » Netlist).
Figure 23. Advanced mode chosen in the Choose Documents to Compare dialog
• Select the required Netlist on one side and the PCB on the other. The Netlist must either be
open in Altium Designer or included in the Project.
• When you click OK, the Confirm dialog will indicate that it is unable to match using UIDs. Click
Yes to proceed using designators to match by.
• The Difference dialog will appear from where the process is the same as direct
synchronization.
1. In the Libraries panel, click the button to open the Available Libraries dialog. This
dialog shows all libraries that are currently available to you.
2. Confirm that the Temperature Sensor.PcbLib is listed in the Projects tab.
3. In the Installed tab, confirm that the following libraries are installed:
• Microchip Microcontroller 8-Bit PIC16 2.IntLib
• ON Semi Power Mgt Voltage Regulator.IntLib.
• Chip Resistor - 2 Contacts.PcbLib (for the 0805 footprint, the library is in the
\Library\PCB sub-folder)
4. The 2 default libraries must also be installed, Miscellaneous Devices.IntLib and
Miscellaneous Connectors.IntLib. If these have been uninstalled, they can be found
in the root of the \Altium Designer 6\Library folder.
5. Select Design » Import Changes from Temperature Sensor.PrjPCB from the PCB editor
menus. The ECO dialog displays, listing all the changes that must be made to the PCB so
that it matches the schematic. Note that you do not need to open the schematic sheets, this is
handled automatically.
6. Scroll down through the list of changes, they should include adding 20 components, 22 nets,
5 component classes, 1 net class and 3 design rules. Click on Validate Changes to check
the changes are valid.
7. Click on Execute Changes to transfer the design data. Close the ECO dialog.
8. The components will be placed on the new PCB, positioned to the right of the board outline.
9. Save the board.
Note: If you did not complete the exercises during the Environment & Editor Basics, Creating
Components or the Schematic Capture sessions, you can copy the following project and
schematic documents (located in the Training\Backup folder) to the Temperature Sensor
folder and then complete this exercise:
- Temperature Sensor.PRJPCB
- Temperature Sensor.SchDoc
- MCU.SchDoc
- Sensor.SchDoc
Figure 24. Define the required electrical layers in the Layer Stack Manager dialog.
• Layer display and the control of other non-electrical layers are done in the Board Layers and
Colors dialog (Design » Board Layers & Colors).
Figure 25. Control the display of layers in the Board Layers and Colors dialog.
Signal Layers
There are 32 signal layers that can be used for track placement. Anything placed on these layers
will be plotted as solid (copper) areas on the PCB. As well as tracks, other objects (e.g. fills, text,
polygons, etc.) can be placed on these layers. The signal layers are named as follows:
Top Layer Top signal layer
MidLayer1 to MidLayer30 Inner signal layers
Bottom Layer Bottom signal layer
Signal layer names are user-definable.
Internal Planes
Sixteen layers (named Internal Plane 1–16) are available for use as power planes. Nets can be
assigned to these layers and multi-layer pads and vias automatically connect to these planes.
Plane layers can be split into any number of regions, with each region being assigned to a
different net. Nested split planes are supported. Internal Plane layer names are user-definable.
Internal planes are designed and output in the negative, objects that are placed on the plane
define regions of no copper.
Silkscreen layers
Top and Bottom Overlay (silkscreen) layers are typically used to display component outlines and
component text (designator and comment fields that are part of the component description).
Mechanical layers
Sixteen mechanical drawing layers are provided for fabrication and assembly details, such as
dimensions, alignment targets, annotation or other details. Mechanical layer items can be
automatically added to other layers when printing or plotting artwork. Mechanical layer names are
user-definable. Mechanical layers can also be paired; use this when creating library components
that require side-of-board layer-related information, such as glue dots.
Solder Mask
Top and bottom Solder Mask layers are provided for creating the artwork used to make the solder
masks. These automatically generated layers are used to create masks for soldering, usually
covering everything except component pins and vias. You can control the expansions for these
masks when printing/plotting by including a Solder Mask Expansion rule, or the manual override
feature in the pad/via dialogs. Refer to the Design Rules section for more information on the
Solder Mask Expansion rule. User-defined openings in the mask can also be created by placing
design objects directly on the mask layer. These layers are designed in the negative, the visible
objects become openings in the mask.
Paste Masks
Top and bottom Paste Mask layers are provided to generate the artwork which is used to
manufacture stencils to deposit solder paste onto surface mount pads on PCBs with surface
mount devices (SMDs). The size of the paste deposit is controlled by Paste Mask Expansion rule,
Drill Drawing
Coded plots of board hole locations are typically used to create a drilling drawing that shows a
unique symbol for each hole size at each hole location. Individual layer pair plots are provided
when blind/buried vias are specified. Three symbol styles are available: coded symbol;
alphabetical codes (A, B, C etc.) or the assigned size.
Drill Guide
A drill guide plots all holes in the layout. Drill guides are sometimes called pad masters. Individual
layer pair plots are provided when blind/buried vias are specified. These plots include all pads and
vias with holes greater than zero (0) size.
Multi-layer
Objects placed on this layer will appear on all copper layers. This is typically used for through-
hole pads and vias, but other objects can be placed on this layer.
System section
The options described below cannot have objects placed on them but they are turned on or off in
the System Colors section of the Board Layers & Colors dialog.
DRC Errors
This option controls the display of the Design Rule Check (DRC) error marker.
Connections
This option controls the display of the connection lines. The PCB Editor displays connection lines
wherever it locates part of a net that is unrouted.
Visible Grids
Controls the display of the two visible grids.
The Layer Stack Manager allows you to visualize the ‘stack up’ of your PCB, i.e. the relationship
between copper, substrate and Prepreg. A picture of your layer stack can be copied to the
Windows clipboard and pasted into project documentation by right-clicking and selecting Copy to
Clipboard.
Figure 27 Define the drill pairs if the board uses blind/buried vias
Figure 28. Setting up Mechanical Layers in the Board Layers & Colors dialog.
• The Show check box allows you to control the display of a mechanical layer.
• When checked, the Display In Single Layer Mode check box causes that layer to be
displayed when Single Layer Mode is invoked (SHIFT+S).
• Check the Linked to Sheet check box to relate a mechanical layer to the white sheet object.
Related mechanical layers are then hidden when the Display Sheet option is disabled (Board
Options dialog). They are also used to determine the extents of the sheet when the Auto-
position sheet option is chosen in the Board Shape sub-menu.
Figure 29. Split planes on an Internal plane layer with the Split Plane dialog showing the net assignment for
the large split region (Peak Detector With Banking.PcbDoc).
Figure 31. The scope of the rule defines the objects it targets. This rule targets the 3V3 net.
7.2.4 Query errors Figure 32. Use the Query Builder to construct the rule query.
Figure 33 After adding a rule, make sure that the priority is appropriate
In Figure 33 a routing via style rule for the bus D[0..7] has been added (RoutingVias_DBus). Note
that it has a rule priority of 1 (the highest priority). If it had a priority lower than the RoutingVias
rule, which has a scope of All, it would never be applied.
Figure 34. DRC Report Options in the Design Rule Checker dialog.
Figure 35. Use the Object Class Explorer to create and manage Object Classes.
Objects in the PCB document can be selected by class in the PCB panel.
7.6 From-tos
The PCB Editor allows commands to operate on a particular pin-to-pin connection in a net, in a
different manner to the rest of the net. A specific pin-to-pin connection is defined as a from-to.
Commands will operate on a from-to if a design rule for that from-to has been defined.
From-tos are created using the From-To Editor. Select From-To Editor in the PCB panel to
display this editor.
The top region of the panel lists all nets in the design. Click on a net to list that nets nodes in the
Nodes on Net region of the panel. When you click on any two nodes in the net (use CTRL+Click
to multi-select), the Add From To button will be enabled. When this is clicked, the new from-to
will appear in the From-Tos on Net section of the panel.
The Generate button allows you to create from-tos for a complete net in the pattern of the
selected topology.
The Rules to Check sections of this dialog enables you to select which design rules the DRC will
check for violations. Click on the Run Design Rule Check button to start a DRC check on the
PCB. A report (.DRC) is generated and displays in the Text Editor if the Create Report File option
is enabled.
Note: Make sure that all used layers are on when you are trying to resolve design rule violations.
You should also be aware that the DRC stops after 500 errors (default value).
8.3.2 Rooms
A room is a region that defines an area where
components can either be kept within or kept out.
• Rooms are placed using the commands in the
Design » Rooms sub-menu, or using the Room
tools on the Utilities toolbar.
• A Room Definition design rule is created for each room that is placed. Once a room definition
object is placed, you define the components associated with it and whether they are to be kept
in or kept out. To do this, double-click on the room to display the Room Definition dialog. This
dialog can also be accessed in the Placement region of the Rules dialog. Set the scope of the
rule to the required component, component class or footprint.
Moving rooms
• Once component(s) have been assigned to a room, they move when the room is moved. To
move a room without moving the components, temporarily disable the Room Definition rule in
the Placement section of the PCB Rules& Constraints dialog.
• If a component is moved such that it is in violation of the Room Definition rule, it is displayed
with a Design Rule Check (DRC) error marker.
Note: The Cluster Placer adheres to the Placement rules defined in the PCB Rules and
Constraints dialog.
Statistical Placer
The Statistical Placer uses a statistical algorithm to place the components in an attempt to
minimize the connection lengths. As it uses a statistical algorithm, it is best suited to designs with
more than 100 components.
8.6 Re-Annotation
The PCB Editor provides the Re-
Annotation command to re-
number component designators,
so that they are numbered in
some kind of order. To do this,
choose the Tools » Re-
Annotate menu command. This
displays the Positional Re-
Annotate dialog shown in Error!
Reference source not
found.39. You select the method
by which you want the re-
annotation to be performed and
then click OK.
Figure 39. Positional Re-Annotate dialog
Alternatively, you can edit
individual component designators by double-clicking on the component.
Note: Update the Schematic with the designator changes using the Synchronizer. To do this,
select Design » Update Schematic.
Figure 40. One possible component placement for the Temperature Sensor board.
1. The board does not need to be placed exactly as shown, this is only one solution.
2. As you press the spacebar to rotate components, you will notice that the designator remains
positioned above the top left of the component. This is controlled by the Designator
Autopostion option in the Component dialog. To manually position a designator, click and
drag it to the required location, pressing the spacebar to rotate it if required. To temporarily
filter out all objects in the workspace except the designators, type the query IsDesignator into
the Query editor at the top of the PCB List panel. Press Shift+C to clear this filter when
finished.
3. Each component also has a Comment string, you control the display of this in the Component
dialog. To toggle the Hide status of all comment strings, enter the Query IsComment into the
Filter panel (confirm that the Select check box is enabled in the Apply button dropdown), then
press F11 to open the Inspector. The Inspector can now be used to edit all selected Comment
strings, toggle the state of the Hide checkbox and press ENTER on the keyboard.
4. There is a placed copy of the board in the Backup folder. You can use this as a reference.
5. Save the board when you have finished but do not route it yet.
Note: You can cycle between the above modes while interactive routing by pressing the 3 (for
Track Width) or 4 (for Via Size) shortcut keys, the current setting is indicated on the Status bar.
Note: Press the Shift+R shortcut keys to cycle through the different modes while you are
routing, keep an eye on the status bar to see which mode you are currently in.
Note: Automatic Loop Removal can be disabled on an individual net if you require routing loops
in that net. Double-click on the net name in the PCB panel to access the net properties to alter
this setting.
Note: The look-ahead mode can be toggled off and on while interactively routing by pressing the
1 key. If look-ahead is off each click will place both track segments.
Figure 47. a differential pair being routed, note that both connections in the pair are routed simultaneously.
Note: for more information on Altium Designer’s differential pair routing capabilities, refer to the
application note, Interactive and Differential Pair Routing.
Figure 49. Custom routing strategy using cheaper vias and orthogonal routing
Net Options
• Connect to Net – selects the net to be connected to the polygon.
• Pour Over options – existing polygons, or existing polygons and existing tracks within the
polygon which are part of the net being connected to can be covered by the new polygon.
• Remove Dead Copper – removes any part of the polygon that cannot connect to the plane
net.
Properties
• Layer – select the signal layer that the polygon is to be placed on.
• Min Primitive Length – Tracks or arcs below this setting are not placed when pouring a
polygon.
• Lock Primitives – if unchecked, individual objects (i.e. tracks or arcs) that make up the plane
can be deleted.
1. Place a solid polygon on the top layer covering the entire PCB, connected to net GND, with the
Pour Over All Same Net Objects option selected.
2. Perform a final design rule check (DRC) to ensure there are no problems with your board.
Refer to section 7 to refresh your memory on checking the design rules.
3. Save the board.
Figure 52. A Output Job file with three output setups defined.
• Selected setups can be deleted (CTRL+A to select all) and new outputs can be added at any
time by clicking on the required Add New Output.
• Double-click on an output to configure it in its Properties dialog, or right-click for a list of
options. The Data Source and Variants columns also have a drop-down list to choose from —
click once to select the item, then click a second time to display the down arrow and then
select from the list.
• Click on the Preferences button to set the colors and layers to include in the printout.
• Right-click on the print option in the Output Job file to configure which printer your output will
print to (Printer Setup) as the printouts will be sent directly to that printer when you run the
output generator.
• Right-click and select Print Preview to view your printout. From the preview window you can
copy the current Printout preview to the Windows clipboard by right-clicking and selecting
Copy. You can also save the image as an Enhanced Windows Metafile (.emf) by right-
clicking and selecting Export Metafile.
• When the printout is configured, you can run it as a batch job (if Batch is enabled) along with
all the other setups (F9), run the current output generator (SHIFT+F9) or run a selection of
output generators (CTRL+SHIFT+F9). These output options are also available in the right-click
menu. The printouts are sent to the printer.
11.3.2 Gerber
This option in the Job Output file produces a Photoplotter output in Gerber format. Double-clicking
on a Gerber Files output displays the Gerber Setup dialog. Consult your PCB manufacturer for
their preferred settings.
Module 5
Altium Designer Training Module FPGA Design
i
Altium Designer Training Module FPGA Design
ii
Altium Designer Training Module FPGA Design
1 FPGA Design
The primary objective of this day of training is to make participants proficient in the process of
developing, downloading and running an FPGA design on the NanoBoard. We will go through the
FPGA design framework and demonstrate just how simple FPGA design is with Altium Designer.
FPGA FPGA
FPGA Build
Project Schematic
Process
Creation Extensions
FPGA design
built and
loaded onto
NanoBoard
NanoBoard FPGA
Concepts Instruments
5-1
Altium Designer Training Module FPGA Design
FPGAs have traditionally found use in high-speed custom digital applications where designs tend to
be more constrained by performance rather than cost. The explosion of integration and reduction in
price has led to the more recent widespread use of FPGAs in common embedded applications.
FPGAs, along with their non-volatile cousins CPLDs (Complex Programmable Logic Devices), are
emerging as the next digital revolution that will bring about change in much the same way that
microprocessors did.
With current high-end devices exceeding 1000 pins and topping 1 billion transistors, the complexity
of these devices is such that it would be impossible to program them without the assistance of high-
level design tools. Altera and Xilinx both offer high-end EDA tool suites designed specifically to
support their own devices however they also offer free versions aimed at supporting the bulk of
FPGA development. Both Altera and Xilinx understand the importance of tool availability to
increased silicon sales and they both seem committed to supporting a free version of their tools for
some time to come.
Through the use of EDA tools, developers can design their custom digital circuits using either
schematic based techniques, VHDL or a mixture of both. Prior to the Altium Designer system,
vendor independent FPGA development tools were extremely expensive. Furthermore they were
only useful for circuits that resided within the FPGA device. Once the design was extended to
include a PCB and ancillary circuits, a separate EDA tool was needed. Altium Designer has
changed all of this by being the first EDA tool capable of offering complete schematic to PCB tool
integration along with multi-vendor FPGA support.
Altium made the logical extrapolation of recent trends in the FPGA world and recognized that FPGAs
are no longer just for high-end designs. By making available a number of processor cores that can
be downloaded onto an FPGA device and bundling them with a complete suite of embedded
software development tools, Altium Designer represents a unified PCB and embedded systems
development tool. FPGAs are here to stay and Altium Designer ensures that you can make the leap
to the new world of digital integration with minimal pain.
5-2
Altium Designer Training Module FPGA Design
A PCB Project may contain one or more FPGA projects but never the other way around. If you think
about it you will recognize that it is quite intuitive; a PCB contains FPGAs whereas an FPGA can’t
contain a PCB. Similarly, an FPGA could contain one or more custom FPGA cores or
5-3
Altium Designer Training Module FPGA Design
microprocessor softcores. A unique Core Project will define each FPGA core component and a
unique Embedded Project will define the software that executes on each of the softcores.
The simplest way to create a project is from the File menu (File » New » Project).
5-4
Altium Designer Training Module FPGA Design
VHDL sub-documents are referenced in the same way as schematic sub-sheets, by specifying the
sub-document filename in the sheet symbol that represents it. The connectivity is from the sheet
symbol to an entity declaration in the VHDL file. To reference an entity with a name that is different
from the VHDL filename, include the VHDLEntity parameter in the sheet symbol whose value is the
name of the Entity declared in the VHDL file (as shown above).
5-5
Altium Designer Training Module FPGA Design
5-6
Altium Designer Training Module FPGA Design
Figure 10. Join buses of different widths, and control the net-to-net mapping
Read the flow of nets through a JB-type bus joiner by matching from the nets in the attached bus, to
the first index on the bus joiner, to the second index in the bus joiner, to the nets defined in the
second bus net label.
Left Bus ↔ IndexA ↔ IndexB ↔ Right Bus
The rules for matching nets at each of the ↔ points are as follows:
Figure 11. An example of using the JB bus joiner to achieve sub-set mapping
• If both bus ranges are descending, match by same bus index (one range must lie within the other
for valid connections). In Figure 11 the matching is:
ADDR9 ↔ IndexA9 ↔ IndexB9 ↔ ROMADDR9, thru to
ADDR0 ↔ IndexA0 ↔ IndexB0 ↔ ROMADDR0
5-7
Altium Designer Training Module FPGA Design
• If one bus range is descending and another is ascending, the indices are matched from left to
right. In Figure 13 the matching is:
INPUTS0↔ IndexA15 ↔ IndexB31 ↔ PORTB31, thru to
INPUTS15 ↔ IndexA0 ↔ IndexB16 ↔ PORTB16
Figure 14. Another example of using a bus joiner for range inversion
5-8
Altium Designer Training Module FPGA Design
• ARM7, ARM9, ARM9E & ARM10E families, supported in the Sharp BlueStreak (ARM20T)
discrete processor family
5-9
Altium Designer Training Module FPGA Design
5 - 10
Altium Designer Training Module FPGA Design
NanoBoard Port-Plugin.IntLib
Name in Library Description Symbol
MEMORY0 Two 128k x 8 static RAM devices are RAM0_DATA[7..0]
included on the NanoBoard and
MEMORY1 wired directly to I/O pins on the
RAM_CS
IDT
71V124
SA15TYI
N0108M
have a common Chip Select and RAM0_WE
Address signals but separate 8-bit RAM0_OE
RAM0_DATA[7..0]
RAM1_DATA[7..0]
RAM_CS
RAM_ADDR[16..0]
RAM0_WE
256K SRAM
RAM1_WE
RAM0_OE
RAM1_OE
LCD_MEMORY1 LCD_RS
LCD_DB[7..0]
LCD_MEMORY256KX8
NEXUS_JTAG_ The Nexus, or soft devices chain, is JTAG_NEXUS_TDI
JTAG_NEXUS_TDO
CONNECTOR implemented in the FPGA design by JTAG_NEXUS_TCK
the inclusion of this connector. JTAG_NEXUS_TMS
source. SPI_MODE
ST 93228
SPI_SEL
SRAM0_OE
SRAM0_UB
SRAM0_LB
5 - 11
Altium Designer Training Module FPGA Design
CLK_OUT
OUTCTRL[5..0]
CAN
U? U?
EMAC Ethernet Media Access Controller –
CLK INIT CLK INIT
provides an 8-bit IEEE802.3 compliant
EMAC_MD interface between a processor and a DELAY[7..0] DELAY[15..0]
EMAC_MD_W standard Physical Layer device (PHY). FPGA_STARTUP8 FPGA_STARTUP16
EMAC_W U?
CLK INIT
DELAY[31..0]
FPGA_STARTUP32
U? U?
FPGA_STARTUP8 FPGA Startup – user-definable power-up
CLK INIT CLK INIT
delay, used to implement power-on reset. An
FPGA_STARTUP16 internal counter starts on power up, counting DELAY[7..0] DELAY[15..0]
FPGA_STARTUP32 the number of clock cycles specified by the FPGA_STARTUP8 FPGA_STARTUP16
Delay pin, the output pin being asserted
U?
when the count is reached.
CLK INIT
DELAY[31..0]
FPGA_STARTUP32
U?
I2CM I2C – parallel to serial interface,
CLK SDATA_EN
implementing an Inter-Integrated Circuit (I2C) RST SDATAO
2-wire serial bus on the serial side. SDATAI
Controllers only support a single master I2C DATAO[7..0]
DATAI[7..0] SCLK_EN
serial bus system. The I2C controller can be SCLKO
used in conjunction with the I2C interface ADDR[2..0] SCLKI
WR
hardware on the NanoBoard. RD
INT
I2CM
U?
KEYPADA Keypad Controller – 4 x 4 keypad scanner
CLK_1MHZ COL[3..0]
with de-bounce. Can be used in a polled or RST
interrupt driven system. Also available in ROW[3..0]
either Wishbone or non-Wishbone variants. KEY[3..0]
VALIDKEY
The Keypad controller can be used in
KEYPADA
conjunction with the keypad on the
NanoBoard.
U?
LCD16X2A LCD Controller – easy to use controller for a
CLK LCD_E
2 line by 16-character LCD module. The LCD RST LCD_RW
controller can be used in conjunction with the LCD_RS
LCD display on the NanoBoard. DATA[7..0]
ADDR[3..0] LCD_DATA_TRI
LINE LCD_DATAO[7..0]
LCD_DATAI[7..0]
BUSY
STROBE
LCD16X2A
5 - 12
Altium Designer Training Module FPGA Design
FPGA Peripherals.IntLib
Name in Library Description Symbol
U?
PS2 PS2 Controller – parallel to serial interface
CLK PS2CLKTRI
providing a bi-directional, synchronous serial RST PS2CLKO
interface between a host MCU and a PS/2 PS2CLKI
device (keyboard or mouse). The PS2 DATAO[7..0]
DATAI[7..0] PS2DATATRI
controller can be used in conjunction with PS2DATAO
either of the two sets of PS2 interface BUSY PS2DATAI
STROBE
hardware on the NanoBoard. INT
CLK_1MHZ
PS2
U?
SRL0 SRL0 – simple parallel to serial interface, full
CLK TX
duplex, single byte buffering. The SRL0 can RST RX
be used in conjunction with the RS-232
interface hardware on the NanoBoard. DATAI[7..0] RXO
DATAO[7..0]
ADDR[3..0]
WR
RD
INT
SRL0
U?
TMR3 TMR3 – dual timer unit, 16, 13 and 8-bit
CLK TA
timer/counter modes. RST GATEA
DATAI[7..0]
DATAO[7..0] TB
GATEB
ADDR[2..0] TB_OV
WR
RD
INT
TMR3
U?
VGA VGA – VGA controller that creates a simple
CLK HSYNC
method of implementing a VGA interface, RST VSYNC
presenting video memory as a flat address
space. Supports VGA and SVGA resolutions, RESOLUTION R1
CMOD[1..0] R0
and B&W, 16 and 64 color. Outputs digital DISPSIZE_H[9..0] G1
RGB and H+V sync. The VGA controller can DISPSIZE_V[9..0] G0
B1
be used in conjunction with the VGA output RD B0
on the NanoBoard. DATA[7..0]
ADDR_PIXEL[18..0]
VGA
U?
MAX1104_DAC DAC – This digital to analogue controller
CLK SPI_DOUT
module provides a simple interface to the RST SPI_DIN
MAX1104 8-bit CODEC device on the SPI_SCLK
NanoBoard. DATA[7..0] SPI_CS
MAX1104_DAC
U? U?
WR WR
U? U?
microcontroller such as the TSK80x, which CLK PAO[7..0] CLK PAO[7..0]
DATAI[7..0]
PBO[7..0] RST
DATAI[7..0]
PAI[7..0]
PBO[7..0]
PRTO2X8 WR
PRTO4X8
WR PCI[7..0]
U?
CLK TRISA[7..0] CLK TRISA[7..0]
RST PAO[7..0] RST PAO[7..0]
PAI[7..0] PAI[7..0]
DATAI[7..0] DATAI[7..0]
DATAO[7..0] DATAO[7..0] TRISB[7..0]
PBO[7..0]
ADDR ADDR[2..0] PBI[7..0]
WR WR
TRISC[7..0]
PRTIOX1X8
PCO[7..0]
PCI[7..0]
U?
CLK TRISA[7..0] TRISD[7..0]
RST PAO[7..0] PDO[7..0]
PAI[7..0] PDI[7..0]
DATAI[7..0]
PRTIOX4X8
DATAO[7..0] TRISB[7..0]
PBO[7..0]
ADDR[1..0] PBI[7..0]
WR
PRTIOX2X8
5 - 13
Altium Designer Training Module FPGA Design
CE CEO
PXX CLK_BRD C TC
U2 CLR U3
I0 U4 O[7..0]
PXX TEST_BUTTON A[7..0] GT LEDS[7..0]
CB8CEB I1
B[7..0] LT
INV I2 PXX,PXX,PXX,PXX,PXX,PXX,PXX,PXX
COMPM8B I3
ON
I4
SW[7..0]
1 2 3 4 5 6 7 8 I5
PXX,PXX,PXX,PXX,PXX,PXX,PXX,PXX I6
I7
J8S_8B
Figure 17. Place and wire the components to create the Pulse Width Modulator
5 - 14
Altium Designer Training Module FPGA Design
3. Using components from the two libraries FPGA Generic.IntLib and FPGA NanoBoard Port-
Plugin.IntLib, place and wire the schematic shown in Figure 17.
Component Library Name in Library
FPGA NanoBoard Port-Plugin.IntLib CLOCK_BOARD
PXX CLK_BRD
ON
PXX,PXX,PXX,PXX,PXX,PXX,PXX,PXX
U1
FPGA Generic.IntLib CB8CEB
Q[7..0]
CE CEO
C TC
CLR
CB8CEB
INV
Figure 18. Save your work – we will continue with this schematic soon
5 - 15
Altium Designer Training Module FPGA Design
Figure 19. Conceptual view showing the linkage of ports on an FPGA schematic routed to physical device pins.
5 - 16
Altium Designer Training Module FPGA Design
The two main activities that will be performed on a newly created constraint file are specifying the
part (device) and applying port constraints.
Select the Vendor, Family, Device and Temperature/Speed grades as desired and click OK. A line
similar to the one below will be automatically inserted into the constraint file:
Record=Constraint | TargetKind=Part | TargetId=XC2S300E-6PQ208C
5 - 17
Altium Designer Training Module FPGA Design
Selecting OK from the dialog box in Figure 22 will cause the following constraint to be added to the
constraint file:
Record=Constraint | TargetKind=Port | TargetId=CLK_BRD | FPGA_CLOCK_PIN=True
This constraint will ensure that the Vendor FPGA tools route the CLK_BRD port to a specialized
clock pin on the target device.
Alternatively, the FPGA_PINNUM
constraint can be specified to lock the port
to a specific pin on the target device.
Selecting OK from the dialog box in Figure 23 will add the constraint FPGA_PINNUM=P185 to the
CLK_BRD port constraint.
6.5 Configurations
A Configuration is a set of one or more constraint files that must be used to target a design for a
specific output. The migration of a design from prototype to production will often involve several
PCB iterations and possibly even different FPGA devices. In this case, a separate configuration
would be used to bring together constraint file information for each design iteration. Each new
5 - 18
Altium Designer Training Module FPGA Design
configuration (and its associated constraint file(s) ) is stored with the project and can be recalled at
any time.
Because configurations can contain multiple constraint files, it can sometimes be helpful to split
constraint information across multiple constraint files. Usually one would separate the constraint files
according to the class of information they contain:
Figure 24. Configuration Manager showing multiple configurations and constraint files.
Figure 24 shows the Configuration Manager dialog for a project that contains multiple configurations
and constraint files. The Constraint files are listed in the left column and can be included in a
Configuration (listed as the headings in the four right columns) by placing a tick at the row/column
intersection point. Although this example only shows one constraint file being used in each of the
configurations, there is no reason why a constraint file can’t be used by more than one configuration
nor is there any reason why a configuration can’t make use of multiple constraint files.
5 - 19
Altium Designer Training Module FPGA Design
2. Because we are targeting our design for the NanoBoard, we will be using an existing constraint
file that has been previously defined for the Spartan-II daughter board. Select the Add button
next to the Constraint Files label. The Choose Constraint files to add to Project dialog box will
be displayed. By default it should open in the Altium Designer 6\Library\FPGA directory. If it
hasn’t defaulted to this location then navigate to it.
3. Select the constraint file labelled NB1_6_XC2S300E-6PQ208.Constraint and click Open. You
should see the same as Figure 26.
Figure 26. Configuration Manager with Spartan-II daughter board constraint file present.
4. We shall now create a configuration that will make use of this constraint file. Select the Add
button located next to the Configurations label.
5 - 20
Altium Designer Training Module FPGA Design
Figure 28. Configuration Manager with a constraint file and configuration specified.
Figure 29. Projects panel after a constraint file has been added.
5 - 21
Altium Designer Training Module FPGA Design
7.1 Overview
Before an FPGA design can be downloaded onto its target hardware, it must first undergo a multi-
stage build process. This process is akin to the compilation process that software undergoes in
order to create a self-contained program. In this section we will discuss the various steps necessary
to build an FPGA design to the point where it is ready to be downloaded onto the target device.
The Devices View is accessible by clicking the Devices View button or by selecting View »
Devices View from the main menu.
When run in the live mode, Altium Designer is intelligent enough to detect which daughter board
device is present on the NanoBoard. In the above instance, it has detected that the Spartan2E
daughter board is installed. With this information, it then searches the current project’s configuration
list to see if any configurations match this device. If more than one configuration is found, the drop
down list below the device icon will be populated with a list of valid configurations. If no configuration
can be found, the list will display the following:
Figure 31. This message indicates that the project is not configured to target the available FPGA.
5 - 22
Altium Designer Training Module FPGA Design
Assuming a valid configuration can be found, the simplest way to build and download a design onto
the NanoBoard is to left-click on the Program FPGA button. This will invoke the appropriate build
processes that need to be run. In the above example where no previous builds have taken place, all
processes will need to be run. In other situations where a project has just been modified, it may be
necessary for only a subset of the build processes to run.
Building an FPGA project requires processing through a number of stages. Navigation through the
build process is accomplished via the four steps circled in Figure 32. The function of each stage will
be explained shortly.
The colored indicator tells you the status of that particular step in the overall build flow.
Grey - Not Available. The step or stage cannot be run.
Red - Missing. The step or stage has not been previously run.
Yellow - Out of Date. A source file has changed and the step or stage must be run again in order
to obtain up to date file(s).
Orange - Cancelled. The step or stage has been halted by user intervention.
Magenta - Failed. An error has occurred while running the current step of the stage.
Green - Up to Date. The step or stage has been run and the generated file(s) are up to date.
5 - 23
Altium Designer Training Module FPGA Design
Clicking on the ‘arrow’ icon will force the current stage and all prior stages to run regardless of
whether they have run to completion previously. Selecting this icon will force a totally clean build
even if the design has been partially built.
7.4.3 Run
Selecting the ‘label’ region will run the current stage and any previous dependant stages that are not
up to date. This is the quickest way to build a design as it only builds those portions of the design
that actually require it.
Selecting the ‘down arrow’ will expose a drop down list of the various sub-stages for the current build
stage. The status of the various sub-stages is indicated by the color of the status ‘LED’. Where a
sub-stage has failed, the associated report file can be examined to help determine the cause of the
failure.
7.6.1 Compile
5 - 24
Altium Designer Training Module FPGA Design
This stage of the process flow is used to perform a compile of the source documents in the
associated FPGA project. If the design includes any microcontroller cores, the associated embedded
projects are also compiled – producing a Hex file in each case.
This stage can be run with the Devices view configured in either Live or Not Live mode.
The compile process is identical to that performed from the associated Project menu. Running this
stage can verify that the captured source is free of electrical, drafting and coding errors.
Note: The source FPGA (and embedded) project(s) must be compiled – either from the Projects
panel or by running the Compile stage in the Devices view – in order to see Nexus-enabled device
entries in the Soft Devices region of the Devices view.
7.6.2 Synthesize
5 - 25
Altium Designer Training Module FPGA Design
7.6.3 Build
Figure 36. Build stage of the process flow for Xilinx (left) and Altera (right) devices.
This stage of the process flow is used to run the vendor place and route tools. This stage can be run
with the Devices view configured in either live or not live mode.
Running the tools at this stage can verify if a design will indeed fit inside the chosen physical device.
You may also wish to run the Vendor tools if you want to obtain pin assignments for importing back
into the relevant constraint file.
The end result of running this stage is the generation of an FPGA programming file that will
ultimately be used to programming the physical device with the design. There are essentially five
main stages to the build process:
• Translate Design – uses the top-level EDIF netlist and synthesized model files, obtained from
the synthesis stage of the process flow, to create a file in Native Generic Database (NGD) format
– i.e. vendor tool project file
• Map Design to FPGA – maps the design to FPGA primitives
• Place and Route - takes the low-level description of the design (from the mapping stage) and
works out how to place the required logic inside the FPGA. Once arranged, the required
interconnections are routed
• Timing Analysis – performs a timing analysis of the design, in accordance with any timing
constraints that have been defined. If there are no specified constraints, default enumeration will
be used
• Make Bit File – generates the programming file that is required for downloading the design to the
physical device.
When targeting a Xilinx device, an additional stage is available – Make PROM File. This stage is
used when you want to generate a configuration file for subsequent download to a Xilinx
configuration device on a Production board.
After the Build stage has completed, the Results Summary dialog will appear (Figure 20). This
dialog provides summary information with respect to resource usage within the target device.
Information can be copied and printed from the dialog. The dialog can be disabled from opening,
should you wish, as the information is readily available in the Output panel or from the report files
produced during the build.
5 - 26
Altium Designer Training Module FPGA Design
7.6.4 Program
This stage of the process flow is used to
download the design into the physical
FPGA device on a NanoBoard or production
board. This stage is only available when the
Devices view is configured in Live mode.
This stage of the flow can only be used
once the previous three stages have been
run successfully and an FPGA programming
Figure 38. Program FPGA stage of the process flow. file has been generated.
Figure 42. Accessing the options dialog for PROM file generation.
5 - 27
Altium Designer Training Module FPGA Design
Figure 43. Xilinx (left) and Altera (right) vendor tool interfaces.
Although Altium Designer has its own VHDL synthesizer, it is reliant on back-end vendor tools to
implement the design on a specific device. This makes entire sense, as it is the device vendors who
have the most intimate knowledge of their specific devices and who have already developed well-
proven targeting technologies.
Most vendor specific tools have been developed in a modular fashion and contain a number of
separate executable programs for each phase of the implementation process. The vendor GUIs that
are presented to the user are co-coordinating programs that simple pass the appropriate parameters
to back-end, command-line programs.
When it comes to FPGA targeting, Altium Designer operates in a similar fashion in that it acts as a
coordinator of back-end, vendor-specific programs. Parameters that need to be passed from the
Altium Designer front-end to the vendor-specific back-end programs are handled by a series of text-
based script files. Users who are already familiar with the back-end processing tools may find some
use in accessing these script files should they wish to modify or ‘tweak’ interaction with back-end
processing tools. This however is considered a highly advanced topic and one that should be
handled cautiously. Ensure backups are taken prior to modification.
The files controlling interaction with vendor-specific back-end tools can be found in the System
directory under the Altium Designer 6 install directory. The naming convention used for these
files is:
Device[Options | Script]_<vendor>[_<tool> | <family>].txt
i.e. DeviceOptions_Xilinx_PAR.txt controls the default options for Xilinx’s Place and Route
tool.
5 - 28
Altium Designer Training Module FPGA Design
8 Embedded instruments
8.1 Overview
So far we have built our PWM FPGA design and run it on the NanoBoard. Fortunately this design
provided an output on the LEDs that enabled us to immediately verify that the circuit was performing
as we expected. But how do we verify other designs? In this section we will introduce the range of
embedded instruments that can be integrated into FPGA designs to facilitate on-chip testing and
debugging.
The controls for the individual embedded instruments can be accessed by double-clicking their
associated icon in the Devices View.
5 - 29
Altium Designer Training Module FPGA Design
8.3 CLKGEN
8.4 FRQCNT2
The frequency counter is a dual input counter that can display the measured
signal in 3 different modes; as a frequency, period, or number of pulses.
8.5 IOB_x
Figure 47. Digital IO module, used to monitor and control nodes in the design
5 - 30
Altium Designer Training Module FPGA Design
8.6 LAX_x
Figure 48. The logic analyzer instrument at the top, with two variations of the configurable LAX shown below it.
The LAX component on the left has been configured to accept 3 different sets of 64 signals (signal sets), the
one on the right has one signal set of 16 bits. The Configure dialog is used to set the capture width, memory
size and the signal sets.
The logic analyzer allows you to capture multiple snapshots of multiple nodes in your design. Use
the LAX to monitor multiple nets in the design and display the results as a digital or an analog
waveform.
The LAX is a configurable component. Configure it to simultaneously capture 8, 16, 31 or 64 bits.
The number of capture snapshots is defined by the amount of capture memory; this ranges from 1K
to 4K of internal storage memory (using internal FPGA memory resources). It can also be configured
to use external memory. This requires you to wire it to FPGA memory resources or to off-chip
memory (eg, NanoBoard Memory).
After placing the configurable LAX from the library, right-click on the symbol and select Configure
from the floating menu to open the Configure (logic analyzer) dialog, where you can define the
Capture Width, Memory Size and the Signal Sets.
The Configurable LAX includes an internal multiplexer, this allows you to switch from one signal set
to another at run time, display the capture data of interest. You can also trigger off one signal set
while observing results of another set.
Note that the FPGA Instruments library includes a number of LAX components. The LAX
component is the configurable version, all others are legacy versions.
5 - 31
Altium Designer Training Module FPGA Design
Figure 49. Digital waveform capture results from the logic analyzer
Figure 50. Analog waveform capture results from the logic analyzer
The capture results are displayed in the instrument panel. There are also two waveform display
modes. The first is a digital mode, where each capture bit is displayed as a separate waveform and
the capture events define the timeline. Note that the capture clock must be set in the logic analyzer
options for the timeline to be calculated correctly. Click the Show Digital Waves button to display
the digital waveform.
The second waveform mode is an analog mode, where the value on all the logic analyzer inputs is
displayed as a voltage, for each capture event. The voltage range is from zero to the maximum
possible count value, scaled to a default of 3.3V. Click the Show Analog Waves button to display
the analog waveform.
5 - 32
Altium Designer Training Module FPGA Design
U9
NEXUS_JTAG_PORT
NEXUS_JTAG_CONNECTOR FREQA
P8 CLK_TICK
JTAG TDI JTAG_NEXUS_TDI FREQB
JTAG P9
TDO JTAG_NEXUS_TDO
JTAG P10 CLK_BRD
TCK JTAG_NEXUS_TCK TIMEBASE
JTAG
P11
TMS JTAG_NEXUS_TMS
...
JTAG
VCC
JTAG Frequency Counter
TRST
FRQCNT2
5 - 33
Altium Designer Training Module FPGA Design
9. Modify the Outputs of the IOB module and observe changes in the LEDs.
10. Adjust the output frequency of the frequency generator module to a lower frequency; try 1KHz.
Observe the impact this has on the LEDs. Modify the Outputs of the IOB and observe further
changes in the LEDs.
11. Adjust the output frequency of the frequency generator module back to 1MHz.
12. Open the logic analyser’s instrument control panel.
5 - 34
Altium Designer Training Module FPGA Design
13. Select Show Panel on the logic analyser. Set the panel up as depicted in Figure 60
5 - 35
Altium Designer Training Module FPGA Design
Figure 62. Logic analyser waveform with bit-7 of the IOB set.
Figure 63. Logic analyser waveform with bits 6 & 7 of the IOB set.
5 - 36
Altium Designer Training Module FPGA Design
Figure 64. Floorplan of MyPWM_withInstruments.SchDoc after it has been placed onto an FPGA.
To be able to use embedded instruments in custom designs, it is necessary to reserve 4 device pins
for the NEXUS_JTAG_CONNECTOR and ensure that sufficient device resources are present to
accommodate the virtual instruments in the device. The JTAG soft chain and other communications
chains present on the NanoBoard will be discussed further in the next section.
5 - 37
Altium Designer Training Module FPGA Design
NanoTalk
Chain
JTAG
Hard
Chain
JTAG
Soft
Chain
Figure 66. Devices view with its various communications channels highlighted.
5 - 38
Altium Designer Training Module FPGA Design
JTAG
P a r a lle l Cell
Data Flow
TDO
Figure 67. Conceptual View of JTAG data flows.
5 - 39
Altium Designer Training Module FPGA Design
Figure 68. Using JTAG Chain to connect multiple JTAG devices together in a digital design.
The Test Access Port (TAP) Controller is a state machine that controls access to two internal
registers – the Instruction Register (IR) and the Data Register (DR). Data fed into the device via TDI
or out of the device via TDO can only ever access one of these two registers at any given time. The
register being accessed is determined by which state the TAP controller is in. Traversal through the
TAP controller state machine is governed by TMS.
5 - 40
Altium Designer Training Module FPGA Design
P182 CLK_BRD
The Clock Frequency indicated in the window will be supplied to the
CLK_BRD port on the NanoBoard. Accessing this clock on custom designs is
as simple as placing the CLOCK_BOARD component from the FPGA NanoBoard Port-
Plugin.IntLib Library.
Selecting a non-standard frequency is possible by clicking the Other Frequency button. The
NanoBoard clock system employs a serially programmable clock source (part number ICS307-02)
that is capable of synthesizing any clock frequency between 6 and 200MHz. Advanced access to
the Clock Control IC registers is available through the Clock Control Options button. A datasheet
for this device is available from the ICS website http://www.icst.com/products/pdf/ics3070102.pdf.
An online form useful for calculating settings for the clock control IC is also available at
http://www.icst.com/products/ics307inputForm.html.
5 - 41
Altium Designer Training Module FPGA Design
This interface enables the developer to see in real time the flow of signals across the device’s pins.
This can be particularly useful when ensuring that signals are being correctly propagated to and from
the device.
Placing a tick in the Live Update checkbox will cause the display to update in real time.
Alternatively, leaving the Live Update checkbox clear and selecting the update icon will
cause signal information to be latched to the display and held.
Check Hide Unassigned I/O Pins to remove clutter from the display.
The BSDL Information drop down list should only need to be accessed for devices which are
unknown to Altium Designer. In this case, you will need to provide the location of the vendor
supplied BSDL file for the device you are viewing.
The FPGA IO instrument rack is available for all devices on the JTAG Hard Chain – including
devices on a user board that is connected to the JTAG Hard Chain.
5 - 42
Altium Designer Training Module FPGA Design
5 - 43
Altium Designer Training Module FPGA Design
Although EDIF files conform to a standard, the information within a given EDIF file may contain
vendor specific constructs. EDIF files can not, therefore be considered as vendor independent.
It is also worth noting that although EDIF files do offer some form of IP protection, they are readable
by humans and can be deciphered with little effort. They should not be relied upon to maintain IP
protection.
You must now specify the folder on your hard disk that you wish the EDIF models to be saved into.
This folder will be searched along with the standard system EDIF folders (\Altium Designer
6\Library\EDIF) when you synthesize any design. It is good practice to keep EDIF models generated
from core projects in a single location for easier searching. The location of the EDIF model folder is
specified in the Preferences – FPGA – Synthesis dialog.
5 - 44
Altium Designer Training Module FPGA Design
5 - 45
Altium Designer Training Module FPGA Design
configuration would be used to bring together constraint file information for each design iteration.
Each new configuration (and its associated constraint file(s) ) is stored with the project and can be
recalled at any time.
To summarize:
• Constraint files store implementation specific information such as device pin allocations and
electrical properties.
• A Configuration is a grouping of one or more constraint files and describes how the FPGA
project should be built.
Figure 76. The Browse Physical Devices dialog, where you select the target FPGA.
5 - 46
Altium Designer Training Module FPGA Design
• If you have just recently created a new constraints file, you will see it listed under the Constraint
Filename. Existing constraint files that currently aren’t in the project can be added by selecting
the Add button next to the Constraint Files text.
• To define a new configuration, select the Add button next to the Configurations text. A dialog
will appear requesting you to provide a name for the new configuration. The name can be
arbitrary but it is helpful if it provides some indication as to what the configuration is for.
• Having defined the new configuration, you may now assign constraint files to it by ticking their
associated checkbox. Here we have assigned the constraint file MyProject_Spartan2E to the
Target_XC2S300E configuration.
5 - 47
Altium Designer Training Module FPGA Design
Although the above simplistic example only had one constraints file and one configuration, the power
of configurations really becomes apparent as the design matures. Below we see how a design has
been targeted to multiple platforms:
Configurations can be updated or modified as desired at any time throughout the project’s
development by returning to the Configuration Manager dialog.
10.8 Synthesize
Now that we have defined a
configuration we are ready to
synthesize the core for the
target.
• With the top level FPGA
document open select
Design » Synthesize. If we
had defined more than one
configuration and wished to
synthesize all configurations
at once we could select Figure 82. Specifying an FPGA project’s top level document.
Design » Synthesize All
Configurations.
• If you have not already nominated the top level
entity/configuration in the Synthesis tab of the
Options for Core Project, the Choose Toplevel
dialog will appear. Enter the core project name or
select from the dropdown list and click OK to continue.
• The project will be synthesized resulting in the
generation of VHDL files for the schematic, EDIF files
for the schematic wiring and parts, and a synthesis log
file. These will all be located under the Generated
folder in the project panel.
• You will observe the configuration name in brackets beside the Generated Folder. Had we
synthesized more than one configuration then a separate Generated folder would have appeared
for each of the defined configurations.
• Confirm that the synthesis process completed successfully by observing the synthesis log file. A
line towards the bottom of the report should indicate whether any errors were encountered.
10.9 Publish
Now we can publish the core project. This will zip together (archive) all the EDIF files in the core
project’s Project Outputs folder and then copy this to the user EDIF models folder that was specified
earlier.
• Select Design » Publish. If the error message “cannot find ‘working folder’” appears, make sure
you have set up the Use presynthesized model folder option in the FPGA Preferences dialog.
• Check the Messages panel to ensure the design has been successfully published.
• Save the core project file.
• A new schematic library (Schlib1.SchLib) will be automatically created and opened to display the
generated symbol. By default the component name will take on the same name as the core
project name. Options controlling the new component’s appearance and style can be controlled
from the Options tab of the Project » Project Options dialog.
5 - 49
Altium Designer Training Module FPGA Design
• From within the library editor, select the component in the Library panel and select the Edit
button. The Library Component Properties dialog will be displayed. Note that several
parameters have been added to indicate which child models are required to be retrieved from the
published EDIF zip files.
Figure 86. Specifying the properties of the newly created core component symbol.
• Clicking on the Edit Pins button will enable further modification of the properties and appearance
of the schematic symbol.
• From the schematic library editor, adjust the symbol properties as appropriate and save the
component. Save the library before exiting.
5 - 50
Altium Designer Training Module FPGA Design
5 - 51
Altium Designer Training Module FPGA Design
Note that the search locations includes the project directory which makes it useful if you need to
transfer the design to another PC that does not have the user EDIF models location defined.
5. Create a constraint file each for an Altera Cyclone device as well as a Xilinx SpartanIIE device.
6. Create a configuration that links each of the individual device constraint files with the project
constraint file.
7. Synthesize all configurations and publish the design. Check the User Presynthesized model
Folder (as set in Section 10.4) using windows explorer and view the directories that are created
and their contents.
8. Create a core schematic symbol and save it to the library MyCoreLib.SchLib.
9. Create a new FPGA project and schematic that makes use of your PWM core and test it on the
NanoBoard.
U1
P182 CLK_BRD
ON
CLK_BRD LEDS[7..0] LEDS[7..0]
SW[7..0] SW[7..0] P55,P56,P57,P58,P59,P60,P61,P62
1 2 3 4 5 6 7 8
TEST_BUTTON
P63,P64,P68,P69,P70,P71,P73,P74
MyPWMCore
P3 TEST_BUTTON
5 - 52
Altium Designer Training Module FPGA Design
VHDL Testbench
Figure 90. Conceptual view of how a VHDL testbench interacts with the Design Under Test (DUT).
Altium Designer provides a convenient method for building a VHDL Testbench based on the inputs
and outputs of the nominated DUT. A shell testbench file can be automatically created by the
system.
• Open a schematic document and select Tools » Convert » Create VHDL Testbench from the
menu.
• Open a VHDL document and select Design » Create VHDL Testbench.
A new VHDL document will be created with the extension .VHDTST and will be added to the project.
Within the Testbench file will be a comment “—insert stimulus here”. By placing VHDL code at this
point you can control the operation of the simulation session. At a minimum, the Testbench must set
all of the DUT’s inputs to a known state. If the DUT requires a clock then that too must be provided
by the Testbench. Most simulation errors occur as a result of the Testbench failing to properly
initialize the inputs of the DUT.
5 - 53
Altium Designer Training Module FPGA Design
5 - 54
Altium Designer Training Module FPGA Design
5 - 55
Altium Designer Training Module FPGA Design
• The icon next to the bus name indicates a bus signal. Clicking on this icon will expand the bus
into its individual signals for closer inspection.
• The time cursor (indicated by the purple vertical bar) can be dragged along the time axis via the
mouse. The current position of the cursor is provided in the time bar across the top of the display.
• Zooming in or out is achieved by pressing the Page Up or Page Down keys respectively.
• The display format of the individual signals can be altered via the menu item Tools » Format and
Radix.
5 - 56
Altium Designer Training Module FPGA Design
• Stop will pause the simulator at its current simulation point. A paused simulation can continue to
be run with any of the above commands.
• Reset will abort the current simulation, clear any waveforms and reset the time back to 0.
• End terminates the entire simulation session. Ended simulations can not be restarted other than
by initiating another simulation session.
5 - 57
Altium Designer Training Module FPGA Design
4. Update the testbench document, top-level entity/configuration and top-level architecture fields in
the simulation tab of the Project » Project Options dialog.
5. Compile the testbench document and rectify any errors.
6. Run the simulation by selecting Simulator » Simulate.
7. Run the simulator for 2us.
8. Observe the waveforms for LEDS[0] and LEDS[1]. Is it what you expect? Try changing the
PWM period by changing the value of SW in the testbench.
5 - 58
Altium Designer Training Module FPGA Design
12 Review
5 - 59
LiveDesign
Training Module
Software, documentation and related materials:
Copyright © 2006 Altium Limited.
All rights reserved. You are permitted to print this document provided that (1) the use of such is for
personal use only and will not be copied or posted on any network computer or broadcast in any
media, and (2) no modifications of the document is made. Unauthorized duplication, in whole or part,
of this document by any means, mechanical or electronic, including translation into another
language, except for brief excerpts in published reviews, is prohibited without the express written
permission of Altium Limited. Unauthorized duplication of this work may also be prohibited by local
statute. Violators may be subject to both criminal and civil penalties, including fines and/or
imprisonment.
Altium, Altium Designer, Board Insight, CAMtastic, CircuitStudio, Design Explorer, DXP, LiveDesign,
NanoBoard, NanoTalk, Nexar, nVisage, P-CAD, Protel, SimCode, Situs, TASKING, and Topological
Autorouting and their respective logos are trademarks or registered trademarks of Altium Limited or
its subsidiaries.
Microsoft, Microsoft Windows and Microsoft Access are registered trademarks of Microsoft
Corporation. OrCAD, OrCAD Capture, OrCAD Layout and SPECCTRA are registered trademarks of
Cadence Design Systems Inc. AutoCAD is a registered trademark of AutoDesk Inc. HP-GL is a
registered trademark of Hewlett Packard Corporation. PostScript is a registered trademark of Adobe
Systems, Inc. All other registered or unregistered trademarks referenced herein are the property of
their respective owners and no trademark rights to the same are claimed.
Module 6
Altium Designer Training LiveDesign
i
Altium Designer Training LiveDesign
1 LiveDesign
The primary objective of Day 2 is to make participants proficient in the process of developing,
downloading and running Embedded Software from the Altium Designer environment. We will
highlight the software authoring and debugging features of Altium Designer as well as develop a
small, embedded application that can be run on the NanoBoard.
Introduction Advance
to the text compiler
editor features
The
TASKING
compiler
tool chain
Linking
code &
hardware
Using an
FPGA
softcore
LiveDesign
Working
“Hello World”
project
Code
debugging
6-1
Altium Designer Training LiveDesign
2 Introduction to LiveDesign
“Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible,
you are, by definition, not smart enough to debug it.“
Brian W. Kernighan
6-2
Altium Designer Training LiveDesign
6-3
Altium Designer Training LiveDesign
• Formatting Options… launches the main Preferences dialog box and displays settings relating
to the Code Formatting (Figure 8 & Figure 9).
• Format Source Code immediately applies the current format settings to the currently opened file.
• Import Editor Settings from enables previously saved editor preferences and settings to be
imported into the current project.
• Editor Preferences launches the main Preferences dialog box and displays settings relating to
the Text Editor (Figure 10, Figure 11 & Figure 12). The Edit Syntax… button (Figure 12) is the
controlling point for setting up all features specific to a given language such as syntax highlighting
styles, reserved words, and comment handling etc. (Figure 13).
• Embedded Preferences launches the main Preferences dialog box and displays the embedded
system settings (Figure 14).
To use the editor’s autocomplete
features, type the text as it
appears in bold on the right hand
side of Figure 4 and select Ctrl-J.
Selecting Ctrl-J next to a block of
text which is not known as an
autocomplete statement will bring
up the Code Templates list as
pictured in Figure 4.
Altium Designer uses two different mechanisms for determining how it handles different file types.
The Associations setting in the Language Setup dialog simply defines how the editor will display
the syntax of the file. The existence of a file association in the Language Setup dialog does not
dictate how Altium Designer will treat the file.
A system file called <Install Dir>\System\FileExtensions.Txt defines how the file is to be
treated by the Altium Designer platform. Only specific file types are considered as ‘Source
Documents’. Other file types not listed in FileExtensions.Txt are treated as ‘Documentation’. It
6-4
Altium Designer Training LiveDesign
is therefore important how files are labeled otherwise they will not be properly included when the
project is built.
6-5
Altium Designer Training LiveDesign
Figure 9. Specifying general code formatting options to apply to how code is spaced.
6-6
Altium Designer Training LiveDesign
6-7
Altium Designer Training LiveDesign
Figure 12. Text editor settings controlling how specific items are highlighted/colored.
6-8
Altium Designer Training LiveDesign
4. If time permits, experiment with some of the editor settings to see their effect on the source code.
Remember to select Tools » Format Source Code after making each change.
5. Save your work.
6-9
Altium Designer Training LiveDesign
6 - 10
Altium Designer Training LiveDesign
Building an application is the process of compiling all of the top-level source documents into a binary
file that can be executed by a target processor. This is a multi-step process involving a number of
tools. In many situations, the user will be shielded from the detail of the underlying compilation
processes however in some circumstances it will be necessary to diagnose the source of build or
compilation errors and for this it is important to understand the compilation flow.
The C compiler, assembler and debugger are target dependent, whereas the linker and the librarian
are target independent. The bold names in Figure 16 are the executable names of the tools.
Substitute target with one of the supported target names, for example, c51 is the 8051 C compiler
and cz80 is the Z80 C compiler.
6 - 11
Altium Designer Training LiveDesign
6 - 12
Altium Designer Training LiveDesign
4.4.3 Preprocessing
This section is helpful if it is necessary to define preprocessor macros that will direct conditional
compilation in the source. For example you may wish to declare a macro called DEBUG_MODE and
use conditional compilation in your source code depending on whether this macro was defined:
#ifdef DEBUG_MODE
do something...
#else
do normal processing...
#endif
C Compiler - Preprocessing
4.4.4 Optimization
The TASKING C compilers offer four optimization levels and a custom level. At each level a specific
set of optimizations is enabled.
• Level 0: No optimizations are performed. The compiler tries to achieve a 1:1 resemblance
between source code and compiled code. Expressions are evaluated in the order written in the
source code, associative and commutative properties are not used.
• Level 1: Enables optimizations that do not affect the debug-ability of the source code. Use this
level when you are developing/debugging new source code.
6 - 13
Altium Designer Training LiveDesign
• Level 2: Enables more aggressive optimizations to reduce the memory footprint and/or execution
time. The debugger can handle this code but the relation between source code and generated
instructions may be hard to understand. Use this level for those modules that are already
debugged. This is the default optimization level.
• Level 3: Enables aggressive global optimization techniques. The relation between source code
and generated instructions can be very hard to understand. The debugger does not crash, will not
provide misleading information, but does not fully understand what is going on. Use this level
when your program does not fit in the memory provided by your system anymore, or when your
program/hardware has become too slow to meet your real-time requirements.
• Custom level: you can enable/disable specific optimizations.
C Compiler - Optimization
6 - 14
Altium Designer Training LiveDesign
4.4.5 Language
Defaults are usually adequate however on the odd occasion you may wish to build code that is pre
ISO C 99 compatibility and you will need the options contained in this panel.
C Compiler - Language
4.4.8 Diagnostics
This section controls how compilation warnings are reported. In some cases it may be desirable to
suppress specific warnings if they are creating too much ‘noise’ in the Messages Panel.
C Compiler - Diagnostics
6 - 15
Altium Designer Training LiveDesign
C Compiler - MISRA C
4.4.10 Miscellaneous
Use this section to pass any compiler flags or settings that have not been covered in the previous
panels. The Options String at the base of the Compiler settings panel provides an indication of the
options that will be passed to the C compiler. Further information about each individual setting can
be found in GU0105 Embedded Tools Users Guide.pdf or via the help system under Embedded
Software Development » Embedded Tools Options Reference » Compiler Options.
C Compiler - Miscellaneous
6 - 16
Altium Designer Training LiveDesign
The Project Options… dialogue box contains a number of assembler options. The subsections of
the assembler options allow for additional control over the assembler in much the same way that the
previously mentioned compiler options do.
The default options are generally sufficient for most applications however should you find it
necessary to tune the assembler then further information can be found in GU0105 Embedded Tools
Users Guide.pdf or via the help system under Embedded Software Development » Embedded
Tools Options Reference » Assembler Options.
A summary of the available assembler options are listed below:
Assembler - preprocessing
Assembler - optimization
6 - 17
Altium Designer Training LiveDesign
Assembler - diagnostics
Assembler - miscellaneous
6 - 18
Altium Designer Training LiveDesign
Verbose information -v
Display version header only -V
Use Zilog assembly syntax (Z80 only) --zilogsyntax
The linker combines and transforms relocatable object files (.obj) into a single absolute object file.
This process consists of two phases: the linking phase and the locating phase.
In the first phase the linker combines the supplied relocatable object files (.obj files, generated by
the assembler) and libraries into a single relocatable object file. In the second phase, the linker
assigns absolute addresses to the object file so it can actually be loaded into a target.
The linker can simultaneously link and locate all programs for all cores available on a target board.
The target board may be of arbitrary complexity. A simple target board may contain one standard
processor with some external memory that executes one task. A complex target board may contain
multiple standard processors and DSPs combined with configurable IP-cores loaded in an FPGA.
Each core may execute a different program, and external memory may be shared by multiple cores.
Most linker options can be controlled via the project options dialog but some options are only
available as command line switches. The default options are generally sufficient for most
applications however should you find it necessary to tune the linker then further information can be
found in GU0105 Embedded Tools Users Guide.pdf or via the help system under Embedded
Software Development » Embedded Tools Options Reference » Linker Options.
A summary of the available linker options are listed below:
Linker - output format
6 - 19
Altium Designer Training LiveDesign
Linker - libraries
Linker - optimization
Linker - diagnostics
Linker - miscellaneous
6 - 20
Altium Designer Training LiveDesign
6 - 21
Altium Designer Training LiveDesign
6 - 22
Altium Designer Training LiveDesign
6 - 23
Altium Designer Training LiveDesign
Figure 23. FPGA Processors.IntLib library contents with popup Help menu.
This library will grow as more and more processor cores become available.
6 - 24
Altium Designer Training LiveDesign
U1 U1_OCD
CLK P0O[7..0] CLK P0O[7..0]
RST P0I[7..0] RST P0I[7..0]
EA EA
P1O[7..0] P1O[7..0]
SFRDATAO[7..0] P1I[7..0] SFRDATAO[7..0] P1I[7..0]
SFRDATAI[7..0] SFRDATAI[7..0]
P2O[7..0] P2O[7..0]
SFRADDR[6..0] P2I[7..0] SFRADDR[6..0] P2I[7..0]
SFRWR SFRWR
SFRRD P3O[7..0] SFRRD P3O[7..0]
P3I[7..0] P3I[7..0]
ROMDATAO[7..0]
ROMDATAI[7..0] MEMDATAO[7..0] ROMDATAI[7..0] MEMDATAO[7..0]
MEMDATAI[7..0] MEMDATAI[7..0]
ROMADDR[15..0] ROMADDR[15..0]
MEMADDR[15..0] ROMWR MEMADDR[15..0]
ROMRD MEMWR ROMRD MEMWR
MEMRD MEMRD
INT0 INT0 PSWR
INT1 PSRD INT1 PSRD
T0 T0
T1 T1
RXD RXD
TXD TXD
RXDO RXDO
6 - 25
Altium Designer Training Module LiveDesign
U8
CLK_BRD
CLK STATUS
U9 CLK_CAP
IA[7..0] O[15..0]
CHANNELS[15..0]
IB[7..0]
TRIGGER
J8B2_16B
Logic Analyser
LAX_1K16
CLK_BRD should be
set to 50MHz
U2
LCD_LIGHT P94
LCD_E P89
[7..0] LCD_RW P166
2 x 16 Liquid Crystal Display
CLK_BRD
P182 CLK_BRD LCD_RS P164
U3 [7..0] LCD_DB[7..0]
CLK P0O[7..0] P88,P87,P86,P84,P83,P82,P81,P75
U4 Reset IOBUF8B
RST P0I[7..0]
P3 TEST_BUTTON GND EA
U6 I[7..0] U5 O0
P1O[7..0]
O1
CLK INIT SFRDATAO[7..0] P1I[7..0]
O2 U7
OR2N1S SFRDATAI[7..0]
LEDS[7..0] O3
VCC DELAY[7..0] P2O[7..0] FREQA
O4
SFRADDR[6..0] P2I[7..0] FREQB
FPGA_STARTUP8 O5
SFRWR
O6 CLK_BRD
SFRRD P3O[7..0] TIMEBASE
U1 O7
P3I[7..0]
CLK DIN[7..0] ROMDATAO[7..0] J8B_8S
Frequency Counter
DOUT[7..0] ROMDATAI[7..0] MEMDATAO[7..0] FRQCNT2
MEMDATAI[7..0] LEDS[7..0]
ADDR[11..0] ROMADDR[15..0]
[11..0] [11..0] P55,P56,P57,P58,P59,P60,P61,P62
WE ROMWR MEMADDR[15..0]
ROMRD MEMWR
RAMS_8x4K
MEMRD
INT0 PSWR
INT1 PSRD
JTAG
T0
TDI JTAG_NEXUS_TDI P8
JTAG T1
JTAG
TDO JTAG_NEXUS_TDO P11
JTAG TCK JTAG_NEXUS_TCK P9
GND RXD
JTAG TMS JTAG_NEXUS_TMS P10
... TXD
JTAG RXDO
TRST VCC
TSK51A OCD Microprocessor
TSK51A_D
6 - 26
Altium Designer Training LiveDesign
Figure 27. Possible project hierarchy for a design containing multiple projects.
6 - 27
Altium Designer Training Module LiveDesign
Figure 29. Linked projects (File View). Figure 30. Linked projects (Structure Editor).
In the File View, files are grouped primarily In the Structure Editor, the hierarchical linkage
according to which project they are a part of between projects is shown – i.e. above we see
and secondarily according to the file type – that the HelloWorld embedded project has
schematic, PCB, settings, etc. been linked to U3 (the TSK51 core) in the
FPGA_HelloWorld FPGA project.
6 - 28
Altium Designer Training LiveDesign
Figure 32. Linking an embedded project to a processor via the schematic interface.
6 - 29
Altium Designer Training Module LiveDesign
T0
T1
RXD
TXD
RXDO
Figure 34. Specifying which component contains the softcore’s program memory
6 - 30
Altium Designer Training LiveDesign
Making this link in the schematic will ensure that both software and hardware is correctly loaded onto
the target processor when we build and download the design to the NanoBoard.
6 - 31
Altium Designer Training Module LiveDesign
6 - 32
Altium Designer Training LiveDesign
6 - 33
Altium Designer Training Module LiveDesign
Logic Analyser
LAX_1K16
U2
LCD_LIGHT P94
LCD_E P89
[7..0] LCD_RW 2 x 16 Liquid Crystal Display P166
LCD_RS P164
U3 [7..0] LCD_DB[7..0]
CLK P0O[7..0] P88,P87,P86,P84,P83,P82,P81,P75
IOBUF8B
RST P0I[7..0]
EA
I[7..0] U5 O0
P1O[7..0]
O1
SFRDATAO[7..0] P1I[7..0]
O2 U7
SFRDATAI[7..0]
LEDS[7..0] O3
P2O[7..0] FREQA
O4
SFRADDR[6..0] P2I[7..0] FREQB
O5
SFRWR
O6 CLK_BRD
SFRRD P3O[7..0] TIMEBASE
O7
P3I[7..0]
ROMDATAO[7..0] J8B_8S
Frequency Counter
ROMDATAI[7..0] MEMDATAO[7..0] FRQCNT2
MEMDATAI[7..0] LEDS[7..0]
ROMADDR[15..0]
P55,P56,P57,P58,P59,P60,P61,P62
ROMWR MEMADDR[15..0]
ROMRD MEMWR
MEMRD
INT0 PSWR
INT1 PSRD
T0
T1
RXD
TXD
RXDO
Figure 37. ‘Hello World’ application with Frequency counter and Logic Analyzer connected.
2. Open the HelloWorld.C file and observe the software delay loop that has been coded into the
Wait_100us function. The controlling constant is defined as US_COUNT. Currently it is set to 1.
Our task is to determine a better value for US_COUNT that will yield a delay of at least 100us.
3. Notice the use of a #ifdef CHK_TIMER statement in main(). This statement controls
conditional compilation of the program. For instance, if the constant CHK_TIMER has been
defined, the software code between the #ifdef and #else will be compiled. If CHK_TIMER has
not been defined, the code between #else and #endif at the bottom of main(). By inserting
statements such as this around code that you may wish to use for debugging purposes greatly
reduces development time.
CHK_TIMER can be defined using a #define CHK_TIMER statement earlier in the program
however we are going to pass it into the compilation as a project setting.
6 - 34
Altium Designer Training LiveDesign
4. Open the Options for Embedded Project dialog box by right-clicking the embedded project in
the Project panel.
5. Under the Compiler Options tab, find the Preprocessing item under the C Compiler group.
Ensure that a User Macro called CHK_TIMER is defined. This will ensure that CHK_TIMER is
defined when we compile the project.
6 - 35
Altium Designer Training Module LiveDesign
6. From the Devices View, build and download the project to the NanoBoard.
7. Set the NanoBoard clock to 50Mhz.
8. Open the frequency counter instrument panel and ensure that its clock reference is also 50Mhz.
Observe the period recorded by the frequency counter module.
9. Try changing the value of US_COUNT to tune the software delay loop to be exactly 100us. Take
note that the period displayed is equal to twice the software delay period since the software
delay is used on both the high and low phases of the signal being fed to the frequency counter.
Note: It is not necessary to rebuild the entire project after each software update has been made.
Locate the Compile and Download button in the toolbar. Pressing this after each software
adjustment will cause only the embedded code to be recompiled and loaded into the FPGA for
immediate execution.
6 - 36
Altium Designer Training LiveDesign
10. Modify the two wait statements in the main() routine from Wait_100us(1) to Wait_1ms(1).
The constant that controls this loop is ONE_MS_COUNT. Tweak the value of this constant to
achieve a 1ms delay.
6 - 37
Altium Designer Training Module LiveDesign
8. If the labels next to each of the signals are not set, update them to appear as they do in Figure
47.
9. To zoom in or out of the digital waveform view, first ensure that the waveform viewer has the
focus and then press the keyboard Page Up or Page Down keys as you would in any other
Altium Designer document. Ensure that you can see at least one full pulse of the Enable signal.
10. Right-click in the digital waveform view area to reveal a pop-up menu. Select the Measure Time
option. Left-click on two locations within the waveform viewer to measure the time between
them.
11. Verify that the LCD write timing waveform complies with the datasheet requirements of Figure 49
and Figure 50.
6 - 38
Altium Designer Training LiveDesign
4. Verify that the LCD read timing waveform complies with the datasheet requirements of Figure 52
and Figure 53.
6 - 39
Altium Designer Training Module LiveDesign
6 - 40
Altium Designer Training LiveDesign
6 - 41
Altium Designer Training Module LiveDesign
6 - 42
Altium Designer Training LiveDesign
Enabled breakpoints are indicated in the code by a red highlight over the breakpoint line and a red
circle with a cross in the margin.
Disabled breakpoints are indicated in the code by a green highlight over the breakpoint line and a
green circle with a cross in the margin. A disabled breakpoint remains defined but will not cause
running code to halt when encountered.
If a disabled breakpoint exists for the line and this command is used, the breakpoint will be removed.
You can view a list of all breakpoints that have currently been defined in all open embedded project
source code files, in the Breakpoints panel.
Add Watch: This command enables you to define watch expressions for the current embedded
source code document. A watch expression can be a single variable or an expression containing one
or more variables and allows you to view the value of the expression as you step through the code.
Basic mathematical operations are supported (e.g. a+b, a*b, c+(b-a)).
Step Into (F7): Use this command to execute each line of the current embedded source code
sequentially, including the individual lines of code contained within any procedures/functions that are
called. The next executable line of code is highlighted in blue and is indicated by a blue circle with
an arrow in the margin.
Step Over (F8): The same as the Step Into command except procedure/function calls are treated as
a single line of code and executed as a single step.
Step Into Instruction (Shift+F7): This command is used to execute each individual instruction at the
assembly code level, in turn, including the instructions contained within any functions that are called.
When the source code document is an .asm file, the next executable instruction is highlighted in
blue and is indicated by a blue circle with an arrow in the margin. This command and the Step Into
Source command will behave in the same way.
When the source code is a high level language (.c file), use of this command should ideally be made
from within one of the two disassembly views for the code - either the extended mixed source-
disassembly view (accessed by clicking the Show Disassembly button on the debug toolbar in the
source code view), or the pure disassembly view (accessed by clicking the Toggle Source Code
button on the disassembly standard toolbar, from within the mixed source-disassembly view).
In both mixed and pure disassembly views, the next executable instruction is highlighted in dark blue
and is indicated by a dark blue circle with an arrow in the margin.
Step Over Instruction (Shift+F8): The same as the Step Into Instruction command except
procedure/function calls are treated as a single line of code and executed as a single step.
Step Out: This command is used to step out of the current function within the embedded source
code. The remaining executable code within the current function will be executed and the execution
will be passed onto the next sequential line of code after the function's calling statement.
Show Disassembly: Open an intermixed source and disassembly view for the current embedded
software project. A new view will open as the active view in the main design window. This view
shows a mixture of disassembled instructions and source (C) code. The source for all source code
files in the current embedded project will be displayed.
In this intermixed disassembly and source view, the next executable source line is highlighted in blue
and is indicated by a blue circle with an arrow in the margin. The next executable disassembled
instruction is highlighted in dark blue and is indicated by a dark blue circle with an arrow in the
margin.
Resynchronize: Use this command to synchronize the debugger execution point with the external
hardware.
Show Execution Point: Position the text cursor at the start of the next line of code to be executed. If
the next executable line of code is outside of the visible area of the main display window, the
document will be panned to bring it into view.
Break: Halt an executing processor at the next executable line of source code.
Reset (Ctrl+F2): Reset the executing processor currently being debugged, at any stage when
stepping through code or after a breakpoint has been encountered, and return the current execution
point back to the first line of executable code.
Stop Debugging (Ctrl+F3): Terminate the current debugging session.
6 - 43
Altium Designer Training Module LiveDesign
Clicking on the Embedded button of the workspace panels will open the list of embedded control
panels. Alternatively use the menu commands by selecting View » Workspace Panels »
Embedded.
Selecting F1 whilst an item within a panel has the focus will bring up extensive help on the panel’s
operation.
Figure 58. Code explorer panel Figure 59. Call stack panel
6 - 44
Altium Designer Training LiveDesign
8.3.3 Watches
Use the Watches panel to see the value of selected variables. Watched variables will be updated
automatically when a running processor is paused and as each line of source code is stepped
through.
For variables to be viewable in the Watches panel they must be within the scope of the current
execution point within the source code. For example, variables local to a specific function will not be
viewable whilst code outside of that function is being executed.
Watched variables can be added, deleted, edited and enabled/disabled from the popup menu that
appears upon a mouse right-click from within the Watches panel.
Watches are extremely flexible in that they can be displayed in a number of different formats.
Formatting options can be accessed by right clicking a watch variable and selecting Edit.
6 - 45
Altium Designer Training Module LiveDesign
8.3.4 RTOS
The RTOS panel has a number of sub-panels which can be activated via the Debug » RTOS menu
option. Note that this menu option only becomes available when an RTOS embedded project is
paused during execution.
The different sub-panels enable the user to track RTOS pertinent information such as System
Status, Concurrent Tasks, Resources, Messages, and Alarms. For further information regarding
RTOS and Altium Designer support for RTOS projects, read GU0102 8051 RTOS.pdf in the or
access this document from the help contents under Embedded Software Development » 8051
RTOS Guide.
6 - 46
Altium Designer Training LiveDesign
8.3.5 Registers
The Registers panel provides a
central point for viewing and
modifying processor registers.
Useful when debugging lines of
assembly source, the Registers
panel provides a line-by-line update
of the state of key processor
resources.
Variables in the Registers panel
can be modified by clicking on one
of the values in the Decimal,
Hexadecimal or Binary columns and
updating the value. This value shall
remain and be used in subsequent
lines of code.
8.3.6 Locals
When an executing processor is paused, the Locals
panel will display a snapshot of the variables that
are local to the currently executing function.
Variables will be updated as each line of source
code is executed. The Locals panel is
complementary to the Watches panel as it does not
get cluttered with information of variables outside of
the scope of the currently executing function.
8.3.7 Evaluate
The Evaluate panel provides a quick means for
determining the value of a variable or expression.
Expression syntax must follow C standards and
variables contained within an expression must be
within the scope of the currently executing function.
Evaluated values or expressions are not updated
whilst the code is stepped through however repeat
evaluations can be made by selecting the Evaluate
button. Alternatively, variables can be added to the
Watches panel by selecting the Add Watch button.
The Evaluate window is also useful for determining
the address of a variable so that it can be located
within one of the memory panels or, in the case of
registers, in the registers panel.
6 - 47
Altium Designer Training Module LiveDesign
6 - 48
Altium Designer Training LiveDesign
The Library Name is simply used as a meaningful identifier in the Library Databases – the system
does not use this field in any way.
The Library Root specifies the root folder where the source files are located.
Full Source controls whether C files should be processed. If this option is left unchecked only
header files (.H) will be scanned.
Once the cross reference libraries have been set up, the Cross References panel can be used from
the editor. Right click any identifier, and select Show Cross-References from the popup menu. The
Cross References panel will be displayed revealing all occurrences of the selected identifier:
8.3.11 Breakpoints
Use breakpoints to halt the processor execution at a specified line of source code. The properties of
a breakpoint accessed by right-clicking an item in the Filename/Address column of the Breakpoints
panel and selecting Properties from the popup menu.
The Count value identifies how many times the breakpoint will be hit and continue before stopping (it
stops when the count gets to 0).
Reset Count is a number that is reloaded into Count once Count gets to zero and stops.
Condition can contain a test expression that will be evaluated at the point of the breakpoint. If the
expression is true then the debugger will pause.
6 - 49
Altium Designer Training Module LiveDesign
8.3.12 Memory
Altium Designer contains a powerful memory display tool that is capable of viewing multiple memory
spaces concurrently. Memory data is displayed using both hexadecimal and ASCII character
notation.
For debugging purposes it is often necessary to modify the contents of memory to provoke a certain
response from the processor. This is possible via the Memory panel. Click on one of the
hexadecimal cells and type in the new hexadecimal value. The memory will automatically refresh
with the new value. The Memory panel does not discern between read only and read-write memory.
If the user attempts to alter memory that is not writeable, the request will be rejected and the memory
location will remain unchanged.
The Memory panels always number the memory spaces they represent from 0 regardless of where
the memory space physically resides in the processor’s memory map. For instance, the Special
Function Register (SFR) space of the 8051 architecture is located between 80h and FFh of the
Internal RAM. The starting address of the SFR Memory panel is listed as 0000h (not 0080h).
Blocks of memory can be highlighted by left-click and dragging across multiple cells. Pressing the
Alt key whilst dragging will drag a rectangle. Once highlighted, memory cells can be used as the
basis for read, write or read/write breakpoints however this feature is only available in simulation
mode.
6 - 50
Altium Designer Training LiveDesign
Bit __bit 1 1 0 or 1
Boolean _Bool 1 8 0 or 1
7 7
Character [signed] char 8 8 -2 .. 2 -1
8
unsigned char 8 8 0 .. 2 -1
Enum 1 1 0 or 1
7 7
8 8 -2 .. 2 -1
15 15
16 8 -2 .. 2 -1
unsigned short 16
16 8 0 .. 2 -1
unsigned int
31 31
[signed] long 32 8 -2 .. 2 -1
32
unsigned long 32 8 0 .. 2 -1
31 31
[signed] long long 32 8 -2 .. 2 -1
32
unsigned long long 32 8 0 .. 2 -1
6 - 51
Altium Designer Training Module LiveDesign
double -3.402e38 .. -
long double 1.175e-38
32 8
1.175e-38 ..
3.402e38
Notes
• The long long types are treated as long.
• The double and long double types are always treated as float.
• When you use the enum type, the compiler will use the smallest sufficient type (__bit, char or
int), unless you use compiler option --integer-enumeration (always use 16-bit integers for
enumeration).
The following rules apply to __bit type variables:
1. A __bit type variable is always unsigned.
2. A __bit type variable can be exchanged with all other data type-variables. The compiler
generates the correct conversion.
3. __bit type variable is like a boolean. Therefore, if you convert an int type variable to a __bit
type variable, it becomes 1 (true) if the integer is not equal to 0, and 0 (false) if the integer is 0.
The next two C source lines have the same effect:
t_variable = int_variable;
bit_variable = int_variable ? 1 : 0;
4. Pointer to __bit is allowed, but you cannot take the address of a bit on the stack.
5. The __bit type is allowed as a structure member. However, a bit structure can only contain
members of type __bit, and you cannot push a bit structure on the stack or return a bit
structure via a function.
6. A union of a __bit structure and another type is not allowed.
7. A __bit type variable is allowed as a parameter of a function.
8. A __bit type variable is allowed as a return type of a function.
9. A __bit typed expression is allowed as switch expression.
10. The sizeof of a __bit type is 1.
11. A global or static __bit type variable can be initialized.
12. A __bit type variable can be declared volatile.
Qualifier Description
__data Direct addressable on-chip RAM
6 - 52
Altium Designer Training LiveDesign
If you do not specify a memory type qualifier for the 8051, the memory type for the variable depends on the
default of the selected 8051 memory model.
__data char c;
__rom char text[] = "No smoking";
__xdata int array[10][4];
__idata long l;
The memory type qualifiers are treated like any other data type specifier (such as unsigned). This
means the examples above can also be declared as:
char __data c;
char __rom text[] = "No smoking";
int __xdata array[10][4];
long __idata l;
Pointers
Pointers for the 8051 can have two types: a 'logical' type and a memory type. For example, a
function is residing in ROM (memory type), but the logical type is the return type of this function.
Example using memory types with pointers
__rom char *__data p; /* pointer residing in data,
pointing to ROM */
means p has memory type data (allocated in on-chip RAM), but has logical type 'character in target
memory space ROM'. The memory type qualifier used left to the '*', specifies the target memory of
the pointer, the memory type qualifier used right to the '*', specifies the storage memory of the
pointer.
The memory type qualifiers are treated like any other data type specifier (like unsigned). This means
the pointer above can also be declared (exactly the same) using:
char __rom *__data p; /* pointer residing in data,
pointing to ROM */
The 8051 C compiler is very efficient in allocating pointers, because it recognizes far (2 byte) and
near (1 byte) pointers. Pointers to __data, __idata and __pdata have a size of 1 byte, whereas
pointers to __rom, __xdata and functions (in ROM) have a size of 2 bytes.
Structure tags
A tag declaration is intended to specify the layout of a structure or union. If a memory type is
specified, it is considered to be part of the declarator. A tag name itself, nor its members can be
bound to any storage area, although members having type "... pointer to" do require one. A tag may
then be used to declare objects of that type, and may allocate them in different memories (if that
declaration is in the same scope). The following example illustrates this constraint.
6 - 53
Altium Designer Training Module LiveDesign
struct S {
__xdat int i; /* referring to storage: not correct */
__idat char *p; /* used to specify target memory: correct */
};
In the example above the 8051 compiler ignores the erroneous __xdat memory type qualifier
(without displaying a warning message).
Typedef
Typedef declarations follow the same scope rules as any declared object. Typedef names may be
(re-)declared in inner blocks but not at the parameter level. However, in typedef declarations,
memory type qualifiers are allowed. A typedef declaration should at least contain one type
qualifier.
Example using memory types with typedefs
typedef __idat int IDATINT; /* memory type __idat: OK */
typedef int __data *DATAPTR; /* logical type __data
memory type 'default' */
Qualifier Description
__sfr Defines a special function register. Special optimizations are performed on
this type of variables.
__sfr8 Defines an 8-bit special function register
__rom Data defined with this qualifier is placed in ROM. This section is excluded
from automatic initialization by the startup code. __rom always implies the
type qualifier const.
6 - 54
Altium Designer Training LiveDesign
6 - 55
Altium Designer Training Module LiveDesign
6 - 56
Altium Designer Training LiveDesign
Example 8051
#include <regtsk51a.sfr>
void __interrupt( S0IR ) serial_receive( void )
{
...
}
6 - 57
Altium Designer Training Module LiveDesign
output_param_list [[ "=[&]constraint_char"(C_expression)],...]
input_param_list [[ "constraint_char"(C_expression)],...]
& Says that an output operand is written to before the inputs are
read, so this output must not be the same register as any input.
constraint _char Constraint character: the type of register to be used for the
C_expression.
C_expression Any C expression. For output parameters it must be an lvalue,
that is, something that is legal to have on the left side of an
assignment.
register_save_list [["register_name"],...]
register_name Name of the register you want to reserve.
6 - 58
Altium Designer Training LiveDesign
You can reserve the registers that are already used in the assembly instructions, either in the
parameter lists or in the reserved register list (register_save_list, also called "clobber list"). The
compiler takes account of these lists, so no unnecessary register saves and restores are placed
around the inline assembly instructions.
Available operand constraints 8051
6 - 59
Altium Designer Training Module LiveDesign
If you want to create a loop with __asm, the whole loop must be contained in a single __asm
statement. The same counts for (conditional) jumps. As a rule of thumb, all references to a label in
an __asm statement must be contained in the same statement.
void main(void)
{
a = 3;
b = 4;
add2( );
}
Generated assembly code (8051):
_add2:
mov R0,_b
mov R1,_a
MOV A, R0
ADD A, R1
MOV _result, A
_main:
mov _a,#3
6 - 60
Altium Designer Training LiveDesign
movx _b,#4
gcall _add2
_add2:
mov R1,_b
mov R2,_a
MOV A, R1
ADD A, R2
MOV _result, A
Example 5: input and output are the same
If the input and output must be the same you can use a number constraint. The following example
adds two values. Input variable a has to go in the same place as the output variable a, so %2 and %0
are the same thing. That is why the constraint of argument 2 is 0, that is, the same as argument 0.
Note also that the .0 and .1 select a kid register from a register pair. Register A is reserved.
int _ADDI( int a, int b )
{
__asm("MOV A, %1.1\n\t"
"ADD A, %0.1\n\t"
"MOV %0.1, A\n\t"
"MOV A, %1.0\n\t"
"ADDC A, %0.0\n\t"
"MOV %0.0, A" : "=R"(a) : "R"(b), "0"(a) : "A" );
return a;
}
void main(void)
{
int ovar;
ovar = _ADDI(2,3);
}
Generated assembly code (8051):
__ADDI:
MOV A, R5
ADD A, R7
MOV R7, A
MOV A, R4
ADDC A, R6
MOV R6, A
ret
6 - 61
Altium Designer Training Module LiveDesign
_main:
mov R6,#0
mov R7,#2
mov R4,#0
mov R5,#3
gcall __ADDI
ret
6 - 62
Altium Designer Training LiveDesign
6 - 63
Altium Designer Training Module LiveDesign
Note: For this exercise you may wish to refer to CR0115 TSK51x MCU.pdf for reference information
about the TSK51 processor. This document can be accessed from the help contents under FPGA
Design » Core References » Processors » TSK51x MCU.
Figure 74. Extract from accelerometer datasheet. RSET has been set to 1.25M.
6 - 64
Altium Designer Training LiveDesign
10 Review
6 - 65