Radi

Páginas: 11 (2615 palabras) Publicado: 13 de noviembre de 2012
Copyright © mikroElektronika, January 2012. All rights reserved.

TO OUR VALUED CUSTOMERS
I want to express my thanks to you for being interested in our products and for having confidence in MikroElektronika. The primary aim of our company is to design and produce high quality electronic products and to constantly improve the performance thereof in order to better suit your needs.

NebojsaMatic General Manager

The Microchip name, logo and products names are trademarks of Microchip Technology in the U.S.A and other countries.
Page 2

Table of Contents
1. Introduction to mikroBasic PRO for PIC® . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 04 2. Hardware Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . 05 3. Creating a New Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 06 Step 1 - Project Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 07 Step 2 - Add files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 10 Step 3 - Include Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Step 4 - Finishing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Blank new project created . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 4. Code Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5. Building the Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 6. Changing Project Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 17 7. What’s next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Page 3

1. Introduction to mikroBasic PRO for PIC®
mikroBasic PRO for PIC® organizes applications into projects consisting of a single project file (file with the .mbppi extension) and one or more source files(files with the .mbas extension). The mikroBasic PRO for PIC® compiler allows you to manage several projects at a time. Source files can be compiled only if they are part of the project. A project file contains: • Project name and optional description; • Target device in use; • Device clock; • List of the project source files; • Binary files (*.mcl); and • Other files. In this reference guide, wewill create a new project, write code, compile it and test the results. The purpose of this project is to make microcontroller PORTB LEDs blink, which will be easy to test. 01 06 02

07 03 05

04 08

01 Main Toolbar 02 Code Explorer 03 Project Settings
Page 4

04 Messages 05 Code Editor 06 Image Preview

07 Project Manger 08 Library Manager

2. Hardware Connection
Let’s make a simple“Hello world” example for the selected microcontroller. First thing embedded programmers usually write is a simple LED blinking program. So, let’s do that in a few simple lines of Basic code. LED blinking is just turning ON and OFF LEDs that are connected to desired PORT pins. In order to see the example in action, it is necessary to connect the target microcontroller according to schematicsshown on Figure 2-1. In the project we are about to write, we will use only PORTB, so you should connect the LEDs to PORTB only.
C22 22pF MCLR-RE3 RA0 RA1 RA2 RA3 RA4 X2 8MHz SEC RA5 RE0 RE1 RE2 C21 22pF VCC-MCU VCC GND RA7 RA6 RC0 RC1 RC2 MCU RD0 RD1 DIP 40 RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 VCC GND RD7 RD6 RD5 RD4 RC7 RC6 RC5 RC4 RD3 RD2

Figure 2-1: Hardware connection schematics
LD4 LED LD0 LED...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Radio
  • Radio
  • La Radio
  • Radio
  • Radio
  • radio
  • radio
  • La Radio

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS