On Fri, 5 Dec 1997 18:08:19 -0000 Mark Birks writes: >Hi folks, > >I have JUST started playing around with my first (of many - hopefully) >PIC projects. > >I simply wanted to flash an LED using a demo program which put the PIC >to sleep : > > LIST P=16C64 > ;WDT enabled > MOVLW 0 > TRIS 6 > OPTION >LOOP SLEEP > INCF 6,1 > GOTO LOOP > END ** snip** Mark, The option and the tris registers are located in bank 1 of ram. You must set RP0 in the status register to access them then switch back to bank 0 to access port b. I use the following at the beginning of all my programs: #define bank0 bcf status,rp0 #define bank1 bsf status,rp0 Then in the program I type bank0 instead of bcf 3,5. You also need to use the "include" file at the begining of you program for the PIC that you are using. Your code might then look like this: list p=16c64 title "Your project title or ??" include p16c64.inc #define bank0 bcf status,rp0 #define bank1 bsf status,rp0 start bank1 ;select bank 1 for direct addressing. movlw 0 ;clear w. TRISB ;set all port b pins as outputs. OPTION ;set all option register bits to 0. bank0 ;select bank 0 for direct addressing. LOOP SLEEP INCF PORTB,f ; GOTO LOOP ; END Using the include file allows you to use nomenclature like INCF PORTB instead of INCF 6,1. Open the p16c64.inc file and look at it. You will get the idea. You might also look at fig 4-25 and the associated discussion of direct and indirect addressing in the data sheets. Keep at it and you'll be flashing leds in no time! Jeff Scholz