DS1307 RTC does not work on my datalogger axe110p

tparvais

Member
Hello

I just receive my kit datalogger axe110p + option RTC Axe033.

Datalogging work fine when I don't use RTC 1307.

When I want to configure DS1307 clock with wizard, everything seems to work during programmation (bi-color led is green) but LED1 does not flash each 1s. Led1 is on always. I tried to reset/reboot (after empty program). not working. When datalogging is configured to use RTC, it does not work.

Soldering seems ok on crystal.

What should I do ?

Thank you

Thomas
 

craigcurtin

Senior Member
Try this sample code

Thomas,

Try this as very basic code - at the end the debugger window will popup up and you should see the registers ticking over - this proves your RTC is working fine

Craig

'AXE110 BASIC Program to set time/date on DS1307 RTC
'Automatically generated by Wizard

'Make sure DS1307 chip and cell inserted on datalogger module
'and that the cable is in the 'run' position.
'After downloading, status LED will be Green for pass or Red for fail.
'After success, download empty program to PICAXE to prevent
'time being reset on next power-up of board.

'First program the date
'main:
i2cslave %11010000, i2cslow, i2cbyte
' 'writei2c 0, ($00, $45, $22, $4, $12, $4, $6, $10)
' 'pause 50
doit:

readi2c 0, (b0,b1,b2,b3,b4,b5,b6,b7)
pause 1000
debug
Goto doit
 

craigcurtin

Senior Member
Better do some more troubleshooting before we declare it broken

1) Remove the EEPROM memory so you only have the RTC clock on the bus
2) Check that the 1307 chip is in the right way
3) Do you have anything else on the I2C bus (like an LCD)


Craig
 

tparvais

Member
I tried without EEPROM, there is not LCD, nothing else on I2C Bus...

Still don't work...

I think there is a serious problem with the kit

Thomas
 

tparvais

Member
I also try with a new DS1307. Led is not flashing.

I don't know what can I do with this board.... I'm disappointed as I planned to use it for datalogging

Thomas
 

sevs3

Member
Just double check that everything is in the correct way. The IC's are in teh correct way, all resistor valuse are corect etc etc. It seems odd that the project board is faulty, but not impossible. If you are 100% sure that the error isnt yours, then your best bet is to probably take it back to the place of purchase and get a replacement.
 

william kempees

New Member
DS1307 problem with datalogger.

Thomas,
I don't know if you're still in the swim but here goes anyway.
I have exactly the same problem and wonder if you ever got a satisfactory resolution to the problem.
It seems the DS1307 just does not oscillate.
Would appreciat your advice on this subject'
BillK.
 

westaust55

Moderator
DS1307 RTC testing

Can you try this piece of code.

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
 
Last edited:

tparvais

Member
Thomas,
I don't know if you're still in the swim but here goes anyway.
I have exactly the same problem and wonder if you ever got a satisfactory resolution to the problem.
It seems the DS1307 just does not oscillate.
Would appreciat your advice on this subject'
BillK.
unfortunately not. :-(

I'm trying now to use 1-wire directly interfaced with a very small PC running Linux/PC.

I don't use datalogger anymore for the moment, but plan to do so in the near future

Thomas
 

tparvais

Member
I'm confused. 1-wire and i2c are different hardware and different protocols.

Also, are connecting to the correct pins on the PICAXE chip? And which PICAXE chip?
Sorry if I was confusing. I mean I'm usign 1-wire sensors directly with USB interface provided by Maxim, without using any PIC.

This means also that my PC must be 24h/d on, which is not convenient.

It exists a lot of 1-wire framework (Linux or event windows) to control 1-wire bus very easily. And it is easier for me to log all data in MySql DB.

I'll keep PIC datalogger for an autonomous recording 1-wire hardware, for later use

Mercy Xmas

Thomas
 

tparvais

Member
Can you try this piece of code.

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
Hello

I tried this code.

I can read/write values on RAM of RTC chip. Issue is that time is not going on.

Maybe a faulty cristal oscillator ? I'll buy a new one or maybe is there a trick to test it ? What is his frequency ? 4MHz ?

Thank you

Thomas
 

TravisH

New Member
Hello

I tried this code.

I can read/write values on RAM of RTC chip. Issue is that time is not going on.

Maybe a faulty cristal oscillator ? I'll buy a new one or maybe is there a trick to test it ? What is his frequency ? 4MHz ?

Thank you

Thomas
The crystal frequency is 32.768kHz;

Are you sure you are setting the seconds register to 00?

writei2c 0, ($00, $53, $15, $03, $23, $12, $08, $10)
(sec min hour day date mon year control)

In westaust55's initialization code, the seconds register is set first to zero ($00), but this is also the clock halt bit. If it is initially set to 1, the RTC's oscillator is disabled. So the seconds register should always be set to 00. If you not set it to zero, this could explain the fact that you can read/write to the DS1307 RAM, but it doesn't keep time.
 

tparvais

Member
The crystal frequency is 32.768kHz;

Are you sure you are setting the seconds register to 00?

writei2c 0, ($00, $53, $15, $03, $23, $12, $08, $10)
(sec min hour day date mon year control)

In westaust55's initialization code, the seconds register is set first to zero ($00), but this is also the clock halt bit. If it is initially set to 1, the RTC's oscillator is disabled. So the seconds register should always be set to 00. If you not set it to zero, this could explain the fact that you can read/write to the DS1307 RAM, but it doesn't keep time.
yes, I ran exactly the code above with second set to 0. problem remains

I also tried DS1307 on my LCD board. On this, it works fine. But as I don't use I2C for LCD, I don't have access to it easily...

Thomas
 
Top