---------- > From: > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: Still got the serial blues! > Date: Tuesday, June 09, 1998 11:39 AM > > In a message dated 98-06-09 05:05:39 EDT, you write: > > << >EMITBIT > > DECFSZ STIME,F > > GOTO W4 ;BAUD DELAY > > RRF INDF ;SHIFT RT > > DECFSZ SCOUNT ;BIT COUNTER > > GOTO SEND_BITS ;SEND MORE BITS > ***look here> RRF INDF ;8 BITS SENT- SHIFT TO ORIGINAL > > MOVLW BITTIME > > MOVWF STIME ;LOAD BUAD DELAY > > MOVLW STOPBIT ; SEND STOP > > MOVWF SSTATE > >; BCF _SEROUT ;START BIT INVERTED > > BSF _SEROUT ;START BIT NON-INVERTED > > NOP > > RETURN > > >> > > >If you are not reloading the BUFFER data, then the data will be rotated, but > >out by one bit. Does this help? > > I discovered one of my problems. I don't need the second RRF. The data was > previously shifted to the original position with the previous RRF. When I only > run the serial out routine everything works, but when I allow the > multitasking with the PWM, servo and motor, again the first 5 byte loop works > great but the second is garbage. Something else in the program must be > corrupting the FSR. I thought I was reloading the buffer. If not what should I > change? Nichole, Something is probably clobbering the FSR. If this is the case, you need to keep a local copy of the FSR in another register and swap it back when the routine is active. By the same token, you MIGHT want to save the FSR contents before swapping so you can swap the original contents back before continuing your multitasking! Otherwise the FSR problem will just migrate over to the other routine. Whenever you multitask, use local copies of things that might get clobbered. Hope this helps. Fr. Tom McGahee