NI Multisim Basics: Schematic Capture & Simulation Exercises

22
NI Multisim TM Basics Schematic Capture & Simulation Exercises Course Software Version 12.0.1 January 2013 Edition Part Number 324971C-01 NI Multisim Basics Exercises Copyright © 2007–2013 National Instruments. All rights reserved. Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying, recording, storing in an information retrieval system, or translating, in whole or in part, without the prior written consent of National Instruments Corporation. National Instruments respects the intellectual property of others, and we ask our users to do the same. NI software is protected by copyright and other intellectual property laws. Where NI software may be used to reproduce software or other materials belonging to others, you may use NI software only to reproduce materials that you may reproduce in accordance with the terms of any applicable license or other legal restriction. BSIM3 and BSIM4 are developed by the Device Research Group of the Department of Electrical Engineering and Computer Science, University of California, Berkeley and copyrighted by the University of California. The ASM51 cross assembler bundled with Multisim MCU is a copyrighted product of MetaLink Corp. (www.metaice.com). MPASM™ macro assembler and related documentation and literature is reproduced and distributed by Electronics Workbench under license from Microchip Technology Inc. All rights reserved by Microchip Technology Inc. MICROCHIP SOFTWARE OR FIRMWARE AND LITERATURE IS PROVIDED “AS IS,” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL MICROCHIP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR FIRMWARE OR THE USE OF OTHER DEALINGS IN THE SOFTWARE OR FIRMWARE. Trademarks LabVIEW, National Instruments, NI, ni.com, the National Instruments corporate logo, and the Eagle logo are trademarks of National Instruments Corporation. Refer to the Trademark Information at ni.com/trademarks for other National Instruments trademarks. Other product and company names mentioned herein are trademarks or trade names of their respective companies. Members of the National Instruments Alliance Partner Program are business entities independent from National Instruments and have no agency, partnership, or joint-venture relationship with National Instruments. Patents For patents covering National Instruments products/technology, refer to the appropriate location: Help»Patents in your software, the patents.txt file on your media, or the National Instruments Patent Notice at ni.com/patents. Some portions of this product are protected under United States Patent No. 6,560,572. Sample

Transcript of NI Multisim Basics: Schematic Capture & Simulation Exercises

Page 1: NI Multisim Basics: Schematic Capture & Simulation Exercises

NI MultisimTM Basics Schematic Capture & Simulation Exercises

Course Software Version 12.0.1January 2013 EditionPart Number 324971C-01NI Multisim Basics Exercises

Copyright© 2007–2013 National Instruments. All rights reserved. Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying, recording, storing in an information retrieval system, or translating, in whole or in part, without the prior written consent of National Instruments Corporation.

National Instruments respects the intellectual property of others, and we ask our users to do the same. NI software is protected by copyright and other intellectual property laws. Where NI software may be used to reproduce software or other materials belonging to others, you may use NI software only to reproduce materials that you may reproduce in accordance with the terms of any applicable license or other legal restriction.

BSIM3 and BSIM4 are developed by the Device Research Group of the Department of Electrical Engineering and Computer Science, University of California, Berkeley and copyrighted by the University of California.

The ASM51 cross assembler bundled with Multisim MCU is a copyrighted product of MetaLink Corp. (www.metaice.com).

MPASM™ macro assembler and related documentation and literature is reproduced and distributed by Electronics Workbench under license from Microchip Technology Inc. All rights reserved by Microchip Technology Inc. MICROCHIP SOFTWARE OR FIRMWARE AND LITERATURE IS PROVIDED “AS IS,” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL MICROCHIP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR FIRMWARE OR THE USE OF OTHER DEALINGS IN THE SOFTWARE OR FIRMWARE.

TrademarksLabVIEW, National Instruments, NI, ni.com, the National Instruments corporate logo, and the Eagle logo are trademarks of National Instruments Corporation. Refer to the Trademark Information at ni.com/trademarks for other National Instruments trademarks.

