comparison src/i2c.asm @ 627:bf5fee575701

minor cleanup, reset rx circuity
author heinrichsweikamp
date Sun, 30 Jun 2019 23:22:32 +0200
parents 7bdcc591196c
children cd58f7fc86db
comparison
equal deleted inserted replaced
624:7bdcc591196c 627:bf5fee575701
763 763
764 I2C_WaitforACK: 764 I2C_WaitforACK:
765 btfss SSP1CON2,ACKSTAT ; checks for ACK bit from slave 765 btfss SSP1CON2,ACKSTAT ; checks for ACK bit from slave
766 return 766 return
767 I2CFail: 767 I2CFail:
768 bsf active_reset_ostc_rx ; RESET RX circuitry (Which may be the cause for the hang up)
768 rcall I2CReset ; I2C Reset 769 rcall I2CReset ; I2C Reset
769 bcf PIR1,SSP1IF 770 bcf PIR1,SSP1IF
770 clrf i2c_temp1 771 clrf i2c_temp1
771 bsf i2c_error_flag ; set error flag 772 bsf i2c_error_flag ; set error flag
773 bcf active_reset_ostc_rx ; release RESET from RX circuitry
772 return 774 return
773 775
774 I2CReset: ; something went wrong (slave holds SDA low?) 776 I2CReset: ; something went wrong (slave holds SDA low?)
775 clrf SSP1CON1 ; wake-up slave and reset entire module 777 clrf SSP1CON1 ; wake-up slave and reset entire module
776 clrf SSP1CON2 778 clrf SSP1CON2