ChrisSeymour
New Member
I'm a Newbie re the forum, electronics and picaxe so please forgive me and let me know if I'm breaking any rules 'n stuff
I purchased the above module from ebay. It appears to be a really useful module with rtc and eeprom.
My first attempt at making it work was rather disappointing and continues.
Thanks to the rapid and helpful responses already from everyone who replied to my original posting.
I'm using a 14 pin picaxe (14M2) with B.3 (scl) and B.4 (sda) and a 4.5v battery pack.
I connected the GND, VCC, SCL and SDA but all I can read into the picaxe chip is FF for each byte. I didn't use SQ or DS (2 labels shown on the module pcb). For pullups I used 4k7 resistors. I guess that I'm missing something rather than there being an issue with the ebay purchase. For info I've copied my code below:
Thanks for the pointer to the wizards to set the clock. The wizard program appeared to download to set the time and run ok. I therefore commented out the clock setting stuff from my code above but still no joy.
Cheers, Chris
I purchased the above module from ebay. It appears to be a really useful module with rtc and eeprom.
My first attempt at making it work was rather disappointing and continues.
Thanks to the rapid and helpful responses already from everyone who replied to my original posting.
I'm using a 14 pin picaxe (14M2) with B.3 (scl) and B.4 (sda) and a 4.5v battery pack.
I connected the GND, VCC, SCL and SDA but all I can read into the picaxe chip is FF for each byte. I didn't use SQ or DS (2 labels shown on the module pcb). For pullups I used 4k7 resistors. I guess that I'm missing something rather than there being an issue with the ebay purchase. For info I've copied my code below:
Code:
hi2csetup i2cmaster, %11010000, i2cslow, i2cbyte ; set PICAXE as master and DS1307 slave address
; write time and date e.g. to 11:59:00 on Thurs 25/12/03
symbol seconds = b0
symbol mins = b1
symbol hour = b2
symbol day = b3
symbol date = b4
symbol month = b5
symbol year = b6
symbol control = b7
start_clock:
' let seconds = $00 ; 00 Note all BCD format
' let mins = $59 ; 59 Note all BCD format
' let hour = $11 ; 11 Note all BCD format
' let day = $03 ; 03 Note all BCD format
' let date = $25 ; 25 Note all BCD format
' let month = $12 ; 12 Note all BCD format
' let year = $03 ; 03 Note all BCD format
' let control = %00010000 ; Enable output at 1Hz
' hi2cout 0,(seconds,mins,hour,day,date,month,year,control)
hi2cin 0,(b0,b1,b2,b3,b4,b5,b6,b7) ; read time and date and debug display
debug b1
pause 2000
goto start_clock
Cheers, Chris
Last edited: