'--------Title-------- ' File......blink3.pbp ' Started....4/13/06 ' Microcontroller used: Microchip Technology 16F88 ' microchip.com ' PicBasic Pro Code, micro-Engineering Labs, Inc. ' melabs.com '--------Program Desciption-------- ' Turns one LED on and off 5 times. '----------Related Lesson---------- ' blink3.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 ' ' FOR Count = Start TO End {STEP {-} Inc} ' {Body} ' NEXT {Count} ' If no STEP is given, the increment is automatically +1. ' Look around page 70 in the PicBasic Pro Compiler Manual '--------Revision History-------- ' 10/27/07: Change MCU from 16F84A to 16F88 '-----------Variables----------- c0 VAR BYTE 'Variable for counting '---------Initialization-------- PORTB = %00000000 'Sets all PORTB pins to LOW TRISB = %00000000 'Sets up pins RB7-RB0 of PORTB as outputs OSCCON = $60 'Sets the internal oscillator in the '16F88 to 4 MHz '-----Pin List for 18 Pin Microcontrollers----- ' 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 '--------Main Code-------- For c0 = 1 TO 5 ' Loop through count 5 times ' Since STEP is not given, the ' increment is automatically +1. High 0 ' Turns on LED connected to PORTB.0(RB0) Pause 500 ' Holds LED on for 500 milli-seconds Low 0 ' Turns off LED connected to PORTB.0 Pause 500 ' Holds LED off for 500 milli-seconds Next ' Goes to next c0 End