Difference between revisions of "Component: Real Time Clock (Internal, DS1307, DS3231, DS3232) (Real Time Clock)"

From Flowcode Help
Jump to navigationJump to search
 
(6 intermediate revisions by the same user not shown)
Line 16: Line 16:
  
 
==Component Source Code==
 
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_RealTimeClock.fcfx FC_Comp_Source_RealTimeClock.fcfx]
  
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_RealTimeClock.fcfx FC_Comp_Source_RealTimeClock.fcfx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_RealTimeClock.fcfx FC_Comp_Source_RealTimeClock.fcfx]
Line 25: Line 27:
  
  
''No detailed description exists yet for this component''
 
  
==Examples==
 
  
  
Line 33: Line 33:
  
  
''<span style="color:red;">No additional examples</span>''
+
''No detailed description exists yet for this component''
 +
 
 +
==Examples==
 +
 
  
==Macro reference==
 
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetSecs'''
 
|-
 
| colspan="2" | Sets the seconds as a binary value 0-59. Does not currently simulate.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Seconds
 
|-
 
| colspan="2" | Range 0-59&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | WhichClock
 
|-
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetYear'''
 
|-
 
| colspan="2" | Sets the year as a binary value 0-99. Does not currently simulate.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | year
 
|-
 
| colspan="2" | Range 0-99&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDateString'''
 
|-
 
| colspan="2" | Reads the current date from the RTC and returns it formatted as a string. e.g. DD:MM:YY&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | USformat
 
|-
 
| colspan="2" | 0="DD/MM/YY", 1="MM/DD/YY"&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SQWandINTcontrol'''
 
|-
 
| colspan="2" | Allows a square wave output to be generated by the DS1307 and DS3231 ICs. Also allows the DS3231 interrupts to be configured via the INT/SQW pin. This function doesn't currently simulate.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | SquareWaveEnable
 
|-
 
| colspan="2" | 0 = Square Wave Output Disabled / 1 = Square Wave Output Enabled&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | FrequencySelect
 
|-
 
| colspan="2" | Controls the output frequency of the square wave, Range 0-3, Refer to the device datasheet for frequencies&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | InterruptEnable
 
|-
 
| colspan="2" | Only Available on DS3231 and when SQW is disabled. Range 0-3&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
''<span style="color:red;">No additional examples</span>''
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetSecs'''
 
|-
 
| colspan="2" | Gets the seconds of the current time as a binary value 0-59. Simulation returns system time.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | WhichClock
 
|-
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHours'''
 
|-
 
| colspan="2" | Gets the hours of the current time as a binary value 0-11 or 0-23. Simulation returns system time.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | WhichClock
 
|-
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetYear'''
 
|-
 
| colspan="2" | Gets the year as a binary value 0-99. Simulation returns system date.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWeekDay'''
 
|-
 
| colspan="2" | Gets the day of the week as a binary value 1-7. This function doesn't currently simulate.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | WhichClock
 
|-
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRamDS3232'''
 
|-
 
| colspan="2" | Sets the value of one of the free RAM locations on the DS3232 device&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Address
 
|-
 
| colspan="2" | 236 RAM Locations. Range: 0 to 235&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Data value. Range 0 to 255&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRamDS1307'''
 
|-
 
| colspan="2" | Sets the value of one of the free RAM locations on the DS1307 device&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Address
 
|-
 
| colspan="2" | 56 RAM Locations. Range: 0 to 55&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Data value. Range 0 to 255&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
 +
==Macro reference==
  
 +
===GetAmPm===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetWeekDay'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetAmPm'''
 
|-
 
|-
| colspan="2" | Sets the day of the week as a binary value 1-7. This function doesn't currently simulate.&nbsp;
+
| colspan="2" | Checks to see if the time is currently AM or PM for 12 hour clock mode. Simulation returns system time. 0 = AM / 1 = PM&nbsp;
 
|-
 
|-
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Day
 
|-
 
| colspan="2" | Range 1-7&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
Line 255: Line 75:
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetDate===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMonth'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDate'''
 
|-
 
|-
| colspan="2" | Sets the month as a binary value 1-12. Does not currently simulate.&nbsp;
+
| colspan="2" | Gets the date as a binary value 1-31. Simulation returns system date.&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | month
 
|-
 
| colspan="2" | Range 1-12&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetDateString===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetHours'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDateString'''
 
|-
 
|-
| colspan="2" | Sets the hours as a binary value 0-23. Does not currently simulate.&nbsp;
+
| colspan="2" | Reads the current date from the RTC and returns it formatted as a string. e.g. DD:MM:YY&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Hours
+
| width="90%" | USformat
 
|-
 
|-
| colspan="2" | Range 0-23&nbsp;
+
| colspan="2" | 0="DD/MM/YY", 1="MM/DD/YY"&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Mode
 
|-
 
| colspan="2" | 0=24 Hour Clock, 1=12 Hour Clock&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | WhichClock
 
|-
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetHours===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMins'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHours'''
 
|-
 
|-
| colspan="2" | Sets the minutes as a binary value 0-59. Does not currently simulate.&nbsp;
+
| colspan="2" | Gets the hours of the current time as a binary value 0-11 or 0-23. Simulation returns system time.&nbsp;
 
|-
 
|-
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Minutes
 
|-
 
| colspan="2" | Range 0-59&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
Line 324: Line 127:
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetMins===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 347: Line 151:
  
  
 +
===GetMonth===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDate'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetMonth'''
 
|-
 
|-
| colspan="2" | Sets the date as a binary value 1-31. Does not currently simulate.&nbsp;
+
| colspan="2" | Gets the month as a binary value 1-12. Simulation returns system date.&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | date
 
|-
 
| colspan="2" | Range 1-31&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetRamDS1307===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTimeString'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRamDS1307'''
 
|-
 
|-
| colspan="2" | Reads the current time from the RTC and returns it formatted as a string. e.g. HH:MM:SS&nbsp;
+
| colspan="2" | Gets a byte of RAM from the free memory on the DS1307 device.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | IncludeSeconds
+
| width="90%" | Address
|-
 
| colspan="2" | 0=Dont Include Seconds, 1=Include Seconds&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetAmPm'''
 
|-
 
| colspan="2" | Checks to see if the time is currently AM or PM for 12 hour clock mode. Simulation returns system time. 0 = AM / 1 = PM&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | WhichClock
 
|-
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDate'''
 
|-
 
| colspan="2" | Gets the date as a binary value 1-31. Simulation returns system date.&nbsp;
 
 
|-
 
|-
 +
| colspan="2" | 56 RAM Locations. Range: 0 to 55&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
Line 414: Line 184:
  
  
 +
===GetRamDS3232===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 432: Line 203:
  
  
 +
===GetSecs===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRamDS1307'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetSecs'''
 
|-
 
|-
| colspan="2" | Gets a byte of RAM from the free memory on the DS1307 device.&nbsp;
+
| colspan="2" | Gets the seconds of the current time as a binary value 0-59. Simulation returns system time.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Address
+
| width="90%" | WhichClock
 
|-
 
|-
| colspan="2" | 56 RAM Locations. Range: 0 to 55&nbsp;
+
| colspan="2" | 0=Time, 1=Alarm1 DS3231&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
Line 450: Line 222:
  
  
 +
===GetTimeString===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetMonth'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTimeString'''
 
|-
 
|-
| colspan="2" | Gets the month as a binary value 1-12. Simulation returns system date.&nbsp;
+
| colspan="2" | Reads the current time from the RTC and returns it formatted as a string. e.g. HH:MM:SS&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
+
| width="90%" | IncludeSeconds
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
+
| colspan="2" | 0=Dont Include Seconds, 1=Include Seconds&nbsp;
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
 
|-
 
|-
| colspan="2" | Initialises the RTC component ready for operation.&nbsp;
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 
+
===GetWeekDay===
 
 
==Property reference==
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | RTC Module
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | I2C Address
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Channel selection&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | SDA
 
|-
 
| colspan="2" | Pin used for SDA (data signal)&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | SCL
 
|-
 
| colspan="2" | Pin used for SCL (clock signal)&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Baud Select
 
|-
 
| colspan="2" | Baud rate option selector&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
| width="90%" | Baud Rate
 
|-
 
| colspan="2" | Baud rate to be used&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Stop Delay
 
|-
 
| colspan="2" | On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  a 10ms delay between an I2C stop event and the next I2C start event.  Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  I2C communications. &nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Simulate Comms
 
|-
 
| colspan="2" | &nbsp;
 
|}==Macro reference==
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetSecs'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWeekDay'''
 
|-
 
|-
| colspan="2" | Sets the seconds as a binary value 0-59. Does not currently simulate.&nbsp;
+
| colspan="2" | Gets the day of the week as a binary value 1-7. This function doesn't currently simulate.&nbsp;
 
|-
 
|-
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Seconds
 
|-
 
| colspan="2" | Range 0-59&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | WhichClock
 
| width="90%" | WhichClock
 
|-
 
|-
| colspan="2" | 0=Time, 1=Alarm1 DS3231&nbsp;
+
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetYear===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetYear'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetYear'''
 
|-
 
|-
| colspan="2" | Sets the year as a binary value 0-99. Does not currently simulate.&nbsp;
+
| colspan="2" | Gets the year as a binary value 0-99. Simulation returns system date.&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | year
 
|-
 
| colspan="2" | Range 0-99&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===Initialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDateString'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
| colspan="2" | Reads the current date from the RTC and returns it formatted as a string. e.g. DD:MM:YY&nbsp;
+
| colspan="2" | Initialises the RTC component ready for operation.&nbsp;
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" | USformat
 
|-
 
| colspan="2" | 0="DD/MM/YY", 1="MM/DD/YY"&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===SQWandINTcontrol===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 627: Line 317:
  
  
 +
===SetDate===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetSecs'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDate'''
 
|-
 
|-
| colspan="2" | Gets the seconds of the current time as a binary value 0-59. Simulation returns system time.&nbsp;
+
| colspan="2" | Sets the date as a binary value 1-31. Does not currently simulate.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | WhichClock
+
| width="90%" | date
 
|-
 
|-
| colspan="2" | 0=Time, 1=Alarm1 DS3231&nbsp;
+
| colspan="2" | Range 1-31&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===SetHours===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHours'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetHours'''
 
|-
 
|-
| colspan="2" | Gets the hours of the current time as a binary value 0-11 or 0-23. Simulation returns system time.&nbsp;
+
| colspan="2" | Sets the hours as a binary value 0-23. Does not currently simulate.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | WhichClock
+
| width="90%" | Hours
 
|-
 
|-
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
+
| colspan="2" | Range 0-23&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
+
| width="90%" | Mode
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetYear'''
 
|-
 
| colspan="2" | Gets the year as a binary value 0-99. Simulation returns system date.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWeekDay'''
 
|-
 
| colspan="2" | Gets the day of the week as a binary value 1-7. This function doesn't currently simulate.&nbsp;
 
 
|-
 
|-
 +
| colspan="2" | 0=24 Hour Clock, 1=12 Hour Clock&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
Line 688: Line 359:
 
|-
 
|-
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRamDS3232'''
 
|-
 
| colspan="2" | Sets the value of one of the free RAM locations on the DS3232 device&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Address
 
|-
 
| colspan="2" | 236 RAM Locations. Range: 0 to 235&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Data value. Range 0 to 255&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 717: Line 365:
  
  
 +
===SetMins===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRamDS1307'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMins'''
 
|-
 
|-
| colspan="2" | Sets the value of one of the free RAM locations on the DS1307 device&nbsp;
+
| colspan="2" | Sets the minutes as a binary value 0-59. Does not currently simulate.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Address
+
| width="90%" | Minutes
 
|-
 
|-
| colspan="2" | 56 RAM Locations. Range: 0 to 55&nbsp;
+
| colspan="2" | Range 0-59&nbsp;
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Data value. Range 0 to 255&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetWeekDay'''
 
|-
 
| colspan="2" | Sets the day of the week as a binary value 1-7. This function doesn't currently simulate.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Day
 
|-
 
| colspan="2" | Range 1-7&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
Line 763: Line 389:
  
  
 +
===SetMonth===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 781: Line 408:
  
  
 +
===SetRamDS1307===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetHours'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRamDS1307'''
 
|-
 
|-
| colspan="2" | Sets the hours as a binary value 0-23. Does not currently simulate.&nbsp;
+
| colspan="2" | Sets the value of one of the free RAM locations on the DS1307 device&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Hours
+
| width="90%" | Address
 
|-
 
|-
| colspan="2" | Range 0-23&nbsp;
+
| colspan="2" | 56 RAM Locations. Range: 0 to 55&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Mode
+
| width="90%" | Data
 
|-
 
|-
| colspan="2" | 0=24 Hour Clock, 1=12 Hour Clock&nbsp;
+
| colspan="2" | Data value. Range 0 to 255&nbsp;
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | WhichClock
 
|-
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 809: Line 432:
  
  
 +
===SetRamDS3232===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMins'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRamDS3232'''
 
|-
 
|-
| colspan="2" | Sets the minutes as a binary value 0-59. Does not currently simulate.&nbsp;
+
| colspan="2" | Sets the value of one of the free RAM locations on the DS3232 device&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Minutes
+
| width="90%" | Address
 
|-
 
|-
| colspan="2" | Range 0-59&nbsp;
+
| colspan="2" | 236 RAM Locations. Range: 0 to 235&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | WhichClock
+
| width="90%" | Data
 
|-
 
|-
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
+
| colspan="2" | Data value. Range 0 to 255&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 832: Line 456:
  
  
 +
===SetSecs===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetMins'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetSecs'''
 
|-
 
|-
| colspan="2" | Gets the minutes of the current time as a binary value 0-59. Simulation returns system time.&nbsp;
+
| colspan="2" | Sets the seconds as a binary value 0-59. Does not currently simulate.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | WhichClock
+
| width="90%" | Seconds
|-
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDate'''
 
|-
 
| colspan="2" | Sets the date as a binary value 1-31. Does not currently simulate.&nbsp;
 
 
|-
 
|-
 +
| colspan="2" | Range 0-59&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | date
+
| width="90%" | WhichClock
 
|-
 
|-
| colspan="2" | Range 1-31&nbsp;
+
| colspan="2" | 0=Time, 1=Alarm1 DS3231&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 868: Line 480:
  
  
 +
===SetWeekDay===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTimeString'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetWeekDay'''
 
|-
 
|-
| colspan="2" | Reads the current time from the RTC and returns it formatted as a string. e.g. HH:MM:SS&nbsp;
+
| colspan="2" | Sets the day of the week as a binary value 1-7. This function doesn't currently simulate.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | IncludeSeconds
+
| width="90%" | Day
|-
 
| colspan="2" | 0=Dont Include Seconds, 1=Include Seconds&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetAmPm'''
 
|-
 
| colspan="2" | Checks to see if the time is currently AM or PM for 12 hour clock mode. Simulation returns system time. 0 = AM / 1 = PM&nbsp;
 
 
|-
 
|-
 +
| colspan="2" | Range 1-7&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
Line 899: Line 499:
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
| colspan="2" | 0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===SetYear===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDate'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetYear'''
 
|-
 
|-
| colspan="2" | Gets the date as a binary value 1-31. Simulation returns system date.&nbsp;
+
| colspan="2" | Sets the year as a binary value 0-99. Does not currently simulate.&nbsp;
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRamDS3232'''
 
|-
 
| colspan="2" | Gets a byte of RAM from the free memory on the DS3232 device.&nbsp;
 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Address
+
| width="90%" | year
|-
 
| colspan="2" | 236 RAM Locations. Range: 0 to 235&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRamDS1307'''
 
|-
 
| colspan="2" | Gets a byte of RAM from the free memory on the DS1307 device.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Address
 
|-
 
| colspan="2" | 56 RAM Locations. Range: 0 to 55&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetMonth'''
 
|-
 
| colspan="2" | Gets the month as a binary value 1-12. Simulation returns system date.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
| colspan="2" | Initialises the RTC component ready for operation.&nbsp;
 
 
|-
 
|-
 +
| colspan="2" | Range 0-99&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  

Latest revision as of 13:12, 7 February 2023

Author Matrix TSL
Version 2.2
Category Real Time Clock


Real Time Clock (Internal, DS1307, DS3231, DS3232) component

A Real Time Clock component allowing things like clocks and timers to easily be created. Compatible with the internal RTCC module and external DS1307, DS3231 or DS3232 RTC ICs.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_RealTimeClock.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_RealTimeClock.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples






Macro reference

GetAmPm

Fc9-comp-macro.png GetAmPm
Checks to see if the time is currently AM or PM for 12 hour clock mode. Simulation returns system time. 0 = AM / 1 = PM 
Fc9-u8-icon.png - BYTE WhichClock
0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231 
Fc9-u8-icon.png - BYTE Return


GetDate

Fc9-comp-macro.png GetDate
Gets the date as a binary value 1-31. Simulation returns system date. 
Fc9-u8-icon.png - BYTE Return


GetDateString

Fc9-comp-macro.png GetDateString
Reads the current date from the RTC and returns it formatted as a string. e.g. DD:MM:YY 
Fc9-u8-icon.png - BYTE USformat
0="DD/MM/YY", 1="MM/DD/YY" 
Fc9-string-icon.png - STRING Return


GetHours

Fc9-comp-macro.png GetHours
Gets the hours of the current time as a binary value 0-11 or 0-23. Simulation returns system time. 
Fc9-u8-icon.png - BYTE WhichClock
0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231 
Fc9-u8-icon.png - BYTE Return


GetMins

Fc9-comp-macro.png GetMins
Gets the minutes of the current time as a binary value 0-59. Simulation returns system time. 
Fc9-u8-icon.png - BYTE WhichClock
0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231 
Fc9-u8-icon.png - BYTE Return


GetMonth

Fc9-comp-macro.png GetMonth
Gets the month as a binary value 1-12. Simulation returns system date. 
Fc9-u8-icon.png - BYTE Return


GetRamDS1307

Fc9-comp-macro.png GetRamDS1307
Gets a byte of RAM from the free memory on the DS1307 device. 
Fc9-u8-icon.png - BYTE Address
56 RAM Locations. Range: 0 to 55 
Fc9-u8-icon.png - BYTE Return


GetRamDS3232

Fc9-comp-macro.png GetRamDS3232
Gets a byte of RAM from the free memory on the DS3232 device. 
Fc9-u8-icon.png - BYTE Address
236 RAM Locations. Range: 0 to 235 
Fc9-u8-icon.png - BYTE Return


GetSecs

Fc9-comp-macro.png GetSecs
Gets the seconds of the current time as a binary value 0-59. Simulation returns system time. 
Fc9-u8-icon.png - BYTE WhichClock
0=Time, 1=Alarm1 DS3231 
Fc9-u8-icon.png - BYTE Return


GetTimeString

Fc9-comp-macro.png GetTimeString
Reads the current time from the RTC and returns it formatted as a string. e.g. HH:MM:SS 
Fc9-u8-icon.png - BYTE IncludeSeconds
0=Dont Include Seconds, 1=Include Seconds 
Fc9-string-icon.png - STRING Return


GetWeekDay

Fc9-comp-macro.png GetWeekDay
Gets the day of the week as a binary value 1-7. This function doesn't currently simulate. 
Fc9-u8-icon.png - BYTE WhichClock
0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231 
Fc9-u8-icon.png - BYTE Return


GetYear

Fc9-comp-macro.png GetYear
Gets the year as a binary value 0-99. Simulation returns system date. 
Fc9-u8-icon.png - BYTE Return


Initialise

Fc9-comp-macro.png Initialise
Initialises the RTC component ready for operation. 
Fc9-void-icon.png - VOID Return


SQWandINTcontrol

Fc9-comp-macro.png SQWandINTcontrol
Allows a square wave output to be generated by the DS1307 and DS3231 ICs. Also allows the DS3231 interrupts to be configured via the INT/SQW pin. This function doesn't currently simulate. 
Fc9-u8-icon.png - BYTE SquareWaveEnable
0 = Square Wave Output Disabled / 1 = Square Wave Output Enabled 
Fc9-u8-icon.png - BYTE FrequencySelect
Controls the output frequency of the square wave, Range 0-3, Refer to the device datasheet for frequencies 
Fc9-u8-icon.png - BYTE InterruptEnable
Only Available on DS3231 and when SQW is disabled. Range 0-3 
Fc9-void-icon.png - VOID Return


SetDate

Fc9-comp-macro.png SetDate
Sets the date as a binary value 1-31. Does not currently simulate. 
Fc9-u8-icon.png - BYTE date
Range 1-31 
Fc9-void-icon.png - VOID Return


SetHours

Fc9-comp-macro.png SetHours
Sets the hours as a binary value 0-23. Does not currently simulate. 
Fc9-u8-icon.png - BYTE Hours
Range 0-23 
Fc9-u8-icon.png - BYTE Mode
0=24 Hour Clock, 1=12 Hour Clock 
Fc9-u8-icon.png - BYTE WhichClock
0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231 
Fc9-void-icon.png - VOID Return


SetMins

Fc9-comp-macro.png SetMins
Sets the minutes as a binary value 0-59. Does not currently simulate. 
Fc9-u8-icon.png - BYTE Minutes
Range 0-59 
Fc9-u8-icon.png - BYTE WhichClock
0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231 
Fc9-void-icon.png - VOID Return


SetMonth

Fc9-comp-macro.png SetMonth
Sets the month as a binary value 1-12. Does not currently simulate. 
Fc9-u8-icon.png - BYTE month
Range 1-12 
Fc9-void-icon.png - VOID Return


SetRamDS1307

Fc9-comp-macro.png SetRamDS1307
Sets the value of one of the free RAM locations on the DS1307 device 
Fc9-u8-icon.png - BYTE Address
56 RAM Locations. Range: 0 to 55 
Fc9-u8-icon.png - BYTE Data
Data value. Range 0 to 255 
Fc9-void-icon.png - VOID Return


SetRamDS3232

Fc9-comp-macro.png SetRamDS3232
Sets the value of one of the free RAM locations on the DS3232 device 
Fc9-u8-icon.png - BYTE Address
236 RAM Locations. Range: 0 to 235 
Fc9-u8-icon.png - BYTE Data
Data value. Range 0 to 255 
Fc9-void-icon.png - VOID Return


SetSecs

Fc9-comp-macro.png SetSecs
Sets the seconds as a binary value 0-59. Does not currently simulate. 
Fc9-u8-icon.png - BYTE Seconds
Range 0-59 
Fc9-u8-icon.png - BYTE WhichClock
0=Time, 1=Alarm1 DS3231 
Fc9-void-icon.png - VOID Return


SetWeekDay

Fc9-comp-macro.png SetWeekDay
Sets the day of the week as a binary value 1-7. This function doesn't currently simulate. 
Fc9-u8-icon.png - BYTE Day
Range 1-7 
Fc9-u8-icon.png - BYTE WhichClock
0=Time, 1=Alarm1 DS3231, 2=Alarm2 DS3231 
Fc9-void-icon.png - VOID Return


SetYear

Fc9-comp-macro.png SetYear
Sets the year as a binary value 0-99. Does not currently simulate. 
Fc9-u8-icon.png - BYTE year
Range 0-99 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png RTC Module
 
Fc9-type-21-icon.png I2C Address
 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulate Comms