Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Nigel Goodwin said:Why two goto's?.
Change the BTFSC to BTFSS and delete the GOTO XMIT1
Here are the routines from my RS232 tutorial.
Code:XMIT_RS232 btfss PIR1, TXIF ;xmit buffer empty? GOTO XMIT_RS232 ;no, wait MOVWF TXREG ;now send RETURN Rcv_RS232 BTFSS PIR1, RCIF ; check for received data GOTO Rcv_RS232 MOVF RCREG, W RETURN
eng1 said:What about checking the TRMT bit?
I would also provide a short delay after initialization of the USART module...Code:TXRDY: bsf STATUS,RP0 ; bank 1 Wait: btfss TXSTA, TRMT ; transmission complete? goto Wait bcf STATUS,RP0 ; bank 0 Send: movwf TXREG ; send data return
ericgibbs said:hi,
I use this subr on all my PIC prgms with no problems
;---- SERIAL UART ----
; Hardware Serial Communication Routines
TXRDY:
BTFSC PIR1,TXIF
GOTO XMIT1
GOTO TXRDY;busy,so loop
XMIT1:
MOVWF TXREG;send
RETURN
Are you sure that the receiving PC is OK?
Eric
flemmard said:Hi,
You hav any routine for PIC C to do serial communication?
Thanks