Difference between revisions of "Component: Real Time Clock (MCP7940N) (Storage)"

From Flowcode Help
Jump to navigationJump to search
(Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...")
 
Line 16: Line 16:
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
 
''No detailed description exists yet for this component''
 
''No detailed description exists yet for this component''
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 590: Line 594:
 
|-
 
|-
 
| colspan="2" | Clears the MIAC display 
 
| colspan="2" | Clears the MIAC display 
 +
|-
 +
|-
 +
| 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;" | '''LCDClear'''
 +
|-
 +
| colspan="2" | Clears the LCD 
 
|-
 
|-
 
|-
 
|-

Revision as of 10:37, 17 November 2021

Author Matrix TSL
Version 1.0
Category Storage


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.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

Fc9-comp-macro.png SetTime
Sets the time from a string HHMMSS 
Fc9-string-icon.png - STRING Time
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetTime
Returns the time as a string HHMMSS 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png ReadRegister
Read and return the value of the RTC register at the given address 
Fc9-u8-icon.png - BYTE address
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetDate
Sets the date from a string DDMMYY 
Fc9-string-icon.png - STRING Date
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetDate
Returns the date as a string DDMMYY 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png WriteRegister
Write the given data value to the RTC register at the given address 
Fc9-u8-icon.png - BYTE address
 
Fc9-u8-icon.png - BYTE data
 
Fc9-void-icon.png - VOID Return


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


Fc9-comp-macro.png ReceiveHexNumber
Attempts to receive a hex number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none hexadecimal char is received, the none numeric char will be lost. 
Fc9-u8-icon.png - BYTE Timeout
Max time in ms to wait in between bytes 
[[File:]] - IgnoreData
0=Dont ignore any data, 1=Ignore any initial none numeric data 
[[File:]] - Prefix
Look for prefix before receiving, 1=0xFF, 0=FF 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png SendBinary32Bit
Sends out a 32-bit binary value split across four bytes. 
Fc9-u32-icon.png - ULONG Value
 
[[File:]] - MSBfirst
0=Least significant byte first, 1=Most significant byte first 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SendBinaryFloat
Sends out a 32-bit binary floating point value split across four bytes. 
[[File:]] - Value
 
[[File:]] - MSBfirst
0=Least significant byte first, 1=Most significant byte first 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReceiveByteArray
Receives an array of bytes and returns the number of bytes received. 
Fc9-u8-icon.png - BYTE Data
Array to store the incoming data 
Fc9-u8-icon.png - BYTE NumBytes
Maximum number of bytes to try and receive 
Fc9-u8-icon.png - BYTE Timeout
Max amount of time in ms to wait between bytes 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReceiveString
Attempts to receive a string of bytes from the UART interface. 
Fc9-u8-icon.png - BYTE Timeout
Time to wait in milliseconds for valid data before returning, 0=Dont wait, 255=Wait forever. 
Fc9-u16-icon.png - UINT NumBytes
The number of bytes to try and receive, ideally your string variable should have at least 1 more byte to store the null termination byte 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png Initialise
Sets up the RS232 peripheral, must be called at the start of your program or at least before you start calling any other RS232 macros. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReceiveChar
Attempts to receive a single packet from the UART interface. 
Fc9-u8-icon.png - BYTE Timeout
Time to wait in milliseconds for valid data before returning, 0=Dont wait, 255=Wait forever. 
[[File:]] - Return


Fc9-comp-macro.png ReceiveString
Puts the RF module in data mode and attempts to receive a string of bytes from the RF connection. 
Fc9-u8-icon.png - BYTE Length
Specifies the maximum number of bytes to try and receive 
Fc9-u8-icon.png - BYTE Timeout
Specifies how many milliseconds to wait for valid data before returning. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png Initialise
Starts up and configures the RF module ready for use. The macro will return a value greater then 0 if the module has been started correctly, otherwise the macro will return a 0. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Initialise
Sets up the 1-Wire output pin ready for communications. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Starts up the UART to allow communications and initialises the states of the various Modbus Coils, Inputs and Registers to 0. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Initialises the MIDI component and sets up the UART. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CommsBaud
Sets the Baud rate of the alt communications channel 
Fc9-u8-icon.png - BYTE Baud
Range: 0-7 : 0=1200 / 7=115200 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDOptions
Controls some of the LCD options 
Fc9-u8-icon.png - BYTE Foreground
Range: 0-1 
Fc9-u8-icon.png - BYTE Background
Range: 0-1 
Fc9-u8-icon.png - BYTE Transparent
Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDVerbose
Controls the Verbose mode. When enabled the LCD automatically displays an account of the incoming API commands and parameters. When switched off the LCD is free for the user to control as required. 
Fc9-u8-icon.png - BYTE Mode
Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadDigitalInput
Reads a single digital input. 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png PWMConfig
Sets the PWM configuration. Channel = 0 - 1 : 0 = EN_AB, A, B / 1 = EN_CD, C, D Period = 0 - 65535 Scaler = 0 - 3 : 0=1:1 1=1:8 2=1:64 3=1:256 
Fc9-u8-icon.png - BYTE Channel
Range 0-1 
Fc9-u16-icon.png - UINT Period
Range: 0-65535 
Fc9-u8-icon.png - BYTE Scaler
Range: 0-3 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PWMEnable
Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD 
Fc9-u8-icon.png - BYTE EnableMask
Range 0-63 or 0b00000 to 0b111111 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PWMDuty
Sets a single PWM channel duty. Channel = 0 - 5 : 0=EN_AB, 1=A, 2=B, 3=C, 4=D, 5=EN_CD Duty = 0 - 65535 
Fc9-u8-icon.png - BYTE Channel
Range 0-5 
Fc9-u16-icon.png - UINT Duty
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDCursor
Sets the cursor position for the MIAC display 
Fc9-u8-icon.png - BYTE X
Range: 0-21 
Fc9-u8-icon.png - BYTE Y
Range: 0-4 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png WriteTran
Allows a single transistor output to be switched on or off. 
Fc9-u8-icon.png - BYTE Channel
Range 1-4 
Fc9-u8-icon.png - BYTE Value
0 = Off, 1 = On 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDClear
Clears the MIAC display 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDClear
Clears the LCD 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
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-16-icon.png API
 
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-16-icon.png SDA Remap Pin
 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png SCL Remap Pin
 
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-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-conn-icon.png Simulations
Fc9-type-7-icon.png Simulate Comms