Jump to content

Component: Real Time Clock (MCP7940N) (Real Time Clock)

From Flowcode Help
Revision as of 14:37, 13 July 2026 by SteveT (talk | contribs) (Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Author Matrix TSL
Version 1.0
Category Real Time Clock


Real Time Clock (MCP7940N) component

Serial (I2C) Real Time Clock component for MCP7940N device. When used with a MIAC project this component gives access to the internal RTC (if fitted, depending upon model) and the component properties will be automatically configured.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_RTC_(MCP7940N).fcfx

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

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

GetDate

GetDate
Returns the date as a string DDMMYY 
- STRING Return


GetTime

GetTime
Returns the time as a string HHMMSS 
- STRING Return


Initialise

Initialise
Initialises the component ready for I2C communications 
- VOID Return


ReadRegister

ReadRegister
Read and return the value of the RTC register at the given address 
- BYTE address
 
- BYTE Return


SetDate

SetDate
Sets the date from a string DDMMYY 
- STRING Date
 
- VOID Return


SetTime

SetTime
Sets the time from a string HHMMSS 
- STRING Time
 
- VOID Return


WriteRegister

WriteRegister
Write the given data value to the RTC register at the given address 
- BYTE address
 
- BYTE data
 
- VOID Return


Property reference

Properties
Connections
Channel
Channel selection 
SDA
Pin used for SDA (data signal) 
SDA Remap Pin
 
SCL
Pin used for SCL (clock signal) 
SCL Remap Pin
 
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.  
Baud Select
Baud rate option selector 
Baud Rate
Baud rate to be used 
Simulation
Simulate Comms