How to Simulate a Microcontroller in Multisim
National Instruments' Multisim is a useful tool for designing and testing electronic circuits, in a virtual workspace. One of the advanced features of the software is the ability to simulate a microcontroller, or MCU. The initial set-up and configuration of the virtual MCU is a brief, stepwise process that can be easily accomplished. However, the actual construction of the MCU circuit and the programming of the MCU can be challenging and time-consuming, but you can complete the initial set-up and configuration.
Things You'll Need
- Multisim version 10.0 (or equivalent) software
- “MCU Module User Guide” PDF file
Open Multisim and click on the MCU icon, which is located in the component toolbar. After the window opens, select the “805x” family, select the “8051” MCU and click on "OK." The window will disappear and an outline of the 8051 will appear in the workspace.
Place the 8051 on the workspace by clicking once. After it is placed, a window titled “MCU Wizard - Step 1 of 3” will appear.
Name the workspace "testspace" and verify the workspace path. Click “Next >” to proceed to the next window. It is not necessary, but you can also "browse" and choose a different workspace path for saving.
Click on each drop-down menu, in window “2 of 3.” Select “Standard” for project type and select “Assembly” for programming language. Name the project "testMCU" and click “Next >” to proceed. The assembler/compiler tool will automatically be set when the programming language is selected.
Click on the radio button for “Add source file” in window “3 of 3.” Name the source file “test1.” Click “Finish” to close the MCU Wizard and click on the "X" to close the 8051 component window.
Construct a circuit using the MCU. This process is similar to constructing any other circuit in Multisim.
Click on the tab for the “test1.asm” window (at the bottom of the workspace) to program the 8051. A separate programming window will open. Write the MCU program in the area where it states “; Please insert your code here.” Include the statements “$MOD51” and “END” in your program.
Run the simulation when programming is complete. Click on “Simulate” and select “Run.” This will compile the code and operate the MCU circuit.
Tips & Warnings
- Use a programming reference for assistance with the language and the compiler. Some versions of Multisim have reference manuals included in the “Documentation” folder. If not, langauge references can be easily found on the Internet. The Metalink Corporation's, “8051 Cross Assembler User's Manual” is the manufacturer's reference for programming the 8051 MCU.
- Some menu actions in Multisim can be performed with keyboard shortcuts. For example, you can run a simulation by pressing the “F5” key.
- There are several examples of MCUs in Multisim. The 8051 is a very common and "basic" example of an MCU.