Component: Real Time Clock (Internal, DS1307, DS3231, DS3232) (Real Time Clock)

From Flowcode Help
Jump to navigationJump to search
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