ckchan wrote: > > Greetings, > > i really need some help here. been debuging for 2 days ! :O please tell > me what's wrong with this short code. it's to make a LED blink. that's > all. i tried the delay routine on PIC16F84, it's working. the LED blink > ! but not with PICF874. The LED will ON permenantly. any configuration i > missed out ? Thanks ! You have not initialised any other port except portD. Try setting all the pins for the unused ports as outputs to get rid of the floating inputs. > %% clrf PORTD ; initialize port d > bsf STATUS,RP0 ; select bank > movlw B'00000000' ; set port d as output pin > movwf TRISD ; > ** movlw 0H ; default low to port d > ** movwf PORTD ; > bcf STATUS,RP0 ; de-select bank The ** lines won't do as you expect because the RP0 bit is set, plus you don't need them because of the %% line. This delay routine is a bit shorter and uses less memory. DELAY movlw msec_20 movwf dvl clrf dv2 ; probably not needed DLY1 decfsz dv2 goto DLY1 decfsz dv1 goto DLY1 return -- Best regards Tony http://www.picnpoke.com mailto:sales@picnpoke.com