Page 127 - Robots Androids and Animatrons : 12 Incredible Projects You Can Build
P. 127

6.4 EPIC programming screen
                        Step 3: Programming the PIC chip

                                Connect the EPIC programming board to the computer’s printer
                                port using a DB25 cable. Start the DOS programming software. At
           106                  a DOS command prompt, enter

                                EPIC
                                Figure 6.4 is a picture of the programming screen. Use the Open File
                                option and select wink.hex from the files displayed in the dialog
                                box. The file will load, and numbers will be displayed in the window
                                on the left. Insert the 16F84 into the socket, and then press the pro-
                                gram button. The PIC microcontroller is programmed and ready to
                                go to work.

                        First BASIC program
                                We are ready to write our first program. Enter this program in your
                                word processor exactly as it is written:
                                ‘First BASIC program to wink two LEDs connected to port B.
                                Loop: High 0   ‘ Turn on LED connected to pin RB0
                                      Low 1   ‘ Turn off LED connected to pin RB1
                                      Pause 500  ‘ Delay for 0.5 seconds
                                      Low 0   ‘ Turn off LED connected to pin RB0
                                      High 1   ‘ Turn on LED connected to pin RB1
                                      Pause 500  ‘ Delay for 0.5 seconds
                                      Goto loop  ‘ Go back to loop and blink and wink LEDs
                                      End
                                                       Team LRN
            Chapter six
   122   123   124   125   126   127   128   129   130   131   132