Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USE_TXENABLE 16F1783 timeout
#5
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?
Reply


Messages In This Thread
USE_TXENABLE 16F1783 timeout - by petspats - 2014-09-19, 15:44:01
RE: USE_TXENABLE 16F1783 timeout - by petspats - 2014-09-19, 16:56:25
RE: USE_TXENABLE 16F1783 timeout - by petspats - 2014-09-19, 18:45:20
RE: USE_TXENABLE 16F1783 timeout - by petspats - 2014-09-22, 07:35:37
RE: USE_TXENABLE 16F1783 timeout - by miklosch - 2014-09-22, 18:06:26
RE: USE_TXENABLE 16F1783 timeout - by miklosch - 2014-09-28, 01:16:10
RE: USE_TXENABLE 16F1783 timeout - by petspats - 2014-09-23, 09:21:01

Forum Jump:


Users browsing this thread: 1 Guest(s)