Heres the PIC code:
Code: Select all
Start
bsf OSCCON,IRCF2 ;set to 8MHz clock
bsf OSCCON,IRCF1
bsf OSCCON,IRCF0
movlw 0x7f ;set PortA to all digital
movwf ADCON1
clrf TRISA ;set PortA pins to output
clrf LATA ;turn off LEDs
movlw b'00010010' ;set PortB - RB4=RX=input
movwf TRISB
movlw 0x0c ;set for 9600 baud @ 8MHz clock
movwf SPBRG
bcf TXSTA,BRGH ;clear Baud Rate Select Bit (low speed)
bcf BAUDCTL,BRG16 ;select 8-bit baud rate generator
bcf TXSTA,SYNC ;asynchronous mode
bsf RCSTA,SPEN
bsf TXSTA,TXEN ;transmit enable
movlw 0x60
Send
incf WREG
movwf TXREG
Loop
btfss TXSTA, TRMT
goto Loop
goto Send
end
Thanks,
Jon