Ian Jordan wrote: > > I have been using Tom McGahee's RS-232 code to get started on an RS-232 > project. I've stripped the code down so that it's "receive only," which is > what I'll be needing. You can probably try this which should echo the same character back. ; ; ------------------------------------ ; SET BAUD RATE TO COMMUNICATE WITH PC ; ------------------------------------ ; Boot Baud Rate = 9600, No Parity, 1 Stop Bit ; bsf STATUS,RP0 movlw d'25' ; 9600 baud movwf SPBRG movlw b'00100100' ; brgh = high (2) movwf TXSTA ; enable Async Transmission, set brgh movlw b'10010000' ; enable Async Reception clrf STATUS ; RAM Page 0 movwf RCSTA Loop call Receive movwf TXREG goto Loop ; ; ---------------------------------------- ; RECEIVE CHARACTER FROM RS232 OR INTERNAL ; ---------------------------------------- ; This routine does not return until a character is received. Receive nop btfss PIR1,RCIF ; check for received data goto Receive movf RCREG,W return -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu