Home

BASIC CHIPINO Manual

image

Contents

1. PBPK ry POBASI RRO Comoe r MICROcHIE STUDENT PICkit BASIC CHIPINO Manual Installing the Software The PICBASIC PRO compiler sample version comes with its own windows editor for writing the programs and sending the binary file to the programmer The editor is called the MicroCode Studio The PICkit 2 programmer software has a stand alone application which allows us to use the PICkit 2 or with the MicroCode Studio editor to one click compile and program the PIC microcontroller using the ICSP We have to set all this up on your PC before we can create the first project The steps we will take are 1 Download the PBP3 Demo version from melabs com at http pbp3 com download html or load from the CD included 2 Install the PBP3 compiler and when asked for a registration key enter the registration key included on your sales receipt This will enable the Student version of PBP3 3 Install MicroCode Studio Software this is part of the PICBASIC PRO installation 4 Setup the PICkit 2 software included on the PICkit 2 CD Installing MicroCode Studio and PBP 3 You need to run the PBP 3 installation file so run the PBP3 Setup file to install the PBP 3 compiler The compiler will step you through several screens shown in Figures 1 thru m p jE Setup PBP3 local Sa Welcome to the PBP3 Setup Wizard This will install PICBASIC PR O tm Compiler 3 0 1 0 on your PICBASIC PRO Compiler sl lira that you
2. Refer to the PICkit 2 or PICkit 3 User manual for operation of the MCLR box 4 Now click on the Auto Import Hex button and a window will pop up asking you to locate the hex file you just compiled Auto Import Hex ot YW i ice ite Device me leyre em Find the hex file and click on Open button ijb LABXT 16F877A 9 23 2011 2 20 Jo LABXUSB 18F4550 9 23 2011 2 20 AP C BLINK HEX 3 28 2012 4 51 E r P 20m a ax e um m e File name BLINK HEX HEX files hex The programmer will begin programming the microcontroller You will see a green bar scroll across the programming progress bar and then a message indicating programming was successful LE PICkit 2 Success Screen Waiting for file update Click button again to exit gt Programming device Program EEPROM UserlD PICkit 3 Success Screen 5 The program should be running on your board 6 Make any changes to your code and then click on Compile button The PICkit programmer will automatically load the new hex file if there are no errors and program the device automatically a Compile 7 When you re done and are ready to shut down click on Auto Import button to stop the automatic update mport Hex Auto San 8 Uncheck the Target Power On box to shut off power to the PICkit and close the PICkit 3 application by click on the red x in the corner AN MICROCHIP Targe
3. Delay 1 2 second The program then turns the LED off by setting the same pin low LOW D13 LED GTT The same pause command line delays another 2 second PAUSE 500 Delay 1 2 second The program then uses the GOTO command to jump back to the main label and repeat the operation over again GOTO main Loop back and do it again Now that we have an understanding of the program lets actually program the CHIPINO to flash the LED Build the project shown in Figure 2 1 on a breadboard or you can use the demo shield below It has the connections already soldered in place so just plug the shield into the CHIPINO module Figure 2 3 CHIPINO Demo Shield How to Program CHIPINO 1 Enter the software listing into the MicroCode Studio editor window and save it as flash pbp or you can download it from www elproducts com gt Download page 2 Make sure Target Processor window in MCStudio shows 16F886 Figure 2 4 3 Connect the CHIPAXE programmer to the development board with the PIC12F683 in its socket The dotted side of the ribbon cable should match up to the arrow on the CHIPAXE board Figure 2 4 4 Click on the little arrow next to the compile program button it s next to the target processor window from step 2 and make sure CHIPA XE is selected Figure 2 5 5 Click on the compile program button to program the CHIPAXE module Figure 2 5 This should compile your program and bring up the pk2cmd exe command line pop up w
4. programming Microchip PICs The main point is you can modify the chipino bas file if you are an experienced programmer The contents of chipino bas are shown in Appendix C The main program loop begins with the label main followed by a semi colon We will use this marker in a future GOTO command main The digital I O pins on the CHIPINO are DO through D13 The digital pins can be inputs or outputs The PIC16F886 has a couple of internal registers that control these direction of these pins to set them to input or output TRISC controls DO through D7 and TRISB controls D8 through D13 The data to be sent out the pin or read from the pin is then stored in PORTC register for DO through D7 and PORTB register for D8 through D13 These can be controlled by writing to the TRIS and PORT registers directly but PBP3 makes all this easy as both of these registers are automatically controlled with the HIGH or LOW commands Both HIGH and LOW set the pins to an output and then set the PORT pin to a 0 for LOW and a 1 for HIGH In this example the software uses the HIGH command to place a high signal on pin D13 This will light the LED PBP 3 doesn t care if you use capitals or small case letters The MCStudio should recognize the command an automatically capitalize the command HIGH DL PERD OR The next command is the PAUSE command This command just creates a 2 second delay as the value 500 represents 500 milliseconds or 1 2 second PAUSE 500
5. and installed PLEASE RESTART THE SYSTEM after MPLAB is installed Click Finish to proceed with additional installation microEngineering Labs Inc Pepa a Install Microcode Studio IDE 5 0 0 0 included recommended O Install MicroCode Studio Plus IDE 5 0 0 0 foptional requires purchase of product key Download MPLAB IDE From Microchip required Figure 7 Final Setup Screen When the PBP 3 installation is complete the last screen Figure 7 will offer to Install MicroCode Studio IDE Make sure that option 1s checked before clicking on the Finish button The MicroCode Studio will install automatically after you press Finish It will also install MPLAB if you don t have that on your PC The MicroCode Studio will begin with the screen in Figure 8 F Setup MicroCode Studio MCSX t i Welcome to the MicroCode Studio f MCSX Setup Wizard This wall install MicroCode Studio MCS on your computer Ik is recommended that vou close all other applications before continuing Click Next to continue or Cancel to exit Setup Figure 8 First MicroCode Studio Screen P Setup MicroCode Studio iE License Agreement Please read the following important information before continuing Please read the following License Agreement You must accept the terme of this agreement before continuing with the installation License Agreement Please read the following carefully before using this so
6. dose all other applications before PLEASE RESTART the system after PBP and additional applications are installed Upon the next system start a utility called PBP_MPASM_Connector will finish the compiler setup microEngineering Labs Inc Click Next to continue or Cancel to exit Setup wew melabs com Figure 1 First PBP 3 Installation Screen i Setup PBP3 Slee License Agreement Please read the following important information before continuing Please read the following License Agreement You must accept the terms of this agreement before continuing with the installation This software and accompanying documentation is copyright c microEngineering Labs Inc tis commercial software Itis not freeware or shareware microEngineering Labs Inc the Company is willing to license PICBASIC PRO tm Compiler the Software to the purchaser of the software Licensee only on the condition that Licensee accepts all of the terms and conditions set forth below By installing and or using this software Licensee is agreeing to bebound by these terms and conditions Commercial Use I accept the agreement E I do not accept the agreement Figure 2 License Agreement Screen JE setup PBP3 Parr Select Destination Location Where should PBP3 be installed Setup will install PBP3 into the following folder To continue dick Next If you would like to select a different folder dick Browse
7. Browse At least 141 4 MB of free disk space is required Figure 3 Default Installation Location r x 7 i Setup PBP3 ol ee Select Start Menu Folder Where should Setup place the program s shortcuts E Setup will create the program s shortcuts in the following Start Menu folder To continue dick Next If you would like to select a different folder cick Browse BPS from melabs Don t create a Start Menu folder Figure 4 Windows Start Menu Title i Setup PBP3 Ready to Install Setup is now ready to begin installing PBP3 on your computer Click Install to continue with the installation or dick Back if you want to review or change any settings Destination location C PBP3 Start Menu folder PBP3 from melabs Figure 5 Ready to Install Screen ie Setup PBP3 Installing Please wait while Setup installs PBPS on your computer Creating shortcuts CH Start Menu Programs PBPS From melabs MPLAB Installation Information url Cancel i Figure 6 Installation in Progress ie Setup PBP3 Additional Applications PICBASIC PRO Compiler requires an Integrated Development Environment application IDE that provides the user interface and program editing capability Mecanique s MicroCode Studio IDE is included PIC BASIC PRO Compiler Microchip s MPLAB includes the MP ASM Assembler which PEP requires so MPLAB or MPLAB should always be downloaded
8. Figure 13 MicroCode Studio PICBASIC PRO flashtest690 pbp z laj x File Edit view Project Help D2 bl aoas ly 16F690 7 t Name Flash BAS t Author Chuck Hellebuyck Notice Copyright c 2008 fselect VIZW EZDITOR OPTIONS All Rights Reserved t Date 10 13 2008 t Yersion 1 0 Notes ob ot ot ot ob ob ob of ot ot ob ob ob ob ob ot ob ob ob ob ot ob ot ob ob ob ot ob ot ob ob ob ob ob ob ot ot ob ob ob ob ot ot ot ob ob ob ob ot ob ot ob ob ob ob ot ot ob ob ob ot ot tot cMiconod 0 cmMZ2conod 0 main HIGH 8 PAUSE 1000 LOW 8 PAUSE 1000 GOTO main O Ready inzz col30 sen O SAna Qe An we eer lv Om Yr tea aa E eB om Figure 13 MicroCode Studio IDE Install the PICKit 2 Programmer Install the PICkit 2 Standalone Software from the PICkit 2 CD by clicking on the PICkit2Setup installation file Ca PICK Setup e Windows Installer Package I 4 131 KB Follow through all the installation screens until the PICkit 2 is completely installed and a PICkit 2 icon appears on your desktop PICK itd k PE a yA We re now ready to program the BASIC CHIPINO Flash an LED Now we can write our first program that will simply flash an LED connected to the pin 13 of the CHIPINO module This is a simple project but proves out the whole process of writing software programming the microcontroller and watching the applicatio
9. ftware By installing the oftware you are agreeing to be bound by the following terms and conditions PLEASE NOTE THAT THIS SOFTWARE PACKAGE IS NOT COPYRIGHT FREE IF YOU WISH TO REDISTRIBUTE THIS SOFTWARE PACKAGE OF MAKE IT AVAILABLE FOR DOWNLOAD VIA THE INTERNET OR WORLD WIDE WEB ww OL MUST CONTACT MECANIQUE UE FIRST AND OBTAIN PERMISSION Copyright All ttle and copyrights in and to the Software Package and any copies of the do not accept the agreement Back Cancel Figure 9 License Agreement Screen P Setup MicroCode Studio 5 xl Select Destination Location Where should MicroCode Studia be installed CJ Setup will install MicroCode Studio into the following folder To continue click Next IF you would like to select a different folder click Browse Browse Al least 9 9 MB of free disk space is required Back Cancel Figure 10 Default Location Installation Screen gt Setup MicroCode Studio Installing Please wait while Setup installs MicroCode Studio on your computer Figure 11 Installation in Progress Screen F Setup MicroCode Studio MC5X Completing the MicroCode Studio MCSX Setup Wizard Setup has finished installing MicroCode Studio MCS on your computer The application may be launched by selecting the installed icons Click Finish to exit Setup After installation is complete start Microcode studio and it should look similar to the picture in
10. indow You should see it program and then complete the process The pop up window should close after a three second delay The red LED should be blinking on the development board If you don t get this working go back through the steps and see if you missed something Getting a simple LED to flash is a great first project File Edit View Project Help Mew p Open Save Compile Program F The PICiI6F886 Cut Copy E aste i must show in the Inforpeth fo window or you Microcontra r 16F856 i OBtional Command Line might get an error BLINKX4 Matrix V2_1_CP Code Explorer H Includes eeeeeeeeeeeeeeeaee G Defines 2 Name z flas O Constants 3 Author Chucl O Variables 4 Notice Copy Figure 2 4 Microcontroller Window Figure 2 5 Connect PICkit 2 to the CHIPINO board File Edit View Project Help g Click on the Mew p Open Save Cut Compile button X Compile Py Compile Program Information nw to build the file Microcontroller Optional Command Line we will propa into the Code Explorer j BLINK BLINKX4 Matrix_V2_1_CP CHIPINO E fm Includes 1 ttttttEEEEEEEEEEH H O Defines 2 Namea lasl T Constants 3 Author Chuci E Variables 4 WNotice Copy Figure 2 6 Compile Icon Once you have compiled your PBP3 program without errors it s time to program the microcontroller The directions below show how to use the PICkit 2 or PICkit 3 program
11. mer 1 Open the PICkit Programmer software A window similar to below should be displayed PICkit 3 screen shown Bl CK 3 Programmer TT e a File Device Family Programmer Tools e Help Device Configuration Configuration 001C Device PIC10F200 User IDs FF FF FF FF Checksum EF1D OSCCAL FFF Found PICkit 3 SN BUR120293590 AS Microchip Loaded device file with 679 devices v Target Power mm _ ____ On Read Wie Veny Erase Blank Check MCLR Program Memory J Enabled Hex Only v Source None Empty Erased EEPROM Data Auto Import Hex Te Write Device Read Device Export Hex File 2 Select the PIC16F886 from the drop down menu Special Note PICkit 3 will automatically load a new firmware into the programmer PICkit 2 will read the part on the connected board and automatically select the part from the drop down menu PICkit 2 doesn t need to load new firmware as it uses a different algorithm to program the part 3 Now click on the Target Power On box to make a check appear as seen below This will power up the board connected to the PICkit 3 If you already have power connected to the board then you can skip this step as both PICkit programmers will sense the power is connected If you want to run at a different voltage then you can change it by clicking on the up down arrows of the voltage level box AN MICROCHIP Target Power v On 5 0 MCLR
12. n run Figure 2 1 shows the completed project built into a breadboard The CHIPINO powers the breadboard and the red LED will flash at a rate of 1 2 second on and 2 second off soe eseeereee ee E E E E hc E E E e E te ee eee ee ee ne RU AI CREME CE E e CORO EOEES ORCC e E EEE EEEE EEE E TE EEEE TEETE ee eae ee E en E ft E FP Fe Fe E U p E E f a ss E ft te te Pe eC eT PC E E o E o E E ED E ee se e e e O O a e E e E ae eee A t 2 E E et cP Pa eae ae E or eee ee ee soe es eee ee reheat ee b of a k 8 Figure 2 1 Flash LED Project Hardware The hardware is built on a breadboard that has letters lined up with the column of connections and numbers for the rows The connections can be reproduced based on the table of connections below Figure 2 2 also shows the schematic for this project Connection Table CHIPINO Pin Digital 13 tO a l CHIPINO GND to a 10 Jumper e 10 to 10 1k ohm E Lo 1 10 Red LED Anode i 1ll Cathode i 10 At Su RAO ANG RA1 ANI RA2 AN2 RB6 PGC RA3 AN3 RB PGCD RA4 T CKI RCB T10SO yZ RED RAS AN4 RC1 T10S1 OSC1 CLKIN RCe CCP1 OSCe CLKOUT RC3 SCK MCLR YPP RC4 SDI v7 RCS SDO RC6 TX RC7 RX VSS VSS sis NZ Figure 2 2 Flash LED Schematic Software 98849193Id co N E DO E Tkkxxkxkxxkxkxx xkxkxkxkxk xkxk xk xkxk xkxkxk xk kxkxkxkxkxkxkxkxk xkxkxk xkxkxk xkxkxkxkxkxkxkxk
13. t Power On 5 0 MCLR Next Steps Simple next steps are to change the pause value to a lower number to flash the LED faster You could also connect the LED to a different pin and then change the number in the high and low command lines to make that new connection pin flash the LED
14. xkxkkxk kxxkxk kxx k x Name flash pbp Author Chuck Hellebuyck ee Notice 7 COpyrirghnt ec 2012 Electronic Products nA All Rights Reserved x Date E V N Version 1 0 x Notes mal gt JCHLPEN Pin Digitar 13 te a ki oe CHEE LNO GND to a 10 r Jumper ea LO TO TLO d gt Ik ohm SO LO ESL oe 4 Red LED Anode i 1l Cathode i 10 VTKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK include chipino2zbas main HIGH D13 LED on PAUSE 500 Delay 1 2 second LOW D13 hED COLL PAUSE 500 Delay 1 2 second GOTO main Loop back and do it again The software is quite simple because it uses some of the commands that make PBP3 easier to use that many other compilers The first section 1s required to include the chipino bas file This file defines all the digital pins DO thru D13 and analog pins A0 A4 You can view this file to see the setup and can modify it if you want PBP3 places the contents of the chipino bas file directly at that location just as if you typed it in Therefore you can modify it for anything you want to be included in every CHIPINO project you create include chipino bas The chipino bas file also sets the program speed to match the 16 MHZ oscillator on the CHIPINO module The configuration settings are also handled by the chipino bas file so the MCLR pin is external and the write protection is turned off You don t have to worry about any of this if you are new to

Download Pdf Manuals

image

Related Search

Related Contents

  2.4 Systematic Troubleshooting on ABS Systems  TeCom-PRO TeCom-PRO - Free Radio Network CH  2755-2.59, Downloading Match Codes from Attnd.Workstation to  MANUEL D`UTILISATION  SEGUR-Track Manual instalacion 9.2 11-2009  Page 8 - Bibliothèque numérique de Roubaix    ノ NH-800 NH-800D シングルサイズ ダブルサイズ 医療用具承認番号  Intraoral Scans - Up To  

Copyright © All rights reserved.
Failed to retrieve file