mikroBasic PRO for PIC32 is a full-featured compiler for PIC32 MCUs
from Microchip. It is designed for developing, building and debugging
PIC32-based embedded applications. This development environment
has a wide range of features such as: easy-to-use IDE, very compact and
efcient code, many hardware and software libraries, comprehensive
documentation, software simulator, COFF le generation, SSA
optimization (up to 30% code reduction) and many more. Numerous
ready-to-use and well-explained examples will give a good start for
your embedded project.
™
Manual
Compiler
MikroElektronika
mikoBasic PRO for PIC32
Table of Contents
CHAPTER 1 30
INTRODUCTION 30
Introduction to mikroBasic PRO for PIC32 31
Features 31
Where to Start 31
Software License Agreement 32
mikroElektronika Associates License Statement and Limited Warranty 32
IMPORTANT - READ CAREFULLY 32
LIMITED WARRANTY 32
HIGH RISK ACTIVITIES 33
GENERAL PROVISIONS 33
Technical Support 34
How to Register 34
Who Gets the License Key 34
How to Get License Key 34
After Receving the License Key 36
CHAPTER 2 38
mikroBasic PRO for PIC32 38
Environment 38
Main Menu Options 39
File 40
File Menu Options 40
Edit 41
Edit Menu Options 41
Find Text 42
Replace Text 42
Find In Files 43
Go To Line 43
Regular expressions option 43
View 44
View Menu Options 44
Project 46
Project Menu Options 46
Build 47
Build Menu Options 47
Run 48
Run Menu Options 48
Tools 49
Tools Menu Options 49
Help 50
Help Menu Options 50
MikroElektronika
2
mikroBasic PRO for PIC32
mikroBasic PRO for PIC32 IDE 51
IDE Overview 51
Code Editor 52
Editor Settings 52
Auto Save 53
Highlighter 53
Spelling 53
Comment Style 53
Code Folding 53
Code Assistant 54
Parameter Assistant 54
Bookmarks 54
Go to Line 54
Column Select Mode 55
Editor Colors 55
Auto Correct 56
Auto Complete (Code Templates) 57
Memory Usage Windows 65
Variables 66
Used RAM Locations 66
SFR Locations 67
ROM Memory Usage 67
ROM Memory Constants 68
Functions 68
Functions Sorted By Name Chart 69
Functions Sorted By Size Chart 69
Functions Sorted By Addresses 70
Function Tree 70
Memory Summary 71
CHAPTER 6 135
mikroBasic PRO for PIC32 Specics 135
GOTO Table 136
Basic Standard Issues 136
Divergence from the Basic Standard 136
Basic Language Extensions 136
Predened Globals and Constants 137
Predened project level denes 137
Accessing Individual Bits 138
sbit type 139
at keyword 140
5
MikroElektronika
mikoBasic PRO for PIC32
bit type 140
Interrupts 141
Conguring Interrupts 141
Single Vector Mode 141Multi Vector Mode 141
Interrupt Priorities 142
Interrupts and Register Sets 142
Register Set Selection in Single Vector Mode 142Interrupts and Register Sets 142
Interrupt Coding Requirements 142
Interrupt Service Routine 142
Function Calls from Interrupt 143
Interrupt Example 144
Organization of Main Module 190
Organization of Other Modules 191
192
Note: Sub functions and sub procedures must have the same declarations in the interface and
implementation section. Otherwise, compiler will report an error. 192
Scope and Visibility 192
Scope 192
Visibility 192
Name Spaces 193
Modules 193
Include Clause 193
Main Module 194
Other Modules 194
Interface Section 195
Implementation Section 195
Variables 195
External Modier 195
Variables and PIC32 197
Constants 197
Labels 198
Symbols 198
Functions and Procedures 199
MikroElektronika
8
mikroBasic PRO for PIC32
Functions 199
Calling a function 199
Procedures 200
Forward declaration 201
Functions reentrancy 202
Can I use your compilers and programmer on Windows Vista (Windows 7) ? 629
I am getting “Access is denied” error in Vista, how to solve this problem ? 629
What are differences between mikrobasic PRO, mikroPascal PRO and mikroC PRO compilers ?
Why do they have different prices ? 629
Why do your PIC compilers don’t support 12F508 and some similar chips ? 629
What are limitations of demo versions of mikroElektronika’s compilers ? 629
Why do I still get demo limit error when I purchased and installed license key ? 629
I have bought license for the older version, do I have to pay license for the new version of the compiler ? 630
Do your compilers work on Windows Vista (Windows 7) ? 630
What does this function/procedure/routine do ? 630
I try to compile one of the provided examples and nothing happens, what is the problem? 630
Can I get your library sources ? I need to provide all sources with my project. 630
Can I use code I developed in your compilers in commercial purposes ? Are there some limitations
? 630
Why does an example provided with your compilers doesn’t work ? 630
Your example works if I use the same MCU you did, but how to make it work for another MCU ? 630
I need this project nished, can you help me ? 631
Do you have some discount on your compilers/development systems for students/professors ? 631
I have a question about your compilers which is not listed here. Where can I nd an answer ? 631
MikroElektronika
26
mikroBasic PRO for PIC32
27
MikroElektronika
mikoBasic PRO for PIC32
CHAPTER 1
INTRODUCTION
mikroBasic PRO for PIC32 is a powerful, feature-rich development tool for PIC32 microcontrollers. It is designed to
provide the programmer with the easiest possible solution to developing applications for embedded systems, without
compromising performance or control.
mikroBasic PRO for PIC32 IDE
MikroElektronika
28
mikroBasic PRO for PIC32
Introduction to mikroBasic PRO for PIC32
The PIC32 is a 32-bit family of general purpose microcontrollers. This is the Microchip’s rst inherent 32-bit (data)
microcontroller family. It builds upon the MIPS M4K 32-bit core, offering high-performance hardware multiply/divide
unit, programmable user and kernel memory partition through an unied 4GB virtual memory space, with powerful
peripherals to address a wide range of applications.
Having a wide range of application, being prized for its efciency, PIC32 MCUs are a natural choice for developing
embedded systems. mikroBasic PRO for PIC32 provides a successful match featuring highly advanced IDE, ANSI
compliant compiler, broad set of hardware libraries, comprehensive documentation, and plenty of ready-to-run
examples.
Features
mikroBasic PRO for PIC32 allows you to quickly develop and deploy complex applications:
- Write your source code using the built-in Code Editor (Code and Parameter Assistants, Code Folding,
Syntax Highlighting, Auto Correct, Code Templates, and more.)
- Use included mikroBasic PRO for PIC32 libraries to dramatically speed up the development: data
acquisition, memory, displays, conversions, communication etc.
- Monitor your program structure, variables, and functions in the Code Explorer.
- Generate commented, human-readable assembly, and standard HEX compatible with all programmers.
- Use the integrated mikroICD (In-Circuit Debugger) Real-Time debugging tool to monitor program execution
on the hardware level.
- Inspect program ow and debug executable logic with the integrated Software Simulator.
- Use Single Static Assignment optimization to shrink your code to even smaller size.
- Get detailed reports and graphs: RAM and ROM map, code statistics, assembly listing, calling tree, and
more.
- Active Comments enable you to make your comments alive and interactive.
- mikroBasic PRO for PIC32 provides plenty of examples to expand, develop, and use as building bricks in
your projects. Copy them entirely if you deem t – that’s why we included them with the compiler.
Where to Start
- In case that you’re a beginner in programming the PIC32 microcontrollers, read carefully the PIC32
Specics chapter. It might give you some useful information on the PIC32 constraints, code portability, and
good programming practices.
- If you are experienced in Basic programming, you will probably want to consult the mikroBasic PRO
for PIC32 Specics rst. For language issues, you can always refer to the comprehensive Language
Reference. A complete list of included libraries is available in the mikroBasic PRO for PIC32 Libraries.
- If you are not very experienced in Basic programming, don’t panic! mikroBasic PRO for PIC32 provides
plenty of examples making it easy for you to go quickly through it . We suggest you to consult Projects and
Source Files rst, and then start browsing the examples that you’re the most interested in.
Copyright (c) 2002-2010 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
29
MikroElektronika
mikoBasic PRO for PIC32
Software License Agreement
mikroElektronika Associates License Statement and Limited Warranty
IMPORTANT - READ CAREFULLY
This license statement and limited warranty constitute a legal agreement (“License Agreement”) between you (either as
an individual or a single entity) and mikroElektronika (“mikroElektronika Associates”) for software product (“Software”)
identied above, including any software, media, and accompanying on-line or printed documentation.
BY INSTALLING, COPYING, OR OTHERWISE USING SOFTWARE, YOU AGREE TO BE BOUND BY ALL TERMS
AND CONDITIONS OF THE LICENSE AGREEMENT.
Upon your acceptance of the terms and conditions of the License Agreement, mikroElektronika Associates grants you
the right to use Software in a way provided below.
This Software is owned by mikroElektronika Associates and is protected by copyright law and international copyright
treaty. Therefore, you must treat this Software like any other copyright material (e.g., a book).
You may transfer Software and documentation on a permanent basis provided. You retain no copies and the recipient
agrees to the terms of the License Agreement. Except as provided in the License Agreement, you may not transfer,
rent, lease, lend, copy, modify, translate, sublicense, time-share or electronically transmit or receive Software, media
or documentation. You acknowledge that Software in the source code form remains a condential trade secret of
mikroElektronika Associates and therefore you agree not to modify Software or attempt to reverse engineer, decompile,
or disassemble it, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding
this limitation.
If you have purchased an upgrade version of Software, it constitutes a single product with the mikroElektronika
Associates software that you upgraded. You may use the upgrade version of Software only in accordance with the
License Agreement.
LIMITED WARRANTY
Respectfully excepting the Redistributables, which are provided “as is”, without warranty of any kind, mikroElektronika
Associates warrants that Software, once updated and properly used, will perform substantially in accordance with the
accompanying documentation, and Software media will be free from defects in materials and workmanship, for a period
of ninety (90) days from the date of receipt. Any implied warranties on Software are limited to ninety (90) days.
mikroElektronika Associates’ and its suppliers’ entire liability and your exclusive remedy shall be, at mikroElektronika
Associates’ option, either (a) return of the price paid, or (b) repair or replacement of Software that does not meet
mikroElektronika Associates’ Limited Warranty and which is returned to mikroElektronika Associates with a copy of
your receipt. DO NOT RETURN ANY PRODUCT UNTIL YOU HAVE CALLED MIKROELEKTRONIKA ASSOCIATES
FIRST AND OBTAINED A RETURN AUTHORIZATION NUMBER. This Limited Warranty is void if failure of Software
has resulted from an accident, abuse, or misapplication. Any replacement of Software will be warranted for the rest of
the original warranty period or thirty (30) days, whichever is longer.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MIKROELEKTRONIKA ASSOCIATES AND ITS
SUPPLIERS DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS, EITHER EXPRESSED OR IMPLIED,
INCLUDED, BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO SOFTWARE, AND THE PROVISION OF OR
FAILURE TO PROVIDE SUPPORT SERVICES.
MikroElektronika
30
Loading...
+ 600 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.