Hi Clyde, Thank You very much for this great help! When we work several nights with the same problem, we end by letting some trivial bugs like this into the code. But nothing like another fresh mind to find them! Thanks indeed. Now, we could let this available to others. I've already tested it. It makes possible, _at_the_same_time_, transmit/receive @ 38400 bps from a RS-485 line and poll the PC-AT keyboard attached, _without_ any other hardware, except the PIC, and don't miss a single character. Wow! This is my contribution (Rildo Pragana)to the PIC community, with a kindly hint from Clyde Smith-Stubbs. (This is freeware, collectors! Get the attachment from my previous mail and submit it to your favorite PIC page. Sorry, but I don't have one.) ----------------------------------------------------------------------- On Sun, 8 Jun 1997, Clyde Smith-Stubbs wrote: > 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! ----------------------------------------------------------------------- best regards, Rildo Pragana Greetings from Recife, Pernambuco, Brazilian's Venice, Brasil, South America. Land of Luiz Gonzaga (Bai‹o and Xote folclore music composer). (about -13 hours GMT from your home, Australia!)