Professional Documents
Culture Documents
by
Roman Beneder, BSc
Philipp Brejcha, BSc
December 2010
This work has been supported within the Call10 project Embedded
Platforms (EP) managed by MA27 under grant number 10-07.
Figure 1: VSM
Proteus Virtual System Modelling (VSM) combines mixed mode SPICE circuit simulation,
animated components and microprocessor models to facilitate co-simulation of complete
microcontroller based designs. It is possible to interact with the design using on screen
indicators such as LED and LCD displays and actuators such as switches and buttons. The
simulation takes place in real time (or near enough to it): a 1GMHz Pentium III can simulate a
basic 8051 system clocking at over 12MHz. Proteus VSM also provides extensive debugging
facilities including breakpoints, single stepping and variable display for both assembly code
and high level language source.
1
http://www.labcenter.com/index.cfm
1
Figure 2: Proteus ISIS
The most important feature of Proteus VSM is its ability to simulate the interaction between
software running on a microcontroller and any analog or digital electronics connected to it.
The micro-controller model sits on the schematic along with the other elements of the product
design. It simulates the execution of the object code (machine code), just like a real chip.
If the program code writes to a port, the logic levels in circuit change accordingly, and if the
circuit changes the state of the processor's pins, this will be seen by the program code, just as
in real life.
The VSM CPU models fully simulate I/O ports, interrupts, timers, USARTs and all other
peripherals present on each supported processor. It is anything but a simple software
simulator since the interaction of all these peripherals with the external circuit is fully
modelled down to waveform level and the entire system is therefore simulated.
VSM can even simulate designs containing multiple CPUs, since it is a simple enough matter
to place two or more processors on a schematic and wire them together.
[cmp. to 1]
Proteus VSM was the first product to bridge the gap between schematic and PCB for
embedded design, offering system level simulation of microcontroller based designs inside
the schematic package itself.
Flexibility
Proteus VSM provides a unique development platform for the embedded engineer. It enables
the user to specify a program (HEX file, COF File, ELF/DWARF2 File, UBROF File etc) as a
property of the microcontroller part on the schematic and during simulation will show the
effects of the program on the schematic.
2
Productivity
Typically, engineers spend as much time finding and fixing problems and testing projects as
they do in creating them in the first place. This is an area where Proteus VSM excels. Since
the schematic is serving as the hardware it is perfectly possible to divide tasks and for one
person to develop the PCB layout whilst another uses the schematic as the basis for writing,
testing and debugging the firmware. This means that when the physical prototype finally
arrives from the manufacturer the firmware has already been completed and tested.
Costs
As discussed above, Proteus VSM will save time and effort during the design phase and in the
testing/debugging phase. Both of these translate into cost savings for a project and these
savings multiply with each additional project undertaken.
[cmp. to 2]
The Proteus VSM is licensed for various microcontrollers from the NXP LPC2000 series.
LPC2104/05/06
LPC2114/24
LPC2131/32/34/36/38
LPC2101/02/03
The microcontroller model supports the following features.
Full support for both ARM and THUMB instruction sets.
Supports all port and other I/O pin operations
Supports all on-chip peripherals (GPIO, Timers, RTC, USARTs, SPI, IC, MAM, PLL
& ADC)
Supports full functionality of the VIC interrupt system
Up to 10 MIPS (million instructions per second) simulation throughput on 3GHz PCs
Load and debug an ELF/DWARF2 program file
Internally generated processor clock performance
Provide internal consistency checks on code
Fully integrated into the Proteus Diagnostic Control System
3
The next step is to create a new C Project. File New C Project
The project type should be ARM Cross Target Application Empty Project and the
Toolchain should be configured to ARM Windows GCC (Sourcery G++ Lite). Furthermore a
name for the project has to be chosen (e.g. Template). If all configurations are done, step
forward to the final dialog to complete the project creation by clicking on the Next button.
4
Figure 6: Final project configuration dialog
To set up the basic folder structure where the include files and the source files are located, it is
necessary to create some new folders in the project. Therefore, click with the right mouse
button on the project and select New Folder. The name of the folder has to be Libraries.
Then repeat the same process again to create a folder named Linker. Finally, create two
folders named src and inc in the Libraries folder. The final folder structure is shown in figure
8.
5
Figure 8: Empty project
To be able to compile the project some project settings are necessary. Therefore click on the
project in the project explorer with the right mouse button. Select the Properties entry.
6
After that action the project properties dialog appears. To be able to configure the settings it is
necessary to change to C/C++ Build Settings like in figure 10.
In the tab Tool Settings the first dialog is called Target Processor. The target processor is
an ARM7TDMI-S. For the applications thumb mode is not required. Uncheck the thumb
option below the target processor selection.
7
In the Debugging and Additional Tools dialog nothing has to be changed.
The ARM Windows GCC Assembler dialog is shown in figure 12.
In the Assembler section only the Warnings section has to be edited. Check the Pedantic
option.
The next section which has to be edited is the ARM Sourcery Windows GCC C Compiler
section. This section is shown in figure 14.
8
Figure 15: Add include path (1)
<ProjectName>/Libraries
<ProjectName>/Libraries/inc
<ProjectName>/Libraries/src
After this process the Directories section should look like as shown in the following figure.
The next section which will be edited is the Warnings section. In this section check the box
Pedantic.
The next section which is important to configure is the ARM Sourcery Windows GCC
Linker section. It should look as shown in the figure below.
9
Figure 18: ARM Sourcery Windows GCC C Linker
In the General section it is necessary to point at the location of the Linker script. To do be
able to point at the linker script in the workspace folder it is necessary to copy it via drag n
drop to the linker folder in the project explorer. Close the settings dialog and apply the
changes. The linker script is located at C:\Dokumente und Einstellungen\User\Eigene
Dateien\LPC2138\DefaultSources\Linker.
After the copying process the linker script should appear in the Linker folder in the IDE in the
project explorer.
Go back to the project settings. In the section ARM Sourcery Windows GCC C Linker
section General browse to the copied linker file, select the file and the path should appear in
the empty field. Additionally it is necessary to uncheck the option Do not use default
libraries and to check the option Do not use standard start files. The figure below shows
the required configuration.
10
Figure 20: Linker script options
The next section Libraries is important to let the compiler know in which folder in the
workspace the linker script is located. Therefore, go to the next section Libraries and add
the appropriate folder.
If this selection is completed nearly everything is configured. Two boxes have to be checked.
In the section ARM Sourcery Windows GNU Print Size General the box Hex and
the box Show totals have to be checked.
If these two boxes are checked apply the changes and close the project settings dialog.
To be able to begin to develop an application some source and header files have to be copied
to the project explorer. Therefore it is necessary to open an explorer window in Windows and
change the folder to C:\Dokumente und Einstellungen\User\Eigene
Dateien\LPC2138\DefaultSources. This folder contains a main,c file. It is possible to copy
the main file via drag n drop to the workspace in the project explorer. Take the main file and
copy it into the project.
11
Figure 23: Copy the main file
The next step is to change the directory in the windows explorer to C:\Dokumente und
Einstellungen\User\Eigene Dateien\LPC2138\DefaultSources\Libraries and copy the content
of the inc folder to the inc folder in the project workspace in the Eclipse IDE. The same
process has to be done to copy the content of the src folder to the src folder into the
project explorer of the Eclipse IDE.
If these steps are completed the folder structure should look as shown in the figure below.
12
Figure 25: Project explorer after the copying processes
To check whether it is possible to compile the project click on and a Debug folder
should appear in the project explorer- Additionally a Binaries structure should appear.
Eventually occurring errors or warnings will be displayed in the Problems Tab, located at
the lower side of the Eclipse window.
13
Figure 26: Project explorer after the compilation (build) processes
14
Table of figures
Figure 1: VSM ............................................................................................................................ 1
Figure 2: Proteus ISIS ................................................................................................................ 2
Figure 3: Eclipse Ganymede ...................................................................................................... 3
Figure 4: New C Project ............................................................................................................. 4
Figure 5: Project configuration dialog ........................................................................................ 4
Figure 6: Final project configuration dialog ............................................................................... 5
Figure 7: Project explorer ........................................................................................................... 5
Figure 8: Empty project .............................................................................................................. 6
Figure 9: Project properties ........................................................................................................ 6
Figure 10: Project properties settings ......................................................................................... 7
Figure 11: Target selection ......................................................................................................... 7
Figure 12: ARM Sourcery Windows GCC Assembler .............................................................. 8
Figure 13: Assembler Warnings ................................................................................................. 8
Figure 14: ARM Sourcery Windows GCC C Compiler ............................................................. 8
Figure 15: Add include path (1) ................................................................................................. 9
Figure 16: Add include path (2) ................................................................................................. 9
Figure 17: Compiler Warnings section ....................................................................................... 9
Figure 18: ARM Sourcery Windows GCC C Linker ............................................................... 10
Figure 19: Copy linker script .................................................................................................... 10
Figure 20: Linker script options ............................................................................................... 11
Figure 21: Linker search path ................................................................................................... 11
Figure 22: ARM Sourcery Windows GNU Print Size ............................................................. 11
Figure 23: Copy the main file ................................................................................................... 12
Figure 24: Copy inc & src files ......................................................................................... 12
Figure 25: Project explorer after the copying processes .......................................................... 13
Figure 26: Project explorer after the compilation (build) processes ........................................ 14
15
References
[1] http://www.labcenter.com/products/vsm_overview.cfm
[2] http://www.labcenter.com/products/vsm_benefits.cfm