hi Thomas, seem to be you have some errors this may help you: start bcf STATUS,RP0 ;change to bank 0 clrf PORTB ;clear portb bsf STATUS,RP0 ;change to bank 1 ;Try dont'n use bsf or bcf on ports because first read the port ;and then write on port, and you just power on the PIC, you dont'n ;know in what state is the port or do you know ? ; movlw 00H ; ; movwf TRISB ; Set port b as outputs ; bsf TRISB,7 ; set pin rb7 as input ; this code may help you: movlw b'1000000' ; movwf TRISB ; set rb7=input, rb6~rb0=outputs bcf OPTION_REG,7 ; make internal pull-up on portb; bcf STATUS,RP0 ; change to bank 0 l001 call Delay ; bsf PORTB,3 ; set portb pins high ; bcf PORTB,2 movlw b'xxxxx10x' movwf PORTB ; set rb3 = high, rb2 = low call Delay ;delay of 18.52 uSec ; bcf PORTB,3 ; bsf PORTB,2 movlw b'xxxxx01x' movwf PORTB ; set rb3 = low, rb2 = high goto l001 ; the leds change at 1 / ( 2 x delay) = 27 Hz Delay movlw 0x01 ; if you want to see the leds flah increase the ; register cou1 to 2 Delay1 movwf cou1 Del1 Delay2 movlw 0xff movwf cou2 Del2 Delay3 movlw 0xff movwf cou3 Del3 decfsz cou3 ; loop3 of 3 x 255 cycles goto Del3 ; loop3 = 71.24 uSec decfsz cou2 ; loop2 = 255 x( loop1 + 5 cycles ) goto Del2 ; loop2 = 13.52 mSec decfsz cou1 ; loop3 = loop2 + 6 cycles goto Del1 ; loop3 = 18.52 mSec return end other thing, you can use the TRIS instruction to avoid the bank change but microchip doesnt'n recoment. Felix Centeno centella@telcel.net.ve http://www.geocities.com/CapeCanaveral/Hangar/2372/ ---------- > From: Thomas Mxrch > To: PICLIST@MITVMA.MIT.EDU > Subject: HELP!!! > Date: Viernes 14 de Noviembre de 1997 06:43 AM > > Hi all > > I'm new at making programs for the PIC* processors. And now i have some > trouble, I'm using a 16c84. I have made a very simple program, that just > flashes with two led's, sometimes it works (and both led's flash), but > mostly it's only one of them flashes, or nothing at all happens! Is there > any logical explanation of this behaviour? I'm using a xtal of 3.579545Mhz, > 33pf to ground on each side of the xtal, and 100k from MCLR to VDD. The > program i'm using is as follows: