DS3231 - RTC Time Keeper
Posted: Thu Mar 20, 2014 8:05 pm
DS3231 - Component
Current Version = 1.68
Best Working Version = 1.68
Info:
I have made a DS3231 component which lets you easy use the DS3231 device and configure it. No need to have difficult calculations.
With this component you can just put in your time and date data in decimal values the component takes care of the rest. A nice thing is that you can choose what the behaviour is of the SQW output.
Via a simple pull down menu you can select what the output frequency is.
Also this device with two configurable Alarm settings, with this component it now a peace of cake to configure those as well.
This component uses just 19 component macros:
- Initialise
- DayOfWeek
- ReadDate
- ReadTime
- WriteDate
- WriteTime
- SetAlarm1
- SetAlarm2
- AlarmRate1
- AlarmRate2
- ReadTemperature
- AutoTimeAdjust
- CheckStatus
- ClearAlarms
- ReadDateINT
- ReadTimeINT
- WriteTimeHour
- WriteTimeMinutes
- WriteTimeSeconds
(A help file will be attached for those that doesn't understand the function of every macro)
Component Use:
The component can be used by copying the ".fcpx" file into the component directory of Flowcode v6.
Then component can be found under the tap inputs as DS3231 - RTC.
Future Updates
Future update will include:
...
Suggestion are accepted
Download:
Log:
v1.6 - Changed the way Checkstatus works, now the Checkstatus macro checks the alarm bits and returns the value to the user. Checkstatus does not clear these bits.
------- Added a new macro ClearAlarm, this macro clears the alarm given in the "Alarm" parameter. This is necessary so that a new event can happen.
v1.65 - Now the alarm functions as well as the alarm clearing routine are working correctly thank to the help of hyperion007
v1.66 - Attempted to fix the issues with the alarm functions.
-------- Made some little changes to the component code to make a little bit better and slightly faster
-------- The RTC now switches to vbat when power is removed and the alarm flags have been cleared.
v1.67 - Added 12 Hour Mode, the user can now select if he want 24 Hr notation or 12 Hour (AM/PM)
v1.68 - Added two new macro which enabled the user to manipulate the alarm rates for both the alarms.
Changing Alarm Rate with Macro's "AlarmRate1 - 2"
AlarmRate1 - MatchCondition Valid inputs between 0 to 5
0 - Alarm once per second
1 - Alarm when seconds match
2 - Alarm when minutes and seconds match
3 - Alarm when hours, minutes and seconds match
4 - Alarm when date, hours, minutes and seconds match
5 - Alarm when day, hours, minutes and seconds match
AlarmRate2 - MatchCondition Valid inputs between 0 to 4
0 - Alarm once per minute (00 seconds of every minute)
1 - Alarm when minutes match
2 - Alarm when hours and minutes match
3 - Alarm when date, hours and minutes match
4 - Alarm when day, hours and minutes match
Current Version = 1.68
Best Working Version = 1.68
Info:
I have made a DS3231 component which lets you easy use the DS3231 device and configure it. No need to have difficult calculations.
With this component you can just put in your time and date data in decimal values the component takes care of the rest. A nice thing is that you can choose what the behaviour is of the SQW output.
Via a simple pull down menu you can select what the output frequency is.
Also this device with two configurable Alarm settings, with this component it now a peace of cake to configure those as well.
This component uses just 19 component macros:
- Initialise
- DayOfWeek
- ReadDate
- ReadTime
- WriteDate
- WriteTime
- SetAlarm1
- SetAlarm2
- AlarmRate1
- AlarmRate2
- ReadTemperature
- AutoTimeAdjust
- CheckStatus
- ClearAlarms
- ReadDateINT
- ReadTimeINT
- WriteTimeHour
- WriteTimeMinutes
- WriteTimeSeconds
(A help file will be attached for those that doesn't understand the function of every macro)
Component Use:
The component can be used by copying the ".fcpx" file into the component directory of Flowcode v6.
Then component can be found under the tap inputs as DS3231 - RTC.
Future Updates
Future update will include:
...
Suggestion are accepted
Download:
Log:
v1.6 - Changed the way Checkstatus works, now the Checkstatus macro checks the alarm bits and returns the value to the user. Checkstatus does not clear these bits.
------- Added a new macro ClearAlarm, this macro clears the alarm given in the "Alarm" parameter. This is necessary so that a new event can happen.
v1.65 - Now the alarm functions as well as the alarm clearing routine are working correctly thank to the help of hyperion007
v1.66 - Attempted to fix the issues with the alarm functions.
-------- Made some little changes to the component code to make a little bit better and slightly faster
-------- The RTC now switches to vbat when power is removed and the alarm flags have been cleared.
v1.67 - Added 12 Hour Mode, the user can now select if he want 24 Hr notation or 12 Hour (AM/PM)
v1.68 - Added two new macro which enabled the user to manipulate the alarm rates for both the alarms.
Changing Alarm Rate with Macro's "AlarmRate1 - 2"
AlarmRate1 - MatchCondition Valid inputs between 0 to 5
0 - Alarm once per second
1 - Alarm when seconds match
2 - Alarm when minutes and seconds match
3 - Alarm when hours, minutes and seconds match
4 - Alarm when date, hours, minutes and seconds match
5 - Alarm when day, hours, minutes and seconds match
AlarmRate2 - MatchCondition Valid inputs between 0 to 4
0 - Alarm once per minute (00 seconds of every minute)
1 - Alarm when minutes match
2 - Alarm when hours and minutes match
3 - Alarm when date, hours and minutes match
4 - Alarm when day, hours and minutes match