Hi Steve, check uot pages5/ 6 of this data sheet, it says: DS 1302 powers up with trickle charger disabled and only a pattern of 1010 will enable charger. http://forums.parallax.com/forums/attach.aspx?a=26594 HTH
Hi Steve, check uot pages5/ 6 of this data sheet, it says: DS 1302 powers up with trickle charger disabled and only a pattern of 1010 will enable charger. http://forums.parallax.com/forums/attach.aspx?a=26594 HTH
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Thanks Joe,
You can't imagine how many times I've read the data sheet.... (it's been open on my desktop for days now)
I'm clearly not quite understanding yet.
Yes, a pattern of 1010 turns on the charger, and the other 4 bits of the byte set the charge rate.
So what ( I think) I want to send is 10100101 which should tun on the charger and set it to "1 diode, 2Kohm" operation. In HEX, that's $A5, right?
So I've sent $90, which should be the register address for the charger, and $A5, which should be the code to turn it on and set it to my chosen charge mode. I even tried sending the data in binary, like so:
but with the same (no) result.Code:rst = 1 'Set Battery charger on and set to "1 diode, 2Kohm" Shiftout IO, SCLK, LSBFIRST, [$90, %10100101] ' Set charger [$90, $A5] RST = 0
What am I doing wrong? (please!)
Thanks,
Steve
Ahh, never mind, I figured it out...
Setting up the trickle charger is the first task task I ask of the DS1302, and I just needed to pull the reset line LOW first, before I yank it high and move the data.
All I was missing was "rst = 0" up front:
Thanks again to everyone!Code:rst = 0 rst = 1 'Set Battery charger on and set to "1 diode, 2Kohm" Shiftout IO, SCLK, LSBFIRST, [$90, %10100101] ' Set charger [$90, $A5] RST = 0
Steve
Bookmarks