My DS1307 is not giving any results.I use PIC16F886 with MSSP Module.I use 4.7K pullups.
I need to read Minutes & Hours.
I need to read Minutes & Hours.
Code:
;=============================================================
;Read Time & split into segment digits
;=============================================================
Read_Time movlw 01h
movwf E2_Add_Low ; point to buffer Minutes
call I2C_Byte_Read
andlw b'01111111' ; ignore 7th bit CH
call BCD_To_Bin
movf Bin_Number,W
movwf Minutes
;
incf E2_Add_Low,F ; point to buffer Hours
call I2C_Byte_Read
andlw b'00111111'
call BCD_To_Bin
movf Bin_Number,W
movwf Hours
;
call Split_Minutes
call Split_Hours
return
I2C_Byte_Read call I2C_Start
movlw b'11010000'
call I2C_Write
movf E2_Add_Low,W
call I2C_Write
call I2C_Restart
movlw b'11010001' ; Slave Address - Read
call I2C_Write
call I2C_Read
movf SSPBUF,W
call NACK_Slave
call I2C_Stop
return