cancel
Showing results for 
Search instead for 
Did you mean: 

Communication between a ST72334 and a real time clock DS1302

remi_loriente
Associate II
Posted on July 27, 2006 at 13:11

Communication between a ST72334 and a real time clock DS1302

2 REPLIES 2
remi_loriente
Associate II
Posted on July 25, 2006 at 06:44

Hello,

For an application i need to have a real clock. To this, i use a DS1302, which communicate with an I2C port.

there is two signal to communicate: the SCLK and the I/O.

In order to read the date on the DS1302 with the ST7, i make a small program which use a bit for the SCLK, a bit for the I/O and a byte (X) in order to save the byte corresponding to the seconde or to the hour...

My program is simple, i command the SCLK (with bset and bres function)and after each rising edge of the SCLK i send a command bit or i receve and save a data bit from the DS1302.

Unfortunatly, i receve nothing from the DS1302, and after reading several times the datasheet of the component, i have not found where are my mistakes :-[ .

I just want to know if someone can help me on this problem, if i forgot an initilisation bit (not reset !) or else...?

i would be grateful for any help...thanks in advance. :D

pjr
Associate II
Posted on July 27, 2006 at 13:11

I am working with the 72F264 but I think this applies to the ST7 core in general. In note 3 of section 9.2.1 of the 72F264 datasheet the warnig is given NOT to use the bset and bres instruction to modify the DR register.

pjr