Royce Simmons wrote: > > Greetings All, > > Does anyone have code for a F628 serial input routine? I am having problems > making this > work. I suppose lack of skill is the problem but I am confused with all the > register options. I just thought you might be using the UART, so try this code... ; ; SETUP PORTS ETC ..... ; ; ; ----------------------- ; DISABLE THE COMPARATORS ; ----------------------- ; movlw b'00000111' movwf CMCON ; ; ------------------------------------ ; SET BAUD RATE TO COMMUNICATE WITH PC ; ------------------------------------ ; Boot Baud Rate = 9600, No Parity, 1 Stop Bit ; @ 4MHz ; bsf STATUS,RP0 ; RAM Page 1 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 bsf STATUS,RP0 ; RAM Page 0 movwf RCSTA call DelayWt ; waits a few mS to stabilise ; ; GET CHARACTER FROM PC (or whatever) ; MainLoop call Receive ; wait for data -> W movwf TXREG ; echo it back goto MainLoop ; ; ---------------------------------------- ; 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 movwf RxHold ; tempstore data return -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.