On Tue, Aug 05, 2008 at 05:46:37AM -0400, Daniele Salatti wrote: > movlw 0x07 > movwf CMCON ;turn comparators off (make it like a 16F84) > > bsf STATUS, RP0 ;select bank 1 > movlw b'00000000' ;set PortB all outputs > movwf TRISB > movwf TRISA ;set PortA all outputs > bcf STATUS, RP0 ;select bank 0 > > Loop > movlw 0xff > movwf PORTA ;set all bits on > movwf PORTB I think the problem is that you're not changing banks before accessing a register. Here is how you correct this: > movlw 0x07 banksel CMCON > movwf CMCON ;turn comparators off (make it like a 16F84) > > bsf STATUS, RP0 ;select bank 1 > movlw b'00000000' ;set PortB all outputs banksel TRISB ; TRISA is in the same bank as TRISB. > movwf TRISB > movwf TRISA ;set PortA all outputs > bcf STATUS, RP0 ;select bank 0 > > Loop > movlw 0xff banksel PORTA > movwf PORTA ;set all bits on > movwf PORTB Matthew -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist