没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
185页
Traditionally, circuit simulation has been a non-interactive affair. In the early days, netlists were prepared by hand, and output consisted of reams of numbers. If you were lucky, you got a pseudo-graphical output plotted with asterisks to show the voltage and current waveforms.
资源推荐
资源详情
资源评论
INTRODUCTION
ABOUT PROTEUS VSM
Traditionally, circuit simulation has been a non-interactive affair. In the early days, netlists were
prepared by hand, and output consisted of reams of numbers. If you were lucky, you got a
pseudo-graphical output plotted with asterisks to show the voltage and current waveforms.
More recently, schematic capture and on screen graphing have become the norm, but the
simulation process is still non-interactive - you draw the circuit, press go, and then study the
results in some kind of post processor. This is fine if the circuit you are testing is essentially
static in its behaviour e.g. an oscillator which sits there and oscillates nicely at 1Mhz. However, if
you are designing a burglar alarm, and want to find out what happens when a would-be burglar
keys the wrong PIN into the keypad, the setting up required becomes quite impractical and one
must resort to a physical prototype. This is a shame, as working ‘in cyberspace’ has so much to
offer in terms of design productivity.
Only in educational circles has an attempt been made to present circuit simulation like real life
electronics where it is possible to interact with the circuit whilst it is being simulated. The
problem here has been that the animated component models have been hard coded into the
program. Only limited numbers of simple devices such as switches, light bulbs, electric motors
etc. have been offered, and these are of little use to the professional user. In addition, the quality
of circuit simulation has often left much to be desired. For example, one major product of this
type has no timing information within its digital models.
PROTEUS VSM brings you the best of both worlds. It combines a superb mixed mode circuit
simulator based on the industry standard SPICE3F5 with animated component models. And it
provides an architecture in which additional animated models may be created by anyone,
including end users. Indeed, many types of animated model can be produced without resort to
coding. Consequently PROTEUS VSM allows professional engineers to run interactive
simulations of real designs, and to reap the rewards of this approach to circuit simulation.
And then, if that were not enough, we have created a range of simulator models for popular
micro-controllers and a set of animated models for related peripheral devices such as LED and
LCD displays, keypads, an RS232 terminal and more. Suddenly it is possible to simulate
complete micro-controller systems and thus to develop the software for them without access to a
physical prototype. In a world where time to market is becoming more and more important this is
a real advantage.
It is also worth pointing out that the processing power of the modern PC is truly awesome. A
300MHz Pentium II PC can simulate simple micro-controller designs in real time, or even faster
in some cases. And even where things slow down somewhat, the response time is more often
that not useable for software development. If you are serious about this game, you can go out
and buy a 2GHz dual processor PC, which is far, far faster. This, then, debunks the other obvious
objection to interactive simulation - that it would not be fast enough.
INTRODUCTION
ABOUT THE DOCUMENTATION
This manual is intended to complement the information provided in the context sensitive help.
Whereas the manual contains background information and tutorials, the help provides context
sensitive information related to specific icons, commands and dialog forms. Pointing with the
mouse and pressing F1 can obtain help on most objects in the user interface.
PROTEUS VSM can be used in two rather distinct ways - either for Interactive Simulation or for
Graph Based Simulation and this is reflected in the structure of the manual. Typically, you will
use interactive simulation to see if a design works at all, and graph based simulation to
investigate why it doesn’t or to take very detailed measurements. However, there are no hard
and fast rules. Some elements of the system, such as Generators are relevant to both modes of
use and are given their own chapters for this reason.
Detailed, step by step tutorials are provided which take you through both types of simulation
exercise. We strongly recommend that you work through these as they will demonstrate all the
basic techniques required to get going with the software.
Information on creating VSM models is provided separately in the VSM Software
Development Kit (SDK), an on-line resource which is installed as standard with the
Professional Version of Proteus.
INTERACTIVE SIMULATION
TUTORIAL
Introduction
The purpose of this tutorial is to show you, through the creation of a simple schematic, how to
conduct an interactive simulation using Proteus VSM. While we will concentrate on the use of
Active Components and the debugging facilities of the ISIS Editor we will also look at the basics
of laying out a schematic and general circuit management. Full coverage of these topics can be
found in the ISIS Manual.
The circuit we will be using for the simulation is a pair of traffic lights connected to a PIC16F84
micro-controller as shown below.
Whilst we will be drawing the schematic from scratch, the completed version can be found as
"Samples\Tutorials\Traffic.DSN" within your Proteus installation. Users who are familiar with the
general operating procedures in ISIS may choose to use this ready made design and move on to
the section on the micro-controller program. . Please note, however, that this design file contains
a deliberate error - read on for more information.
If you are unfamiliar with ISIS, the interface and basic usage are discussed at length in A Guided
tour of the ISIS Editor and although we will touch on these issues in the following section you
should take the time to familiarise yourself with the program before proceeding.
Drawing the Circuit
Placing the Components:
We will start by placing two sets of traffic lights and a PIC16F84 on a new schematic layout.
Start a fresh design, select the Component icons (all the icons have both tool-tip text and
context-sensitive help to assist in their use) and then left click on the letter ‘P’ above the Object
Selector to launch the Library Browser. The Library Browser will now appear over the Editing
Window (see Basic Schematic Entry in the ISIS Manual For more information).
Press the 'P' button on the keyboard and type in 'Traffic' in the Key words field and double click
on the result to place the traffic lights in to the Object Selector. Do the same for the PIC16F84A.
Once you have selected both TRAFFIC LIGHTS and PIC16F84 into the design close the Library
Browser and click left once on the PIC16F84 in the Object Selector
(this should highlight your selection and a preview of the component will appear in the Overview
Window at the top right of the screen). Now left click on the Editing Window to place the
component on the schematic - repeat the process to place two sets of traffic lights on the
schematic.
Movement and Orientation:
We now have the building blocks on the schematic but the chances are they are not ideally
positioned. To move a component, point the mouse over it and right click (this should highlight
the component), then depress the left mouse button and drag (you should see the component
outline ‘follow’ the mouse pointer) to the desired position. When you have the outline where you
want release the left mouse button and the component will move to the specified position. Note
that at this point the component is still highlighted - right click on any empty area of the Editing
Window to restore the component to it’s normal status.
To orient a component, right click over it in the same way as before then click on one of the
Rotation icons. This will rotate the component through 90 degrees - repeat as necessary. Again, it
is good practice to right click on an empty area of the schematic when you are finished to restore
the component to it’s original state.
Set out the schematic in a sensible fashion ( perhaps based on the sample given ), moving and
orientating the components as required. If you are having problems we advise you to work
through the tutorial in the ISIS manual - ISIS Tutorial
For our purposes , we will ignore the 2D Graphics involved in the road junction and concentrate
on creating a simulatable circuit - for those who are interested a full discourse on the Graphics
capabilities of ISIS can be found here - 2D Graphics
Zooming and Snapping:
In order to wire up the schematic it is useful to be able to zoom in to a specific area. Hitting the F6
key or the Zoom In Icon will zoom around the current position of the mouse, or, alternatively,
holding down the SHIFT key and dragging a box with the left will zoom in on the contents of the
dragged area. To zoom back out again hit the F7 key or the Zoom Out icon, or, should you wish
to zoom out until you can see the entire design, hit the F8 key or use the mouse wheel to zoom
out or in to the required area. Corresponding commands can be accessed through the View Menu.
ISIS has a very powerful feature called Real Time Snap. When the mouse pointer is positioned
near to pin ends or wires, the cursor location will be snapped onto these objects. This allows for
easy editing and manipulation of the schematic. This feature can be found in the Tools Menu and
is enabled by default.
More information on zooming and snapping can be found in The Editing Window in the ISIS
manual.
Wiring Up:
The easiest way to wire a circuit is to use the Wire Auto Router option on the Tools Menu. Make
sure that this is enabled ( a tick should be visible to the left of the menu option ). For more
information see The Wire Auto Router in the ISIS manual. Zoom in to the PIC until all the pins
are comfortably visible and then place the mouse pointer over the end of pin 6 (RB0/INT). You
should see a small ‘x’ cursor on the end of the mouse. This indicates that the mouse is at the
correct position to connect a wire to this pin. Left click the mouse to start a wire and then move
the mouse to the pin connected to the red light on one of the sets of Traffic Lights. When you get
an ‘x’ cursor again over this pin left click to complete the connection. Repeat the process to wire
up both sets of Traffic Lights as given on the sample circuit.
There are a couple of points worth mentioning about the wiring up process:
• You can wire up in any mode - ISIS is clever enough to determine what you are doing.
• When enabled, the Wire Autorouter will route around obstacles and generally find a sensible
path between connections. This means that, as a general rule, all you need to do is left click
at both end points and let ISIS take care of the path between them.
• ISIS will automatically pan the screen is you nudge the edge of the Editing Window while
placing a wire. This means that you can zoom in to the most suitable level and, so long as
you know the approximate position of the target component, simply nudge the screen over
until it is in view. Alternatively, you can zoom in and out while placing wires ( using the F6
and F7 keys ).
Finally, we have to wire pin 4 to a power terminal. Select the Terminal icon and highlight ‘POWER’
in the Object Selector. Now left click on a suitable spot and place the terminal. Select the
appropriate orientation and wire the terminal to pin 4 using the same techniques as before.
More useful information on wiring up can be found at the following places in the ISIS manual:
• Wire Placement
• Wire Repeat
• Dragging Wires
At this point we recommend that you load the completed version of the circuit – this will avoid
any confusion arising if the version you have drawn is in any way different from ours! Also, if
you have not purchased the PIC Microprocessor Model Library, you must load the
pre-prepared sample file in order to proceed.
Writing the Program
Source Listing
For the purposes of our tutorial, we have prepared the following program which will enable the
PIC to control the traffic lights. This program is provided in a file called TL.ASM and can be found
in the "Samples\Tutorials" directory.
LIST p=16F84 ; PIC16F844 is the target processor
#include "P16F84.INC" ; Include header file
CBLOCK 0x10 ; Temporary storage
state
l1,l2
ENDC
org 0 ; Start up vector.
goto setports ; Go to start up code.
org 4 ; Interrupt vector.
halt goto halt ; Sit in endless loop and do nothing.
setports clrw ; Zero in to W.
movwf PORTA ; Ensure PORTA is zero before we enable it.
movwf PORTB ; Ensure PORTB is zero before we enable it.
bsf STATUS,RP0 ; Select Bank 1
clrw ; Mask for all bits as outputs.
movwf TRISB ; Set TRISB register.
bcf STATUS,RP0 ; Reselect Bank 0.
initialise clrw ; Initial state.
movwf state ; Set it.
剩余184页未读,继续阅读
s1mba
- 粉丝: 2406
- 资源: 49
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页