![]() |
Forum Index : Microcontroller and PC projects : Saving Data to RTC
Author | Message | ||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
I started a new thread for this. So I have played around with Grogsters code and came up with.. SUB SAVETORTC Local X 'A local X variable, perhaps totally seperate from a global X For X=1 to 3 'Step through the three-byte date data, and save it to the RTC RAM RTC SETREG 50+X, MID$(R$,X,1) 'Put data into RTC register R$ is numeric Next END SUB SUB READRTC R_Save$="" Local X,BYTE For X=1 to 3 RTC GETREG 50+X,BYTE R_Save$=R_Save$+CHR$(BYTE) ' use "Rain_Saved = Val(R_Save$)" to get value Next END SUB it runs without error but does not work, whether it is not writing or not reading I don't know or maybe both. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
Think I found a mistake.... OOPS WRONG THINKING THERE cancel that. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
I don't have a RTC with ram but you are trying to save a character when it should be a number I have converted your SUBs to FUNCTIONs and added ASC(MID$(R$,X,1)) I have used RETREG and GETREG to configure clock options without any issues. Jim VK7JH MMedit |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |