RTC Clock
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
RTC Clock
Hi everybody
I will try to use Clock below:
viewtopic.php?f=28&t=20814
But how do I set the clock and date?
Would you like to illustrate where I am doing this?
How to set Date format as 08:02: 2019?
Any help would be greatly appreciated.
Have attached the code I want to use below
I will try to use Clock below:
viewtopic.php?f=28&t=20814
But how do I set the clock and date?
Would you like to illustrate where I am doing this?
How to set Date format as 08:02: 2019?
Any help would be greatly appreciated.
Have attached the code I want to use below
Best Regard
Monie
Monie
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: RTC Clock
Hi Monie,
The RTC component (MCP7940N) returns or sets the Date with a 6 digit string in the format DDMMYY (e.g. the string of characters "080219")
Similarly the Time format is 6 digits HHMMSS (e.g. the string of characters "152701")
So to enable a MIAC user to set the time and date you will need have a menu option to do that.
Perhaps display the date and time on screen and use the left and right cursor to move between the digits,
and use up/down keys to increase or decrease a value. Then use SetDate() and SetTime() to write the new values to the RTC.
If you want a different format, not DDMMYY, on screen then you could copy the digits into a new string buffer,
similarly copy them back into a DDMMYY format before calling SetDate()
You will see examples of this in the linked posts.
The RTC component (MCP7940N) returns or sets the Date with a 6 digit string in the format DDMMYY (e.g. the string of characters "080219")
Similarly the Time format is 6 digits HHMMSS (e.g. the string of characters "152701")
So to enable a MIAC user to set the time and date you will need have a menu option to do that.
Perhaps display the date and time on screen and use the left and right cursor to move between the digits,
and use up/down keys to increase or decrease a value. Then use SetDate() and SetTime() to write the new values to the RTC.
If you want a different format, not DDMMYY, on screen then you could copy the digits into a new string buffer,
similarly copy them back into a DDMMYY format before calling SetDate()
You will see examples of this in the linked posts.
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC Clock
Hi everybody
User: Flowcode v8 MIAC dsPIC RTC Clock
Have tried really many hours to enroll current Time and Date, but without success!
Can I get help on a description of how this should be done?
Have tried downhill with it does not succeed!
Example:
Date = 150219
1: Select (F1) for Date
2: 1
2: OK
Can't move on any more!
Would you like to help with an example of writing eg Date directly using the MIAC dsPIC KEY.
Have a lot for an example to be able to move on;-)
User: Flowcode v8 MIAC dsPIC RTC Clock
Have tried really many hours to enroll current Time and Date, but without success!
Can I get help on a description of how this should be done?
Have tried downhill with it does not succeed!
Example:
Date = 150219
1: Select (F1) for Date
2: 1
2: OK
Can't move on any more!
Would you like to help with an example of writing eg Date directly using the MIAC dsPIC KEY.
Have a lot for an example to be able to move on;-)
Best Regard
Monie
Monie
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: RTC Clock
Also some help here in the Resources tab ..
https://www.matrixtsl.com/webshop/miac- ... dspic.html
https://www.matrixtsl.com/resources/get ... hp?id=1008
https://www.matrixtsl.com/webshop/miac- ... dspic.html
https://www.matrixtsl.com/resources/get ... hp?id=1008
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC Clock
Hi LeighM
Many thanks for the code example;
Everyday help
For information I use an old computer that's why I can still work with Flowcode v8,
Good weekend
Many thanks for the code example;
Everyday help
For information I use an old computer that's why I can still work with Flowcode v8,
Good weekend
Best Regard
Monie
Monie
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC Clock
Hi everyone
Has the RTC Clock function "LeapYear = ! (Year MOD (Year / 4)) //1 = leap year"?
Has the RTC Clock function "LeapYear = ! (Year MOD (Year / 4)) //1 = leap year"?
Best Regard
Monie
Monie
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC Clock
Hi everyone
Want to convert from String to (Format Float) for the 3 variables below
and insert clock into the variable HOUR_FP etc.
1: HOUR_FP
2: MIN_FP
3: SEC_FP
Would you like to help with an example or description.
Please see here!
Attached coder:
Want to convert from String to (Format Float) for the 3 variables below
and insert clock into the variable HOUR_FP etc.
1: HOUR_FP
2: MIN_FP
3: SEC_FP
Would you like to help with an example or description.
Please see here!
Attached coder:
Best Regard
Monie
Monie
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC Clock
Hi everyone
Want to upload the file below with failed.
Does anyone want to help upload files below and send it to my Private message here on Flowcode
Want to use the file in Flowcode v8 Web Page:
viewtopic.php?f=28&t=12561&p=49998&hili ... oat#p49998
Want to upload the file below with failed.
Does anyone want to help upload files below and send it to my Private message here on Flowcode
Want to use the file in Flowcode v8 Web Page:
viewtopic.php?f=28&t=12561&p=49998&hili ... oat#p49998
Best Regard
Monie
Monie
-
- Valued Contributor
- Posts: 1208
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 440 times
Re: RTC Clock
Hi Monie,
I've downloaded and posted to you - note that I'm not sure that I'd recommend you using it as a template - it was written way back and (for example) has a string called 'string' that Flowcode will choke on - I renamed it test to allow the flowchart to load - but you will need to change other occurrences! (An error box appeared behind the main FC window when I opened it)
The code uses a lot of Mid$ - and you would be better off using the index operator (a = s[0] for example)
Note also that the RTC doesn't accept floating point numbers - set / get time uses a string ('HHMMSS') - if you want to convert the parts of this from a string to a number you would use something like:
- index 1 and 2 for minutes and 3, 4 for seconds.
If you need the values as a float then you can assign the value to a floating point variable (once converted to an int)
Conversion the other way - why do you want to use a float - all the values are integer (0-23, 0-59) ?
Martin
I've downloaded and posted to you - note that I'm not sure that I'd recommend you using it as a template - it was written way back and (for example) has a string called 'string' that Flowcode will choke on - I renamed it test to allow the flowchart to load - but you will need to change other occurrences! (An error box appeared behind the main FC window when I opened it)
The code uses a lot of Mid$ - and you would be better off using the index operator (a = s[0] for example)
Note also that the RTC doesn't accept floating point numbers - set / get time uses a string ('HHMMSS') - if you want to convert the parts of this from a string to a number you would use something like:
- index 1 and 2 for minutes and 3, 4 for seconds.
If you need the values as a float then you can assign the value to a floating point variable (once converted to an int)
Conversion the other way - why do you want to use a float - all the values are integer (0-23, 0-59) ?
Martin
-
- Posts: 484
- Joined: Mon Jul 30, 2012 3:39 pm
- Has thanked: 17 times
- Been thanked: 46 times
Re: RTC Clock
Hi everyone
I want to implement "MIAC dsPICSetting Date Time-OK"
Attached file: MIAC_dsPIC_Clock - Date and Time must be implanted in the file below...
Attached file: There someone who will be helpful with the coder.
I want to implement "MIAC dsPICSetting Date Time-OK"
Attached file: MIAC_dsPIC_Clock - Date and Time must be implanted in the file below...
Attached file: There someone who will be helpful with the coder.
Best Regard
Monie
Monie