
















































































Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Prepare-se para as provas
Estude fácil! Tem muito documento disponível na Docsity
Prepare-se para as provas com trabalhos de outros alunos como você, aqui na Docsity
Os melhores documentos à venda: Trabalhos de alunos formados
Prepare-se com as videoaulas e exercícios resolvidos criados a partir da grade da sua Universidade
Responda perguntas de provas passadas e avalie sua preparação.
Ganhe pontos para baixar
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Comunidade
Peça ajuda à comunidade e tire suas dúvidas relacionadas ao estudo
Descubra as melhores universidades em seu país de acordo com os usuários da Docsity
Guias grátis
Baixe gratuitamente nossos guias de estudo, métodos para diminuir a ansiedade, dicas de TCC preparadas pelos professores da Docsity
Experiências de robótica utilizando microcontroladores
Tipologia: Manuais, Projetos, Pesquisas
1 / 88
Esta página não é visível na pré-visualização
Não perca as partes importantes!
Robotics experiment with PIC microcontroller l 1
INNOVATIVE EXPERIMENT
2 l Robotics experiment with PIC microcontroller
4 l Robotics experiment with PIC microcontroller
Robotics experiment with PIC microcontroller l 5
Motor Gearbox – Uses a 4.5V (9V max.) and 180 mA DC motor with a ratio of 48:1; torque 4kg/cm; comes with the mounting.
Many sizes of Screw and Nut (Screw : 3x6mm.,3x10mm., 3x15mm.,3x25mm. and 3x35mm., 3mm. nuts), Flat head screws and Thumb screws. Set of Plastic Spacers (length : 3mm., 15mm. and 25 mm.) Hex Standoffs : 3x30mm.
Track wheel set - includes 3- lengths of Track wheel, many support wheels and sprockets, axels and shaft bases
The Plate set and 4-types of the color-mixed Plastic Joiner (10 of Straight Joiner, 10 of Right-angle Joiner, 10 of Obtuse Joiner and 3/5/12 Holes straight joiners)
Robotics experiment with PIC microcontroller l 7
The RoboPICA kit uses the PIC Micrcontroller PIC16F887. Builders can write the controlled program in assembly, BASIC and C language. Only BASIC and C program language requires the use of a compiler software.
However in this kit all examples are in C language with mikroC compiler from mikroElektronika (mikroE : www.mikroe.com). The Robo-PICA robot kit can use this com- piler as well.
The demo version of Mikro C compiler is used for this robot kit. Builders who need to develop the advance program will need to purchase the full version from MikroE at their webiste. The demo version of mikroC can be downloaded from http:// www.mikroe.com. However in the Robo-PICA robot kit, this software is in the bundled CD-ROM. You must download the mikroC manual latest version from mikroElektronika website. This building manual does not describe all the instructions.
Another one tools is PIC microcontroller programmer software. The Robo-PICA provides a USB programmer. Its function is compatible Microchip’s PICkit2TM^ program- mer. The software can use PICkit2 TM^ programming software. Free downlaod the latest version at www.microchip.com.
mikroC is a powerful, feature rich development tool for PICmicros. It is designed to provide the customer with the easiest possible solution for developing applications for embedded systems, without compromising performance or control.
mikroC provides a successful match featuring highly advanced IDE, ANSI com- pliant compiler, broad set of hardware libraries, comprehensive documentation, and plenty of ready-to-run examples.
mikroC allows you to quickly develop and deploy complex applications: l Write your C source code using the highly advanced Code Editor l Use the included mikroC libraries to dramatically speed up the development: data acquisition, memory, displays, conversions, communications…
Special thanks : All information about mikroC Compiler and PICkit2 Programming software are referenced from owner website and documentation (www.mikroe.com and www.microchip.com). Thanks for all free and open-source developement tools. User who need the full features of mikroC compiler can purchase on-line at www.mikroe.com.
8 l Robotics experiment with PIC microcontroller
l Monitor your program structure, variables, and functions in the Code Explorer. Generate commented, human-readable assembly, and standard HEX com- patible with all programmers.
l Inspect program flow and debug executable logic with the integrated Debugger. Get detailed reports and graphs on code statistics, assembly listing, calling tree…
l mikroE have provided plenty of examples for you to expand, develop, and use as building bricks in your projects.
l In Demo version, hex output is limited to 2k of program words.
Download the latest version from mikroElektronika website; www.mikroe.com. Run the installation file. Addition, you must download the 5 of necessary documentation files about compiler manual, Creating First Project in mikroC for PIC, Quick Reference Guide for C language, Compilers IDE document and Obtaining and Activating the Li- cense Key.
You can see all C syntax and all function details from the mikroC manual. In this manual would be describe about the robot activities only.
The PICkit™ 2 Microcontroller Programming software is capable of programming most of Microchip’s Flash microcontrollers. For specific products supported, see the README file or check with Microchip’s website.
The full featured Windows programming interface supports baseline (PIC10F, PIC12F5xx, PIC16F5xx), midrange (PIC12F6xx, PIC16F), PIC18F, PIC24, dsPIC30, and dsPIC families of 8-bit and 16-bit microcontrollers, and many Microchip Serial EEPROM products.
The PICkit™ 2 Microcontroller Programming software works with a PICkit2TM^ OEM USB programmer. The USB programmer is the in-system programming via ICD2 jack.
The working software of the USB programmer is PICkit2TM^ Programming Software. The newer version is developed from Microsoft.NET. Thus, user must install the Microsoft.NET Framework first.
10 l Robotics experiment with PIC microcontroller
(1) Connect the USB cable between the programmer and Computer’s USB port.
(2) On successful connnection, the message PICkit 2 found and connected will appear in the Status box.
Robotics experiment with PIC microcontroller l 11
(3) If the connection is incompleted. The message PICkit 2 not found. Check USB
box. Check the cables and connections.
(4) Go to Tools menu and select Check Communication command. If all’s cor- rect, the message PICkit 2 found and connected will be show in the Status box.
However if everytime during re-connection or checking hardware, it does not connect the target microcontroller at ICD2 jack and ICSP point or any mismatch in number, the warning dialog box will appear. It will warn you about any error supply voltage. You need not worry about this, click on the OK button to continue.
Robotics experiment with PIC microcontroller l 13
Forced PICkit2 : Set the programmer to supply the suitable voltage to tar- get microcontroller. After select, LED at Targer position will light and at VDD PICkit2 box on screen will check atr On position. User can adjust the supply voltage from selection box in the right-hand (not suggess to use this option).
Forced Target : Select to inform the software knows about the target has voltage applied. Suggess to use this option for safty operation. Also in this option, user must apply the supply voltage to the target PIC microcontroller.
14 l Robotics experiment with PIC microcontroller
Displays all user manual, technical document and a dialog box indicating the version and date.
The PICkit2 TM^ Programming Software supports the editing memory value in each address, both Flash program and data EEPROM memory. User can click at any address that need to change the value and input the new value directly.
Moreover user can select to access both memory types and only one.
Click at Enabled box in Program Memory border to remove the mark. At EEPROM data border, it will show Write and Read EEPROM data only in red message. It means user can read and write only EEPROM data memory. See the illlustration below.
16 l Robotics experiment with PIC microcontroller
(3) Browse to the directory where the latest Operating System code was saved, Select the PK2*.hex file and click on the Open button as shown in figure below.
(4) The progress of the OS update will be displayed in the status bar of the pro- gramming software and the Busy LED on the USB Microcontroller Programmer will flash. When the update completes successfully, the status bar will display “Operating System Verified” and the Busy LED will go out. The operating system update is then complete.
The PICkit2TM^ Programming Software has 7 short cut buttons as follows : (1) Read : Read data from target MCU. (2) Write : Write or program the code into target MCU. (3) Verify : Verify programming. (4) Erase : Erase data in target MCU. (5) Blank Check : Check blank data in target MCU. (6) Import Hex File + Write Device : Open the HEX file and program into target MCU automatically
(7) Read Device + Export Hex File : Read device and save as the HEX file automatically.
The USB Programmer comes with an ICD2 cable for connecting between the pro- grammer and the target board. The wire assignment of this cable is shown below.
Vpp
GND
PGMPGD PGC Vdd
Top view
Vpp Vdd
GND
PGC PGDPGM Vdd Vpp GND PGDPGMPGC
6"
ICD2 jack (^) ICD2 cable RBX-877 V2.0 Robot Controller board
USB Programmer side
Vpp
GND
PGMPGD PGC Vdd
ICD2 jack pin assignment on target board
Robotics experiment with PIC microcontroller l 17
The summary of steps of program the Robo-PICA robot kit are as follows :
From here, we will describe about the getting start of programming development for the Robo-PICA. This robot kit is controlled by the RBX-877 V2.0 Robot Controller board. The heart of this controller board is PIC16F887 chip. The programming development in- cludes 2 main steps as C programming development and Download the HEX file to microcontroller.
The C programming development will be using mikroC IDE included C compiler and the other provides support tools and libraries. However this kit will work with the demo version. You can purchase the full version for more programming at www.mikroe.com.
You can develop the C project file and test the operation of the Robo-PICA’s hard- ware from these procedures below.
1.5.1 Install the mikroC software tools following the instruction manual. See this docu- ment in Robo-PICA’s CD-ROM or download the update document from www.mikroe.com.
1.5.2 Install the PICkit2 Programming software for USB programmer. 1.5.3 Open the mikroC IDE by clicking at Start à Programs à Mikroelktronika à mikroC à mikroC. The main window will appear. The Figure 1-1 shows the main window of mikroC IDE and the important components.
Robotics experiment with PIC microcontroller l 19
1.5.4 Create the new project file by entering to menu Project and select New Project...
1.5.5 The New Project window will appear. You must set the important parameter as follows :
20 l Robotics experiment with PIC microcontroller
(a) Project Name : Put the project name. mikroC IDE will create the folder to support your project file which includes the C sourcecode. For example is Blink_LED project file.
(b) Project Path : Select the location of your project file. Click the Browse button to select the location. For example is D:\ROBO-PICA
(c) Description : Put the information of your porject file. For example is “Robo PICA Code Blinking LED on RB3”
(d) Device : Select the target microcontroller. For the Robo-PICA kit and RBX-877V2.0 Controller board must select to PIC16F
(e) Clock : Select the clock frequency for the target microcontroller. For the Robo-PICA kit and RBX-877V2.0 Controller board use 20MHz clock. Put the value 020.000000.
(f) Device Flags : Set the configuration for the target microcontroller. Developer
can set very easy by Default button. The Default will set the 3 main configurations
as follows :
High Speed Oscillator enabled (HS_OSC) for 10MHz and above clock frequency.
Watchdog timer disabled (WDT_OFF) Low Voltage Programming disabled (LVP_OFF) After the configuration is being set, click on the OK button. mikroC IDE would close the New Project window and create the Blink_LED.C file with the blank editor area for writing the C program.