Using The Amicus18 Compiler With MPLAB IDE
Using The Amicus18 Compiler With MPLAB IDE
1
Create the Project files................................................................................................. 1
Creating an MPLABtm Project ........................................................................................ 2
Building the project ..................................................................................................... 6
Simulating the program ............................................................................................... 8
Simulating within MPLABtm without creating a Project ....................................................11
1
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009
Once inside the MPLab_Demo folder, click the Save button. The LED_Sequence.bas file is now copied to
the newly created folder.
Creating an MPLABtm Project
Open MPLABtm, then click on the Project Wizard menu option.
This will open the Wizard intro window as shown below. Click the Next button.
2
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009
Click Next, then choose the Amicus18 Compiler toolsuite, and browse to where the compilers executable is stored.
The default location for this is C:/Program Files/AmicusIDE.
Choose the file named Amicus.exe and enter this in the Location window.
3
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009
After clicking Next, a project name and location needs to be chosen in the step 3 window. The location
for this demonstration project is MpLab_Demo.
The project can be placed virtually anywhere on the hard drive as long as it is not nested too deeply,
and has the correct permissions. However, it is important to remember that any BASIC file name used
within the MPLABtm environment must contain no spaces. i.e. LED_Sequencer instead of LED Sequencer.
It should be pointed out that this is a quirk of MPLABtm and not the compiler.
For this demonstration, well use our earlier prepared MPLab_Demo folder. Click on the browse button
and navigate to the Samples folder. This is located in the Documents and Settings/User Name/Amicus
directory, (Users/User Name/Amicus) if using Microsoft Vista.
4
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009
Click on the Next button and the final wizard window will appear.
5
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009
Double click on the LED_Sequencer.bas file that appears in the upper left window. This will open the
BASIC program within the MPLABtm workspace. At this point edit the BASIC code and comment out the
lines containing any DelayMs commands, as this will slow down the simulation significantly, because
MPLABtm does not simulate in real-time.
Building the project
Choose Project from the top toolbar then the Build option or press Ctrl F10 to compile the BASIC
program.
6
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009
The bottom window of the MPLABtm workspace will show the results of the compilation. Anything other
than a BUILD SUCCEEDED message will mean that the program failed to compile, and any error messages will be displayed.
7
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009
We now need to setup the speed of the simulation. Click on the Debugger toolbar option, then click
Settings.
This will open the Simulator Settings window. Choose the Osc/Trace tab and change the Processor
Frequency value to 64, making sure that the radio button is set for MHz.
8
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009
To configure how the variables are displayed, right click on one and a properties window will appear.
For this demonstration choose a format of Decimal and untick the Signed box. Then click Apply and
OK.
9
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009
This has been very brief overview of how to simulate a compiled program, but hopefully, it has wetted
your appetite. The MPLABtm manual is full of information, and I suggest you give it a good reading.
10
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009
Then choose the appropriate device that the BASIC program is compiled for, by clicking on the Configure->Select Device toolbar menu.
You must now choose the PIC18F25K20 device from the drop down menu, and click the OK button.
11
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009
12
Crownhill AssociatesLimited 2009 - All Rights Reserved
Version 1.0
06-10-2009