'---------------Title-------------- ' File......blink1.pbp ' Started....11/3/03 ' Microcontroller used: Microchip Technology 16F88 ' microchip.com ' PicBasic Pro Code: micro-Engineering Labs, Inc. ' melabs.com '--------Program Desciption-------- ' LED flashes one time per second. '----------Related Lesson---------- ' blink1.pbp is used in the lesson INTRODUCTION TO PROGRAMMING 1 at: ' http://www.cornerstonerobotics.org/curriculum/lessons_year2/erii11_pic_introduction_programming1.pdf '-------------Comments------------- ' Use a solderless breadboards to fabricate ' the circuit blink1. For a tutorial about ' solderless breadboards, consult the book Robot ' Building For Beginners by David Cook. Also see: ' http://cornerstonerobotics.org/curriculum/lessons_year1/ER%20Week3,%20Solderless%20Breadboard.pdf ' ' In-Circuit Serial Programming(ICSP): See: ' http://cornerstonerobotics.org/curriculum/lessons_year2/erii15_in_circuit_serial_programming.pdf '----------PIC Connections--------- ' 16F88 Pin Wiring ' --------- ---------- ' RB0 150 Ohm resistor to LED to GND ' Vdd +5 V ' Vss Ground ' MCLR 4.7K Resistor to +5 V '-----New PicBasic Pro Commands---- ' The source for PicBasic Pro commands is ' from the PicBasic Pro Compiler Manual by ' microEngineering Labs, Inc. ' The PicBasic Pro Compiler Manual is on line at: ' http://www.microengineeringlabs.com/resources/index.htm#Manuals ' ' PAUSE period ' This will pause the program for a period of 1 ' to 65,535 milliseconds or .001 to 65.535 sec. ' Around page 112 in the PicBasic Pro Compiler Manual ' ' GOTO label ' Program execution jumps to location of label. ' Around page 73 in the PicBasic Pro Compiler Manual ' ' END ' Stops the program execution. ' Around page 68 in the PicBasic Pro Compiler Manual '---------Revision History--------- ' 5/24/08 Convert from PIC16F84A to PIC16F88 ' and add 16F88 oscillator initialization '-----------Initialization--------- TRISB = %11111110 ' Sets up RB0 pin of PORTB as an output ' and pins RB7-RB1 of PORTB as inputs OSCCON = $60 ' Sets the internal oscillator in the ' 16F88 to 4 MHz '-------------Main Code------------ loop: ' Label for beginning loop PORTB.0 = 1 ' Makes pin PORTB.0,(RB0), output at HIGH (+5 volts) Pause 500 ' Pause 500 milliseconds (0.5 seconds) with LED on PORTB.0 = 0 ' Makes pin PORTB.0,(RB0), output at LOW (0 volts) Pause 500 ' Pause 500 milliseconds (0.5 seconds) with LED off GoTo loop ' Jump to loop label ' Makes the program run forever. End ' This line is in case the ' the program gets lost.