Difference between revisions of "Component: Real Time Clock (MCP7940N) (Real Time Clock)"
From Flowcode Help
Jump to navigationJump to searchLine 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_RTC_(MCP7940N).fcfx FC_Comp_Source_RTC_(MCP7940N).fcfx] |
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_RTC_(MCP7940N).fcfx FC_Comp_Source_RTC_(MCP7940N).fcfx] | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_RTC_(MCP7940N).fcfx FC_Comp_Source_RTC_(MCP7940N).fcfx] | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 44: | Line 46: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 68: | Line 72: | ||
==Macro reference== | ==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;" | '''SetTime''' | ||
+ | |- | ||
+ | | colspan="2" | Sets the time from a string HHMMSS | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" | Time | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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;" | '''GetTime''' | ||
+ | |- | ||
+ | | colspan="2" | Returns the time as a string HHMMSS | ||
+ | |- | ||
+ | |- | ||
+ | | 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;" | '''ReadRegister''' | ||
+ | |- | ||
+ | | colspan="2" | Read and return the value of the RTC register at the given address | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | address | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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 from a string DDMMYY | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" | Date | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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;" | '''GetDate''' | ||
+ | |- | ||
+ | | colspan="2" | Returns the date as a string DDMMYY | ||
+ | |- | ||
+ | |- | ||
+ | | 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;" | '''WriteRegister''' | ||
+ | |- | ||
+ | | colspan="2" | Write the given data value to the RTC register at the given address | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | address | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | data | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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;" | '''Initialise''' | ||
+ | |- | ||
+ | | colspan="2" | Initialises the component ready for I2C communications | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==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" 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 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | SDA | ||
+ | |- | ||
+ | | colspan="2" | Pin used for SDA (data signal) | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | SDA Remap Pin | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | SCL | ||
+ | |- | ||
+ | | colspan="2" | Pin used for SCL (clock signal) | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | SCL Remap Pin | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Baud Select | ||
+ | |- | ||
+ | | colspan="2" | Baud rate option selector | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
+ | | width="90%" | Baud Rate | ||
+ | |- | ||
+ | | colspan="2" | Baud rate to be used | ||
+ | |- | ||
+ | | 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" | | ||
+ | |}==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
Revision as of 09:59, 27 January 2023
Author | Matrix TSL |
Version | 1.0 |
Category | Real Time Clock |
Contents
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
SetTime | |
Sets the time from a string HHMMSS | |
- STRING | Time |
- VOID | Return |
GetTime | |
Returns the time as a string HHMMSS | |
- STRING | Return |
ReadRegister | |
Read and return the value of the RTC register at the given address | |
- BYTE | address |
- BYTE | Return |
SetDate | |
Sets the date from a string DDMMYY | |
- STRING | Date |
- VOID | Return |
GetDate | |
Returns the date as a string DDMMYY | |
- STRING | Return |
WriteRegister | |
Write the given data value to the RTC register at the given address | |
- BYTE | address |
- BYTE | data |
- VOID | Return |
Initialise | |
Initialises the component ready for I2C communications | |
- VOID | Return |
Property reference
==Macro reference==
SetTime | |
Sets the time from a string HHMMSS | |
- STRING | Time |
- VOID | Return |
GetTime | |
Returns the time as a string HHMMSS | |
- STRING | Return |
ReadRegister | |
Read and return the value of the RTC register at the given address | |
- BYTE | address |
- BYTE | Return |
SetDate | |
Sets the date from a string DDMMYY | |
- STRING | Date |
- VOID | Return |
GetDate | |
Returns the date as a string DDMMYY | |
- STRING | Return |
WriteRegister | |
Write the given data value to the RTC register at the given address | |
- BYTE | address |
- BYTE | data |
- VOID | Return |
Initialise | |
Initialises the component ready for I2C communications | |
- VOID | Return |
Property reference
==Macro reference==
SetTime | |
Sets the time from a string HHMMSS | |
- STRING | Time |
- VOID | Return |
GetTime | |
Returns the time as a string HHMMSS | |
- STRING | Return |
ReadRegister | |
Read and return the value of the RTC register at the given address | |
- BYTE | address |
- BYTE | Return |
SetDate | |
Sets the date from a string DDMMYY | |
- STRING | Date |
- VOID | Return |
GetDate | |
Returns the date as a string DDMMYY | |
- STRING | Return |
WriteRegister | |
Write the given data value to the RTC register at the given address | |
- BYTE | address |
- BYTE | data |
- VOID | Return |
Initialise | |
Initialises the component ready for I2C communications | |
- VOID | Return |
Property reference
==Macro reference==
SetTime | |
Sets the time from a string HHMMSS | |
- STRING | Time |
- VOID | Return |
GetTime | |
Returns the time as a string HHMMSS | |
- STRING | Return |
ReadRegister | |
Read and return the value of the RTC register at the given address | |
- BYTE | address |
- BYTE | Return |
SetDate | |
Sets the date from a string DDMMYY | |
- STRING | Date |
- VOID | Return |
GetDate | |
Returns the date as a string DDMMYY | |
- STRING | Return |
WriteRegister | |
Write the given data value to the RTC register at the given address | |
- BYTE | address |
- BYTE | data |
- VOID | Return |
Initialise | |
Initialises the component ready for I2C communications | |
- VOID | Return |