Other product and company names mentioned herein are trademarks or trade names of their respective companies.

Members of the National Instruments Alliance Partner Program are business entities independent from National Instruments and have no agency, partnership, or joint-venture relationship with National Instruments.

PatentsFor patents covering National Instruments products/technology, refer to the appropriate location: Help»Patents in your software, the patents.txt file on your media, or the National Instruments Patent Notice at ni.com/patents. Some portions of this product are protected under United States Patent No. 6,560,572.

Sam

ple

Page 2: NI Multisim Basics: Schematic Capture & Simulation Exercises

Support

Worldwide Technical Support and Product Informationni.com

Worldwide OfficesVisit ni.com/niglobal to access the branch office Web sites, which provide up-to-date contact information, support phone numbers, email addresses, and current events.

National Instruments Corporate Headquarters11500 North Mopac Expressway Austin, Texas 78759-3504 USA Tel: 512 683 0100

To comment on National Instruments documentation, refer to the National Instruments Web site at ni.com/info and enter the Info Code feedback.

Sam

ple

Page 3: NI Multisim Basics: Schematic Capture & Simulation Exercises

© National Instruments iii NI Multisim Basics Exercises

Contents

Student GuideA. Course Description ...............................................................................................vB. What You Need to Get Started .............................................................................vC. Installing the Course CD Software .......................................................................viD. Course Goals.........................................................................................................viE. Course Conventions ..............................................................................................vii

Lesson 1Schematic Capture

Exercise 1-1 Drawing a Schematic........................................................................1-1

Lesson 2Simulation and Virtual Instruments

Exercise 2-1 Working with Instruments................................................................2-1

Lesson 3Analyses

Exercise 3-1 Working with Analyses ....................................................................3-1

Lesson 4Results and Post-Processing

Exercise 4-1 Working with Results .......................................................................4-1

Lesson 5Advanced Schematic Capture

Exercise 5-1 Graphic Annotations.........................................................................5-1

Lesson 6Communication and Transfer

Exercise 6-1 Communication and Transfer ...........................................................6-1

Lesson 7Projects and Design Sharing

Exercise 7-1 Working with Projects and Design Sharing .....................................7-1

Lesson 8Design Variants

Exercise 8-1 Working with Design Variants.........................................................8-1Sam

ple

Page 4: NI Multisim Basics: Schematic Capture & Simulation Exercises

Contents

NI Multisim Basics Exercises iv ni.com

Lesson 9Custom Components

Exercise 9-1 Creating Components .......................................................................9-1

Lesson 10MCU Co-simulation

Exercise 10-1 MCU Co-simulation .........................................................................10-1

Lesson 11Educational Features (Optional)

Exercise 11-1 Educational Features ........................................................................11-1

Appendix APresentation Slides

Appendix BAdditional Information and Resources

Sam

ple

Page 5: NI Multisim Basics: Schematic Capture & Simulation Exercises

© National Instruments 9-1 NI Multisim Basics Exercises

9Custom Components

Exercise 9-1 Creating Components

GoalUsing the Component Wizard you will create a new Opamp by using the manufacturer’s SPICE model and footprint information.

Design1. Create the Analog Devices® AD8698AR Opamp using the Component

Wizard.

2. Learn how to use the Symbol Editor.

ImplementationThe following files are referenced in this exercise. They are located in the <Exercises>\Multisim\Lab09 folder:

• AD8698.cir

• AD8698AR Datasheet.pdf

• AD8698 TestCircuit.ms12

• PIC16F1507.ms12

• PIC16F1507.sym

• PIC16F1507 Datasheet.pdf

1. Open Multisim.

❑ Make sure that a blank Design circuit page is in the workspace, otherwise create a new Design.

The Component Wizard2. Locate the SPICE model for the component.

❑ Using Notepad, or any other word processing software, open the file AD8698.cir located on the <Exercises>\Multisim\Lab09 folder.

❑ Select all the text in the file and copy the selection into memory (In Notepad: Edit»Select all, then Edit»Copy).

❑ Close the word processing tool.

Sam

ple

Page 6: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

NI Multisim Basics Exercises 9-2 ni.com

3. Start the Component Wizard.

❑ In Multisim, select Tools»Component wizard or click the Component Wizard button on the Main toolbar.

4. Step 1: Enter component information.

❑ Configure the dialog as shown in the following figure. Since you have access to the SPICE model you can create the component for simulation.

❑ Use the datasheet if needed to fill in information, e.g. Function.

Figure 9-1. Step 1

❑ Click Next to continue.

Sam

ple

Page 7: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

© National Instruments 9-3 NI Multisim Basics Exercises

5. Step 2: Enter footprint information.

❑ According to the datasheet, the footprint is a SOIC (R-8).

Figure 9-2. Footprint Information

❑ Click Select a footprint. In the Database Name field, select Master Database.

❑ Click Filter. This helps you do a quick search within the thousands of footprints included in NI Ultiboard.

❑ Use Add row to add filter rules, click the corresponding cell to pull-down a list of options, configure the Filter window as follows:

Figure 9-3. Selecting the SOIC (R-8) Footprint

❑ Click OK. One of the resulting footprints should be:

Manufacturer: Analog DevicesFootprint: SOIC-N-8(R-8)Sam

ple

Page 8: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

NI Multisim Basics Exercises 9-4 ni.com

The two results map to the same Ultiboard Footprint which is IPC Compliant.

Highlight the footprint and click Select.

❑ This will be a multi-section component. Configure the component for 2 sections, 5 pins per section. Refer to the following figure.

Figure 9-4. Configuring the Multi-section Parameters

❑ Click Next to continue. Do not worry about total number of pins (10) not matching our footprint pin count (8) at this point. This is useful in subsequent steps.

6. Step 3: Enter symbol information.

Step 3 of the Component Wizard shows the symbol generated by default. You can modify the symbol. For this example, you will copy a symbol from the database.

❑ Click Copy from DB.

❑ Locate the OP77AR Opamp in the Master database, Analog group, Opamp family.

❑ Highlight and click OK.

❑ In the Step 3 window, notice how the symbol in section A is different from the one in section B. Select the section A tab and click Copy to.Sam

ple

Page 9: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

© National Instruments 9-5 NI Multisim Basics Exercises

❑ Check all options and click OK.

Figure 9-5. Step 3

❑ Click Next to continue.

7. Step 4: Set pin parameters.

Step 4 of the Component Wizard allows you to select the pin model type for each pin in the symbol, and to select whether to include or exclude that pin from Electrical Rules Check (ERC). You can also configure common pins and hidden pins if any are present on your new component.

Sam

ple

Page 10: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

NI Multisim Basics Exercises 9-6 ni.com

❑ Configure the Type column as shown in the following figure. (Hint: use <Ctrl> to multi-select rows.)

Figure 9-6. Step 4

❑ Click Next to continue.

8. Step 5: Set mapping information symbol-footprint.

Step 5 of the Component Wizard provides you with the opportunity to review the mapping between the symbol and footprint. It is needed when you export to a layout package. Ensure that the mapping is accurate by comparing it to the datasheet information.

❑ Map each symbol pin to its corresponding footprint pin. Refer to the footprint schematic shown in Figure 9-2. Click the corresponding Footprint Pin cell for each row and assign a pin number. You may also experiment with the Map Pins option for a graphical click-and-assign rather than a pull-down list.Sam

ple

Page 11: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

© National Instruments 9-7 NI Multisim Basics Exercises

❑ The configured dialog must look like the following figure.

Figure 9-7. Step 5

❑ Click Next to continue.

9. Step 6: Select the simulation model.

Step 6 of the Component Wizard requires you to enter the simulation model information. You can load SPICE models or create one with the Model Makers.

❑ You will use the model you copy at the beginning of this exercise. Right-click anywhere inside the Model Data box and select Paste. If the text data is no longer available, refer to step 2 at the beginning of this exercise.

❑ In the Model Name field type MyAD8698.

Sam

ple

Page 12: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

NI Multisim Basics Exercises 9-8 ni.com

❑ Copy the model from section A to B. Click Copy to, place a checkmark on the Section B option and click OK.

Figure 9-8. Step 6

❑ Click Next to continue.

10. Step 7: Set mapping information between the symbol and the model.

In Step 7 of the Component Wizard you must ensure that each symbol pin associates to the corresponding number connecting to its node in the model. From the text file of the SPICE model the following is known:

• * Node assignments: IN+ IN- V+ V- O

• .SUBCKT AD8698 1 2 99 50 45

After reviewing these two netlist lines, the following is true:

First node (1) is node name 1 which is the non-inverting input (IN+)

Second node (2) is node name 2 which is the inverting input (IN-)

Third node (3) is node name 99 which is the positive supply (V+)

Fourth node (4) is node name 50 which is the negative supply (V-)

Fifth node (5) is node name 45 which is the output (O)Sam

ple

Page 13: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

© National Instruments 9-9 NI Multisim Basics Exercises

❑ Using the previous information configure the Step 7 dialog as shown in the following figure, you must select the Model Node based on the order in which it appears in the SUBCKT line (in italics above). Configure both sections A and B in the same manner.

Figure 9-9. Step 7

❑ Click Next to continue.

11. Step 8: Save the component to the User or the Corporate database.

❑ Expand the User Database.

❑ Select the Analog group.

Sam

ple

Page 14: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

NI Multisim Basics Exercises 9-10 ni.com

❑ Click Add Family. Type Opamp as the new Family Name and click OK.

Figure 9-10. Step 8

❑ Select the new Opamp family and click Finish.

❑ Pick section A and place it.

❑ Hit <Esc> to exit.

12. Test the newly created component.

❑ In the blank design that is open, select Tools»Circuit wizards»Opamp wizard.

❑ Configure an Inverting Amplifier with a Gain of -2.

❑ Click Verify and Build circuit when you are ready to continue.

❑ Place the new circuit anywhere in the workspace.

❑ Replace the virtual Opamp with the new component you created (Hint: Right-click, and then select Replace components).

❑ Place DC Power supplies for +12 and -12 Volts needed for the Opamp.

❑ Place an Oscilloscope to plot the input and output voltages.Sam

ple

Page 15: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

© National Instruments 9-11 NI Multisim Basics Exercises

❑ Simulate, you should see a waveform as shown in the following figure.

Figure 9-11. Simulation Results from the New Component

Figure 9-12. Test Circuit for the New Component

❑ Stop the simulation.

❑ Save your work and close the test file.

❑ Create a new blank Design.Sam

ple

Page 16: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

NI Multisim Basics Exercises 9-12 ni.com

The Symbol EditorIn this section you will create a new component and define the symbol for that component. The example will create a microcontroller component (PIC16F1507). You can find the datasheet in the <Exercises>\Multisim\Lab09 folder which you will use to complete this exercise.

13. Create the component.

❑ Start the Component Wizard.

❑ For the Component Name enter PIC16F1507-I-SO, select Layout only (footprint) and fill the Author and Function with any information you consider useful. Click Next. (Hint: use the datasheet)

❑ In Step 2, select footprint SOIC127P1030X265-20N from the Master database.(Hint: Use the filter, the Ultiboard Footprint contains “SOIC”, “127”, “265” and “1030”, and Pin Count is “20”; you can get these parameters from the datasheet using IPC convention, type is SOIC, pitch is 127, height is 265 and width is 1030, as found in the dimensions section of the datasheet) This is a single section component with 20 pins. Click Next.

