Connecting RTC for pins 2, 3,4

Hey,
I have a ds1302 rtc module, which I want to connect to digital pins 2, 3, and 4 of the Arduino Uno.
In the tutorial I'm following, the pins were 6, 7, and 8; The labels on the pins are CLK, DAT, and RST.

will it work with any other pins?
thanks.

***Sorry for my bad English...

yes, it would take you seconds to test!

missdrew:
yes, it would take you seconds to test!

Thanks
I would test it myself but my rtc didn't arrive yet.

What tutorial?
I see SCLK on 7, IO (data pin) on 6, and CE (active high!) on 6.

Timing looks like SPI, but with CE high instead of the more typical low.
Maybe use shiftOut() with a pinMode() change between transfers during register reads.

pinMode (dataPin, OUTPUT);
digitalWrite (cePin, HIGH);
shiftOut (dataPin, clockPin, MSBFIRST, dataOut);
pinMode (dataPin, INPUT);
dataIn = shiftIn (dataPin, clockPin, MSBFIRST); // or whatever the syntax is, check into that
digitalWrite (cePin, LOW);

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.