#include <p16F690.inc>
  __config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF)
 
 
 org 0
Start
 bcf STATUS,RP0  ;sets bank 1 registers
 movlw b'10010000' ;enables serial port, continuous receive  
 movwf RCSTA
 BSF   STATUS,RP0  ;sets bank 2 registers 
 movlw  b'00100100' ;sets serial transfer parameters
 movwf TXSTA
 movlw b'00011001' ;sets baud rate to 9600 BAUD
 movwf SPBRG     
 bcf STATUS,RP0 ;set bank 1 registers
 bcf PIR1,RCIF ;sets receive interupt flag
 movlw b'00111001'  ; place a number into the W register

loop
 addlw 0 ; add 0 to the W register, send the same number
 bsf STATUS,RP0 ;set bank 1 registers
 btfss TXSTA,TRMT ;check if txreg is empty
 goto $-1
 bcf STATUS,RP0 ;set bank 0 registers
 movwf TXREG ;put W data into txreg
 GOTO loop

end