❑ Step 3 shows the symbol generated by default. You must modify this symbol to the desired shape. Click Edit.

14. Use the Symbol Editor to create an appropriate symbol for this component.

❑ The Symbol Editor appears with a default symbol and shape.

Figure 9-13. Default symbol created by the Component Wizard

Sam

ple

Page 17: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

© National Instruments 9-13 NI Multisim Basics Exercises

❑ Start by resizing the boundary box. Select Edit»Resize Boundary Box, or click the Resize Boundary Box in the Drawing toolbar. Make the rectangle a lot bigger to fit all 20 pins and the pin names you will be creating later. You can always resize the boundary box at a later time if needed.

Tip All pins are bounded to the outside of the Boundary Box. Experiment with resizing it whenever you need more space inside the symbol.

Tip The Spreadsheet View works very similar as in Multisim; use it to change object properties.

❑ The SOIC pinout of the component is located on Page 4 of the PIC16F1507 datasheet, the table is reproduced here for your convenience.

❑ In the Spreadsheet View, select the Pins tab.

❑ Rename each pin, click the name cell and type in the new name according to the previous table.

❑ In the Symbol Editor, typing ^MCLR^ will render MCLR in the screen. Use Arial font for symbol and footprint pins.

Pin Number Pin Name

Pin Number Pin Name

1 VDD 11 RB6

2 RA5 12 RB5

3 RA4 13 RB4

4 ~MCLR(Active Low)/VPP/RA3

14 RC2

5 RC5 15 RC1

6 RC4 16 RC0

7 RC3 17 RA2

8 RC6 18 RA1/ICSPCLK

9 RC7 19 RA0/ICSPDAT

10 RB7 20 VSSSam

ple

Page 18: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

NI Multisim Basics Exercises 9-14 ni.com

Figure 9-14. Completed Spreadsheet View

❑ Review the rest of the columns in the Spreadsheet View and the Draw Layer tab to learn what other parameters you can change from here.

❑ Move the pins to match the symbol presented in the following figure. Click the symbol lead, hold and drag to move.

Figure 9-15. Completed Symbol

❑ Once you are done making changes to the symbol, select File»Save, then File»Exit.

Sam

ple

Page 19: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

© National Instruments 9-15 NI Multisim Basics Exercises

If the Multisim window does not automatically maximizes you can click the Multisim bar in the taskbar section.

Tip From the Symbol Editor you can also save the symbol as a file. Select File»Save as, this is useful when you want to share your symbols.

15. Continue with the Component Wizard.

❑ Back in Step 3; copy the edited symbol to the DIN symbol set. Click Next when ready to continue.

❑ In Step 4 of the wizard set the type of MCLR/VPP/RA3 to be an INPUT pin, set VSS and VDD to be PWR pins and click Next to continue.

❑ In Step 5 configure the pins in ascending order (1, 2, 3, …, 20). In this example, all of the pins are correctly ordered from 1 to 20 because you named them according to the datasheet pinout.

– Click Map Pins, then click Auto-assign, then click OK.

– Click Next.

❑ In Step 6, save the component to your User Database, under the Misc Digital group create a new family named PICMicro.

❑ Click Finish.

16. Try the new component symbol.

❑ Place the newly created symbol on the workspace. The green outline color represents a component with no SPICE model.

Figure 9-16. PIC16F84A Symbol

Sam

ple

Page 20: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

NI Multisim Basics Exercises 9-16 ni.com

17. Close the circuit.

❑ Save all your files.

❑ Close all files.

❑ Leave Multisim open.

End of Exercise 9-1Sa

mpl

e

Page 21: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

© National Instruments 9-17 NI Multisim Basics Exercises

Notes

Sam

ple

Page 22: NI Multisim Basics: Schematic Capture & Simulation Exercises

Lesson 9 Custom Components

NI Multisim Basics Exercises 9-18 ni.com

Notes

Sam

ple