On Sat, Jun 07, 1997 at 05:27:53PM -0300, Rildo Pragana wrote: > I'm really atonished with a problem that's ocurring with my present Without even thinking about the symptoms you describe, I can see a major error in your interrupt save code: > intr swapf w_tmp,f ;1 save w and status This line does NOT save w in memory - it just nibble-swaps what is already in memory. Your interrupt code should read: intr movwf w_tmp ;1 save w and status movf STATUS,w ;1 movwf st_tmp ;1 bsf _rp0 ;1 bcf _t0cs ;1 switch to internal clock in TMR0 bcf _rp0 ;1 bcf _t0ie ;1 no more interrupts, please bcf _t0if ;1 bsf _sbf ;1 movlw -.26 ;1 mark time for end of 1 1/2 bit movwf TMR0 ;1 ; iend movf st_tmp,w ;1 recover w and status movwf STATUS ;1 swapf w_tmp,f ;1 pre-swap saved w so that swapf w_tmp,w ;1 we restore original contents of w retfie ;2+2 This should help a _great_ deal - it may not be your only problem, though. Try it and see. Have fun! -- Clyde Smith-Stubbs | HI-TECH Software, | Voice: +61 7 3354 2411 clyde@htsoft.com | P.O. Box 103, Alderley, | Fax: +61 7 3354 2422 http://www.htsoft.com | QLD, 4051, AUSTRALIA. | --------------------------------------------------------------------------- Download a FREE beta version of our new ANSI C compiler for the PIC microcontroller! Point your WWW browser at http://www.htsoft.com/