idtat,
I'm attempting to use the DS1302 myself with luck as well. Now, I haven't read through your code to any great extend, but one thing jumped out at me:
I'm assuming you're using burst mode? Regardless, in either burst mode or the non-burst mode, you have to use LSB. I see you did that for your shiftouts, but not for your shiftin above. In other words, try changing this:Code:w_in: mem = reg_adr ' Set mem variable to reg_adr contents high rst ' Activate the DS1302 shiftout dq,clk,0, [mem] ' Send control byte shiftin dq,clk,1, [mem] ' Retrieve data in from the DS1302 low rst ' Deactivate DS1302 return
to this:Code:shiftin dq,clk,1, [mem] ' Retrieve data in from the DS1302
Let me know if you have luck. I'm trying to read seconds and I'm getting junk.Code:shiftin dq,clk,0, [mem] ' Retrieve data in from the DS1302




Bookmarks