'--------------Title--------------- ' File: 16F877A_blink2.pbp ' Started: 11/4/03 ' Microcontroller used: Microchip Technology 16F877A ' 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 (the 16F88 program) 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). ' Look 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). ' Look around page 104 in the PicBasic Pro Compiler Manual '-----Pin List for 40 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 PORTC.0 ' 9 PORTC.1 ' 10 PORTC.2 ' 11 PORTC.3 ' 12 PORTC.4 ' 13 PORTC.5 ' 14 PORTC.6 ' 15 PORTC.7 '--------Revision History------- ' 2/20/06: Comments added ' 10/27/07: Change MCU from 16F84A to 16F88 ' 1/1/09: Change MCU from 16F88 to 16F877A '---------Initialization-------- TRISB = %11111110 ' Sets up pin RB0 of PORTB as an output ' and pins RB7-RB1 of PORTB as inputs '----------Main Code----------- start: high 0 ' Makes pin RB0 output at HIGH (5 volts) Pause 250 ' Pause 250 milliseconds (1/4 seconds) with LED on Low 0 ' Makes pin RB0 output at LOW (0 volts) Pause 250 ' Pause 250 milliseconds (1/4 seconds) with LED off GoTo start ' Jump to loop label End