'--------------Title--------------- ' File: blink2.pbp ' Started: 11/4/03 ' Microcontroller used: Microchip Technology 16F88 ' microchip.com ' PicBasic Pro Code: micro-Engineering Labs, Inc. ' melabs.com '---------Program Desciption-------- ' LED flashes on/off one time per half second. '----------Related Lesson---------- ' blink2.pbp is used in the lesson PIC PROGRAMMING 2 at: ' http://cornerstonerobotics.org/curriculum/lessons_year2/erii12_pic_programming2.pdf '-----New PicBasic Pro Commands----- ' The PicBasic Pro Compiler Manual is on line at: ' http://www.microengineeringlabs.com/resources/index.htm#Manuals ' ' HIGH pin ' Sets pin to HIGH(+5v) Pin must be a number between ' 0 and 15(see below). ' Around page 74 in the PicBasic Pro Compiler Manual ' ' LOW pin ' Sets pin to LOW(0v) Pin must be a number between ' 0 and 15(see below). ' Around page 104 in the PicBasic Pro Compiler Manual '-----Pin List for 18 Pin Microcontrollers----- ' Check individual data sheets for output/input pins See: ' http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2046 ' Pin PORT/Pin ' 0 PORTB.0 ' 1 PORTB.1 ' 2 PORTB.2 ' 3 PORTB.3 ' 4 PORTB.4 ' 5 PORTB.5 ' 6 PORTB.6 ' 7 PORTB.7 ' 8 PORTA.0 ' 9 PORTA.1 ' 10 PORTA.2 ' 11 PORTA.3 ' 12 PORTA.4 ' 13 Not Used ' 14 Not Used ' 15 Not Used '--------Revision History------- ' 2/20/06: Comments added ' 10/27/07: Change MCU from 16F84A to 16F88 '---------Initialization-------- TRISB = %11111110 ' Sets up pin B0 of PORTB as an output ' and pins B7-B1 of PORTB as inputs OSCCON = $60 ' Sets the internal oscillator in the ' 16F88 to 4 MHz '----------Main Code----------- start: high 0 ' Makes pin B.0 output at high (5 volts) Pause 250 ' Pause 250 milliseconds (1/4 seconds) with LED on Low 0 ' Makes pin B.0 output at low (0 volts) Pause 250 ' Pause 250 milliseconds (1/4 seconds) with LED off GoTo start ' Jump to loop label End