Datalogger RTC problem

william kempees

New Member
I have programmed the RTC using the wizard with the flash LED option selected but do not get the flashing LED.
In running the main datalogger program and selecting the DS1307 RTC for logging period, I do not get the strobing of data into memory and no data is stored in memory.

The datalogger works well with pause command selected for logging period.

Vcc and Vbat are present on the DS1307 but scoping the crystal pins with a high mpedance ascilloscope probe shows nothing.
Tried 2 other DS1307 chips with same result.
Supplier of my gear thinks overheating of the chip at fault.
Any ideas please.
william kempees
 

westaust55

Moderator
Hi William,

welcome to the PICAXE forum.

Can you confirm that you have the AXE110 dataloger module from Rev Ed.
If it is some other please advise.

Can you upload your program so we can see what exactly is supposed to happen.

for your future reference, you might like to have a look at post 4 of this thread for what can be a better way to pass information on so that forum members here can better understand you problem from the first post.
 

william kempees

New Member
Westaus55

AXE110 Datalogger came from Microzed.
Supplier replicated the problem' also tried different DS1307 batches.
Found that one of them worked but only for a limited time hence his overheating hypothesis.
Also checked bit CH in loc 00h and bit SQWE in loc 07h for enabling.
Do not understand label ok: subroutine as this seems to be in infinite loop.
I take your point on protocol.
Many thanks for your reply. was beginning to lose confidence.
Regards, Billk.

Below please find prog generated by wizard.
'First program the date
high 5 ' write protect eeprom

i2cslave %11010000, i2cslow, i2cbyte
writei2c 0, ($00, $44, $16, $03, $23, $12, $08, $10)
pause 50

'Now check has been set OK
let b8 = $03
let b9 = $23
let b10 = $12
let b11 = $08
let b12 = $10

readi2c 0, (b0,b1,b2,b3,b4,b5,b6,b7)

if b7 <> b12 then fail
if b6 <> b11 then fail
if b5 <> b10 then fail
if b4 <> b9 then fail
if b3 <> b8 then fail
ok:
high 3
goto ok
fail:
high 2
goto fail
 

westaust55

Moderator
Can you try this piece of code. I have just posted the same code in another thread as well

Code:
Init:

	i2cslave %11010000, i2cslow, i2cbyte
	
;now set the clock 	
	writei2c 0, ($00, $53, $15, $03, $23, $12, $08, $10)
	pause 50
; also write to some of the RTC RAM
	writei2c 8, ($12, $22, $32, $42, $52, $62, $72)
; then wait 10 seconds - YES 10 seconds 

FOR b13 = 1 to 5
; now check RTC has been set 
       readi2c 0, (b0, b1, b2, b3, b4, b5, b6)
       pause 50
       
; and look if data was written/read from RAM ok as well
       readi2c  8, (b7, b8, b9, b10, b11, b12)

	debug
	pause 5000
NEXT b13
see if the values you see in the variables window matches the data written.
RTC should advance but even if the clock is not working, the second line of data should be written into the first 8 bytes (out of 56 bytes) of user RAM in the RTC chip.

Will at least give an idea whether you are actually writing to the DS1307

If the time does not start to adjust try the code immediately a second time and see if the RTC clock starts to "give" the time correctly
 

william kempees

New Member
Westaust 55,
Firstly I confirm that my picaxe 110 is of rev-ed.
I have run your code as instructed including the iteration and examined the variables window.
The values got written and read OK in both the registers and the RAM.
The clock definitely does not move, dead as a dodo.
Only thing that moved was b13 which counted from 1 to 5 as it of course should.

One remark on the code: There is a comment line about "waiting 10 seconds- Yes 10 seconds" and wonder about the absence of such a command. Is this intentional?
Anyway I have experimentally inserted "wait 10 " under the relevant comment line with no difference in the result.

There is a guy called tparvais (Thomas) who has experienced the identical RTC problem back in Nov 07. It seems he has temporarely given up on it.
Hope you had a good xmas.
Regards, BillK
 

westaust55

Moderator
Westaust 55,
One remark on the code: There is a comment line about "waiting 10 seconds- Yes 10 seconds" and wonder about the absence of such a command. Is this intentional?
BillK
The wait 10 seconds was a left over from when I first tried an AXE033 with a RTC. The AXE033 only updates from the RTC at the start of each minute.

My past experience (with the AXE033) was that I sometimes needed to run the program twice before the "set" time would be locked in and the clock started.

try running the program twice, then removing the writei2c lines and see what you read back after say a minute to see the the clock is now in action.

It does seem that a lot of people are having problems with the DS1307.
 

william kempees

New Member
Ran the code twice, three times in succession with no difference. Time is set OK but does not advance.
Removed the writei2c statements and checked the time after minutes of wait, found times still set OK and had not advanced.
Not surprising perhaps as the green LED which is supposed to flash at 1Hz, remains hung up on green.
The only remaining problem now is the crystal and perish the thought, the board.
Crystals are vulnerable to shocks such as unfortunate drops.
I note that the crystal case has heen soldered onto the board and wonder about any damage caused by heating.
I would dearly like to know if there are data loggers around which actually do work with the RTC DS1307.
Keep up the good work and thanks for the attention.
BillK
 
Top