Hello, can anyone help me? I have been recently testing the DS1302 with the arduino, and I have successfully set the clock/calendar IC. Although the readings are 98% accurate, about 2% of the time I get random incorrect readings. Can you help me get rid of these arbitrary readings? I have added a decoupling capacitor to the supply voltage , and I am powering the device with a DC source. Thanks for your help.
BTW: Below, I have also included pseudo code, for shift-in function used to retrieve information from the IC.
Shiftin – Pseudo code 1. Make SCLK pin LOW 2. Wait 200 microseconds (uS) 3. Read I/O pin state 4. Make SCLK pin HIGH 5. Wait 200 microseconds (uS) 6. Repeat Steps 1-5, six more times 7. Output BCD value