How to get A DS1302 Time Chip To Work on the Trickle Charging Mode To charge N
sam_sam_sam
Posts: 2,286
Chris
I want say something first
I know that you DO NOT WRITE A DEMO CODE FOR JUST ONE PERSON
Which·I understand the reason for this
I·am asking· you to write a Demo Code just for the· RTC for Trickle Charging Mode·using this Demo Code in the Attachment below
Chirs........Thank You For Any Help That You Can Give
Because it seem that no one know how to get it to work i have try the· DS1302 Appkit Demo
I could not get it to work on a 3.75 Ni Cad Battery Pack
Now i have a project that if i could get this to work
I·would make this project have a battery back to keep to the time when the power went off
The reason I·do not want to use a Non Rechargeable Battery
Is because Sid made me a Data Logger that uses the DS1302 Time Chip The battery for the Chip only last about a year this may because·
I only use it about 2 or 3 time a Year
By the way Sid that Data Logger Works·Very Well.................·Four Thumps UP
I use this where·I work
I could not ask for any more Thank Again For your Help·in that Project
·This is what i came up with that you have to have to make this work
' {$STAMP BS2}
' {$PBASIC 2.5}
Temp·········· ·· VAR···· ·Byte
RTCCmd·········· VAR··· ·Byte
Tric··············· ·CON··· %10010000
Clk················ ·CON··· 0
Dta··············· ·CON··· 1
RTCRset········· ·CON··· 2
························· 'Trickle time charger setting
OFF········· CON··· %11110000········· ' turns off trickle charger
D1R1········ CON··· %10100101········· ' 1 diode· 1· resistor
D1R2········ CON··· %10100110········· ' 1 diode· 2· resistor
D1R3········ CON··· %10100111········· ' 1 diode· 3· resistor
D2R1········ CON··· %10101001········· ' 2 diode· 1· resistor
D2R2········ CON··· %10101010········· ' 2 diode· 2· resistor
D2R3········ CON··· %10101011········· ' 2 diode· 3· resistor
ClrReg······ CON··· %00111
DIRS=%000000000011111
OUTS=%000000000000000
·································· ' Clear Write Protect bit in control registor
Temp =%10
RTCCmd = ClrReg
GOSUB WriteRTC
····································'·trickle timer settings
Temp = Off····· ·'changes to this varable to off or the setting that you want the DS1302 to change see data sheet
'Is this to mean that if you want 1 diode 1 resistor you would put this
Temp = D1R1··· ' I am right in this
RTCCmd = TRIC
GOSUB trick
Temp =$80
RTCCmd = ClrReg
GOSUB WriteRTC
WriteRTC:···································'Write to DS1302 RTC
HIGH RTCRset
SHIFTOUT Dta, Clk, LSBFIRST,[noparse][[/noparse]%0\1,RTCCmd\5,%10\2,Temp]
LOW RTCRset
RETURN
Trick:
HIGH rtcrset
SHIFTOUT Dta, Clk, LSBFIRST,[noparse][[/noparse]RTCCmd,Temp]
LOW RTCRset
RETURN
··Please let me know if i am missing something in what I have here and i want to use the DS1302·Counter Demo
Thank You For Your Help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 11/26/2007 9:40:59 PM GMT
I want say something first
I know that you DO NOT WRITE A DEMO CODE FOR JUST ONE PERSON
Which·I understand the reason for this
I·am asking· you to write a Demo Code just for the· RTC for Trickle Charging Mode·using this Demo Code in the Attachment below
Chirs........Thank You For Any Help That You Can Give
Because it seem that no one know how to get it to work i have try the· DS1302 Appkit Demo
I could not get it to work on a 3.75 Ni Cad Battery Pack
Now i have a project that if i could get this to work
I·would make this project have a battery back to keep to the time when the power went off
The reason I·do not want to use a Non Rechargeable Battery
Is because Sid made me a Data Logger that uses the DS1302 Time Chip The battery for the Chip only last about a year this may because·
I only use it about 2 or 3 time a Year
By the way Sid that Data Logger Works·Very Well.................·Four Thumps UP
I use this where·I work
I could not ask for any more Thank Again For your Help·in that Project
·This is what i came up with that you have to have to make this work
' {$STAMP BS2}
' {$PBASIC 2.5}
Temp·········· ·· VAR···· ·Byte
RTCCmd·········· VAR··· ·Byte
Tric··············· ·CON··· %10010000
Clk················ ·CON··· 0
Dta··············· ·CON··· 1
RTCRset········· ·CON··· 2
························· 'Trickle time charger setting
OFF········· CON··· %11110000········· ' turns off trickle charger
D1R1········ CON··· %10100101········· ' 1 diode· 1· resistor
D1R2········ CON··· %10100110········· ' 1 diode· 2· resistor
D1R3········ CON··· %10100111········· ' 1 diode· 3· resistor
D2R1········ CON··· %10101001········· ' 2 diode· 1· resistor
D2R2········ CON··· %10101010········· ' 2 diode· 2· resistor
D2R3········ CON··· %10101011········· ' 2 diode· 3· resistor
ClrReg······ CON··· %00111
DIRS=%000000000011111
OUTS=%000000000000000
·································· ' Clear Write Protect bit in control registor
Temp =%10
RTCCmd = ClrReg
GOSUB WriteRTC
····································'·trickle timer settings
Temp = Off····· ·'changes to this varable to off or the setting that you want the DS1302 to change see data sheet
'Is this to mean that if you want 1 diode 1 resistor you would put this
Temp = D1R1··· ' I am right in this
RTCCmd = TRIC
GOSUB trick
Temp =$80
RTCCmd = ClrReg
GOSUB WriteRTC
WriteRTC:···································'Write to DS1302 RTC
HIGH RTCRset
SHIFTOUT Dta, Clk, LSBFIRST,[noparse][[/noparse]%0\1,RTCCmd\5,%10\2,Temp]
LOW RTCRset
RETURN
Trick:
HIGH rtcrset
SHIFTOUT Dta, Clk, LSBFIRST,[noparse][[/noparse]RTCCmd,Temp]
LOW RTCRset
RETURN
··Please let me know if i am missing something in what I have here and i want to use the DS1302·Counter Demo
Thank You For Your Help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 11/26/2007 9:40:59 PM GMT
Comments
·· Before I write anything, do you know what coltage and current settings your battery needs or that you want to use?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Thank you· for your reply
The battery that i am using are 100 milamp batterys or·200 milamps batterys
I would use 5 milamp current or 10 milamp current·to charge the batterys
If these current are to high please let me know what current is use able
These are 1\3 AA batterys
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 11/26/2007 10:10:38 PM GMT
·Thank you for your reply on this·post
·http://forums.parallax.com/showthread.php?p=690690
I put the battery milamp in the post above
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
5mA for a 100mAh battery or 10mA for a 200mAh battery would work.
Thanks for your reply
Can you tell·me how to get the Trickle Charging Mode·to work using·this Demo Code
·How· can I·get it to charge batterys that i have hook up to the DS1302
When i have try this before it will not charge
I took all of the CODE.......of
·What i think has to with the charging mode
·Can you tell me if i am· missing any thing
Thank you for your time and help in this matter
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
I have had luck running this code with my DS1302.· I have a 3.6v NiMh battery pack and it seems to be keeping it charged.
Frank
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The more I look for common sense in the world...
the more·I·find how un-common it is.
I will give this a try
Thank You for your help with this
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam