BS2...DS1302 demo code
hmlittle59
Posts: 404
Hello all,
the code from Jeff Martin shows numbers being saved to DS1302 RAM, can Letters(char.) be saved also? "YES"..."NO"..."***".
thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!
hmlittle59
the code from Jeff Martin shows numbers being saved to DS1302 RAM, can Letters(char.) be saved also? "YES"..."NO"..."***".
thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!
hmlittle59
Comments
Try this for a little demo:
The memory location holding variable X contains the binary number 01000001. That number can be used as the decimal number 65, the Hex number 41, or the ASCII character 'a'. You could add 3 to X, and you'd get 68, 44 (Hex), or 'd' (ASCII). The memory location doesn't care what you're planning to use the number for.
Post Edited (sylvie369) : 11/24/2008 3:25:32 PM GMT
I understand Hex,Ascii, and all, I guess I'm just making it harder then what it should be for myself when I look at and try to understand the DS1302 Demo and writing my own code to use the 31 Bytes. I'm just looking to store some (AUTO-CONFIG.) info in this RAM. "YES/NO", Number Values(22,00,03,*,##). My Pseudo Code is done and the Demo has Number Examples. I'll just save words "YES" or "NO" one letter at a time.
thanks for the info
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!
hmlittle59
Don't know about the DS1302, but the DS1307 seems to retain stuff in its RAM even through a brief power-down that kills the time-of-day in the clock. Every time I jiggled the board, it would lose the time but keep the rest. Battery jiggling in its holder, I think. I put a capacitor across the battery, big enough to run the clock about 1/10 second -- 0.1 microfarad -- and stopped losing time, even when I directly beat on the battery in its holder.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net
Post Edited (Carl Hayes) : 11/26/2008 5:50:23 AM GMT
Yes, I use the (1 & 0) already so the Sub-routine is in place, but I just wanted to ensure the selection was exact and no false location settings(noise) or back up power glitches
as this could by-pass some routines and setup some false values and (LOCK-OUT) times. Maybe I'll use 3 ones(111) = yes ... 3 zeros(000) = no (keep data field the same) to keep it close to full proof. My current board already has the 3.3v back up in place for the DS1302.
I'll think on it some more thanks Carl
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I HAVE LEARN SO MUCH...BUT STILL KNOW SO LITTLE!!!
hmlittle59
Post Edited (hmlittle59) : 11/26/2008 2:57:26 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net