hi! yes, it«s diabled. __CONFIG _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _XT_OSC & _WRT_ENABLE_ON & _LVP_ON & _DEBUG_OFF & _CPD_OFF I am using an 16f877 //nabil ********************************** On 21 Sep 99, at 13:12, Mark Willis wrote: > Is your watchdog timer disabled, Nabil? That'd be my first guess. It > might help others to know what processor & what your fuse settings, etc. > are. (Dashing past to check e-mail just now, need to run!) > > Mark > > Nabil Benhadj wrote: > > > > hi! > > this code locks it self somehow and keeps sending the same > > result to the pc I4ve connected it to. "I4ve made the "start" loop to > > check if the buttons on portB is pushed. If they are then it will store > > portB in s_out and s_temp. s_temp is then used to se if the value > > changes. as the program runs now it just keeps sending data as > > long as the button is pushed. the data should be sent only once > > when a button is pushed. > > can someone solve this problem pleas, I am not getting > > anywhere????? > > > > //nabil > > > > ps: there are a subrutine called send_data that "sends the data". > > that part works. so I did not include that. > > ;_____________________________________________ > > start > > bcf STATUS,5 ;change to bank 0. > > > > movf PORTB,0 ;brings portB to W. > > sublw 0x00 ;compares W to zero. > > btfsc STATUS,2 ; > > goto start ;if there is nothing on thegategoto"start"else > > continue. > > movf PORTB,0 ;brings portB to W. > > ;comf PORTB,0 ;complement portB. > > movwf s_out ;store in s_out to send data. > > movwf s_temp ;store in s_temp to compare. > > call send_data ;goto sub, send_data that sends data in > > s_out. > > > > temp > > movf PORTB,0 ;brings portB to W. > > ;comf PORTB,0 ;complement portB. > > subwf s_temp,0 ;compare s_temp to portB. > > btfss STATUS,2 ;if the value is the same on portB goto > > "start" else continue. > > goto start ;start from the begining. > > goto temp ;loop until value changes in portB. >