Sie sind auf Seite 1von 11

Digital Circuit Simulation

Introduction
Simulation refers to act of imitation of something. Circuit Simulation replicates the behavior of actual electronic device/circuit. Simulation software like SPICE is a very popular tool for simulation of Analog circuits. Also, Proteus is basically used for Digital Circuit Simulation. It has a vast support for Digital ICs and microcontrollers. In this chapter, we will be briefly discussing about the digital simulation process in Proteus.

Proteus VSM
Proteus VSM (Virtual System Modeling) is software with support for AVR Microcontroller simulation. We can draw schematic of various circuits and virtually run any code on the circuit without actually making the circuit/PCB. With a very large support for microcontroller family, it has many other features which make it suitable for Embedded Systems and electronics simulation. Proteus consists of two subparts: 1. ISIS=> Circuit Simulation Tool 2. ARES=> PCB designing Tool For our purposes, we will be using ISIS only. Features of Proteus 1. Co-Simulation of microcontroller software 2. Circuit Simulation just like SPICE 3. Source Level debugging 4. Large number of ICs are available for simulation Installing Proteus 1. Download Proteus from http://www.labcenter.com/download/prodemo_download.cfm. 2. Installation procedure is very simple and takes only a few minutes. 3. Once installation is done, you will find ISIS Professional Demo in Start Menu. 4. Click on it to Run.

Main Screen view of ISIS

Overview Window: This window shows top view of the circuit. This can be used to adjust Editing Window View in Selection Mode. When component mode is selected, this gives preview of component you have selected. Editing Window: This window is used to design the main circuit. Components can be selected from Component Window and dropped on to Editing Window. Component Window: This window is used to add components to main circuit. We can add components to it using Pick from Library.

Overview of Basic Options

1. Default File Operations: These controls are used to create a new design, open previous design and to save your design. 2. Terminals Mode: This mode is used to add terminals like Ground, 5V Battery, Bus etc. 3. Zooming Controls: These controls consist of Zoom In, Zoom Out etc. These help you to focus on prime parts of circuits easily. 4. Pick from Library: This button can be used to choose and add components to Component View. 5. Junction Dot Mode: This button is used to create a junction anywhere in the circuit. 6. Selection Mode: This mode is used to select and add components from Component Window to Editing Window/Main circuit. 7. Component Mode: This mode is used to get a preview of selected component in Component Window before we add it to Main Circuit.

Adding Components

Steps Required 1. Click on Pick from Library. 2. Type the name of component/IC in search box. 3. Select the appropriate component from Result Pane. 4. Click OK to add. 5. The component is added to Component Window. 6. You can add as many components to component window like this.

Placing component in Main Window

Steps Required 1. Select the component from Component window. 2. In the Editing Window, Click the desired place. 3. Click again to place the component appropriately. 4. You can adjust the view as per your needs using zooming controls and Overview Window.

Connecting components

Steps Required 1. Drop components in the Editing Window in similar way. 2. To draw wires, simply click the starting point (or Pin of IC), and then the endpoint (Pin of other IC). A wire will be created between those points.

Using terminals
1. Select Terminal Mode for using terminals like Ground, Battery etc. 2. Click on the terminal you wish to use. 3. Drop the terminal as any other component on the Editing Window.

Setting Resistance of Resistor


1. 2. 3. 4. Right Click on Resistor. Click on Properties. Change resistance accordingly. You can use similar way to set capacitance of a capacitor.

Running the Simulation


1. Click on Debug Menu. 2. Click Execute. 3. This will start circuit in simulation mode.

Working with microcontroller simulation


Adding MCU to the workspace 1. Pick the MCU from Library. 2. Drop the MCU into workspace.

Programming the MCU 1. A compiled binary is required for simulation. Use any compiler to generate the executable. 2. Open the properties of MCU. a. Right click on MCU. b. Click on Edit Properties. 3. In the Program File, browse for the executable. 4. Click OK. 5. Run the simulation.

Timesaving Shortcuts
1. 2. 3. 4. 5. 6. 7. 8. F12 Run/Execute Starts the simulation F6 Zoom in F7 Zoom out Ctrl + N Create new Design Ctrl + O Open a design Ctrl + S Save the design Ctrl + E Open properties of selected component in Editing Window You can use +,- keys on NumPad on Keyboard to rotate the selected component clockwise/anti-clockwise.

Example 1: Creating simulation of Counter


Components required: 1. 7447 BCD to 7-Segment Decoder 2. 7490 Decade Counter 3. Clock Square wave clock source 4. 7-Seg Common Anode Display Seven Segment Display Circuit Diagram:

Steps Required: 1. Connect the components as shown. 2. Read datasheets to know more about the connections. 3. Click on Run Simulation to start.

Example 2: Using Gates


Components Required: 1. OR Gate 2. AND Gate 3. Animated LED 4. Resistor 300 Ohm 5. Switch

Circuit Diagram:

Steps Required: Make the circuit as given and simulate.

Example 3: Using 555 IC to generate square-wave clock pulse


Components Required: 1. 555 IC 2. Resistors 60, 60, 220, 220 Ohm 3. Capacitor 4. Animated LEDs(2, any color)

Circuit Diagram:

Steps Required: Make the circuit as given and simulate.

Example 4 : Using LCD with Atmega128


Components Required: 1. Atmega128 2. LCD(16x2) Circuit Diagram:

Procedure: 1. Make the required connections. 2. Compile and generate AVR executable (.ELF or .hex). 3. Set the executable into the Atmega MCU. 4. Run the simulation.

Das könnte Ihnen auch gefallen