> Your comments sometimes don't match what the code is doing (which should be > > a hanging offence :-) for example: > > ; Make RC0 & RC 3 inputs. > > MOVLW 0x09 > > MOVWF TRISA > > > > A no-comment example later on, your delay routine: > > > > DELAY1S > > CLRF TMR0 > > LOOPY > > MOVF TMR0, W > > SUBLW 0x0F > > BTFSS STATUS, Z > > GOTO LOOPY > > RETURN Jinx wrote: > > movlw 0x0f > subwf tmr0,w Even with this fix still no good... What is going to happen if for some reason ( interrupts ? temporary malfunction etc.. TMR0 will change from 0x0E right to 0x10 ? Loop would not stop until next TMR0 iteration. I would rewrite it with using carry ( which is still not reliable because of 0xFF to 0x00 crossing went undetected ) as decision or better with T0IF flag. ; general initializing ; initializing TMR0 pre-scaler ; disabling TMR0 interrupt ; ..... DELAY1S movlw -const movwf TMR0 bcf INTCON,T0IF btfss INTCON,T0IF goto $-1 ; ..... -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist