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

From Flowcode Help
Jump to navigationJump to search
Author Matrix TSL
Version 2.2
Category Storage


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 Pack

FREE

Detailed description

No detailed description exists yet for this component

Examples

FC6 Icon.png RTC DS1307 DS3231 Example.fcfx

Example showing how to retrieve and display the time using bytes or string RTC component.

Downloadable macro reference

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


Fc9-comp-macro.png Initialise
Initialises the RTC component ready for operation. 
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
 
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Scope Traces
Selects if the component pin connections are automatically generated on the data recorder window or not. Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion. No: Do not show the pin signals on the data recorder window. 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-16-icon.png API
Specifies the injector component on the panel to interact with to provide comms simulation.