2014-09-22, 07:35:37
PHP Code:
;------------------------------------------------------------------------------
; Send()
;------------------------------------------------------------------------------
Send ; Enable tx
ifdef USE_TXENABLE
;bcf RCSTA_, CREN ;disable serial receiver ; COMMENTED OUT
movwf TEMP
banksel PORTR_TXE
bsf PORTR_TXE, PORTB_TXE;bank ?
movlw TXE_DELAY_CNT
movwf cnt1
txe_del_lo decfsz cnt1
goto txe_del_lo
movfw TEMP
endif
;Send byte
banksel TXREG_
movwf TXREG_ ;bank 0/3
; Wait for transmit shift register to get empty
banksel TXSTA_
txwait btfss TXSTA_, TRMT ;bank 1/3
goto txwait
; Disable tx
ifdef USE_TXENABLE
banksel PORTR_TXE
bcf PORTR_TXE, PORTB_TXE;bank ?
;bsf RCSTA_, CREN ;enable serial receiver ; COMMENTED OUT
endif
; Send complete
return
Hey!
I got it working by commenting out enable/disable serial receiver lines.
Why was it needed to enable/disable receiver?