2006-07-27 04:11 AM
Communication between a ST72334 and a real time clock DS1302
2006-07-24 09:44 PM
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. :D2006-07-27 04:11 AM
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