Well, i write the time, then I keep reading it, isn't it suppose to be chance every second when I keep reading it ?
pullups, you mean resistors ? I tried, then I only got 16 or 32 instead of 0
Well, i write the time, then I keep reading it, isn't it suppose to be chance every second when I keep reading it ?
pullups, you mean resistors ? I tried, then I only got 16 or 32 instead of 0
I don't know if it's supposed to chance every second, but if the clock is running, it may change every second.
Complete this sentence:pullups, you mean resistors ? I tried, then I only got 16 or 32 instead of 0
The value of my resistors connected to +5v and to the I2C clock and data line is __________."
control register may need to be set
alsoooooo....
the I2c read and write address/control string have to be different, I just used binary 00011110 (just an example) to make sure the read write is correctly coded.
don
Last edited by amgen; - 28th June 2008 at 01:07.
tried that already. It doesn't help.
What do you mean by "the I2c read and write address/control string have to be different" ?
RTCADW CON %11010000 'DS1307 RTC ADDRESS SEND...RECEIVE
RTCADR CON %11010001
I2CWRITE SDA,SCL,RTCADW,7 ,%00010011 'TURN ON SQU WAVE OUT 32k HZ
I2CREAD SDA,SCL,RTCADR,0,[RTC[1],RTC[2],RTC[3],RTC[4],RTC[5],RTC[6],RTC[7]]
from my rtc stuff
don
Ok, So I tried to use your example.
Still getting '0' when reading. If i use 10K resistors on the SDA and SCL I get '16'
Code:INCLUDE "modedefs.bas" RTC VAR BYTE[8] ' Data byte array RTCADW CON %11010000 'DS1307 RTC ADDRESS SEND...RECEIVE RTCADR CON %11010001 SDA var PORTC.4 SCL var PORTC.3 pause 1000 I2CWRITE SDA,SCL,RTCADW,7,%00010011 'TURN ON SQU WAVE OUT 32k HZ main: ;I2CREAD PORTC.4,PORTC.3,%11010000,$00,[RTCSec] I2CREAD SDA,SCL,RTCADR,0,[RTC[1],RTC[2],RTC[3],RTC[4],RTC[5],RTC[6],RTC[7]] SEROUT PORTC.6,6,[254,1] toggle PORTD.7 : pause 1000 SEROUT PORTC.6,6,[254,128,#RTC[1]] pause 1000 goto main
Bookmarks