Difference between revisions of "Component: Thermocouple ( MCP960X) (Environmental)"

From Flowcode Help
Jump to navigationJump to search
Line 1: Line 1:
 
+
{| style="width:50%"
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.1
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Environmental
 
| Environmental
 
|}
 
|}
  
  
 +
==Thermocouple component==
 +
Component to interface the MCP960X IC from Microchip. Uses a standard 2-wire I2C interface to connect to the IC and collect the temperature. IC available in different versions to suit different thermocouple types.
  
==[[File:Component Icon 60de8264_7faf_4f77_904e_69bb19909ba8.png|Image]] Thermocouple ( MCP960X) component==
+
==Detailed description==
Component to interface the MCP960X IC from Microchip.
+
 
Uses a standard 2-wire I2C interface to connect to the IC and collect the temperature.
+
''No detailed description exists yet for this component''
IC available in different versions to suit different thermocouple types.
 
  
 
==Examples==
 
==Examples==
 +
 +
 
Here is a basic example to display both the thermocouple temperature and IC surface temperature.
 
Here is a basic example to display both the thermocouple temperature and IC surface temperature.
  
Line 30: Line 32:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===<span style="font-weight: normal;"><u><tt>ReadReference_Int</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Returns the Reference (IC die) temperature from the last sample as an integer value.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadReference_Int'''
 +
|-
 +
| colspan="2" | Returns the Reference (IC die) temperature from the last sample as an integer value. Use Sample first, which samples both reference & themocouple temperatures.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
Use Sample first, which samples both reference & themocouple temperatures.
 
  
'''Parameters'''
+
{| 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;" | '''ReadRawDataADC'''
 +
|-
 +
| colspan="2" | Returns the thermocouple temperature from the last sample as an integer value in Degrees C.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This macro has no parameters''
 
  
 +
{| 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;" | '''ReadReference_Float'''
 +
|-
 +
| colspan="2" | Returns the reference (IC die) temperature from the last sample as a floating point. Use Sample first, which samples both reference & themocouple temperatures.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|INT]]
+
{| 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;" | '''Sample'''
 +
|-
 +
| colspan="2" | Must be called before any of the Read functions. Reads the memory of the MCP9600/1 IC. Returns 0 for 9600. Checks for errors, MCP9601 only.  Returns: 0 = OK, 1 = O/ C Themocouple & 2=S/C Themocouple.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>ReadReference_Float</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Returns the reference (IC die) temperature from the last sample as a floating point.
+
|-
 +
| 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" | Reads a byte from a register&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Address
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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''
 +
|}
  
Use Sample first, which samples both reference & themocouple temperatures.
 
  
'''Parameters'''
+
{| 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;" | '''ReadThermocouple_Int'''
 +
|-
 +
| colspan="2" | Returns the thermocouple temperature from the last sample as an integer value. Use Sample first, which samples both reference & themocouple temperatures.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This macro has no parameters''
 
  
 +
{| 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;" | '''ReadThermocouple_Float'''
 +
|-
 +
| colspan="2" | Returns the thermocouple temperature from the last sample as a floating point value. Use Sample first, which samples both reference & themocouple temperatures.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|FLOAT]]
+
{| 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" | Writes a byte to a register&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Address
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>Sample</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Must be called before any of the Read functions.
+
|-
 +
| 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" | Configures the I2C bus ready for communications.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
Reads the memory of the MCP9600/1 IC. Returns 0 for 9600. Checks for errors, MCP9601 only.
 
  
Returns: 0 = OK, 1 = O/ C Themocouple & 2=S/C Themocouple.
+
{| 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" | Configures each matching sensor on the bus with the specified conversion bits.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
{| 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" | A simple example showing a generic way to write a register using I2C.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Address
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
:[[Variable Types|BYTE]]
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
+
|-
===<span style="font-weight: normal;"><u><tt>ReadThermocouple_Int</tt></u></span>===
+
| colspan="2" | &nbsp;
Returns the thermocouple temperature from the last sample as an integer value.
+
|-
 
+
|-
Use Sample first, which samples both reference & themocouple temperatures.
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
'''Parameters'''
+
|}
  
:''This macro has no parameters''
 
  
 
'''Return value'''
 
 
:[[Variable Types|INT]]
 
 
 
===<span style="font-weight: normal;"><u><tt>ReadThermocouple_Float</tt></u></span>===
 
Returns the thermocouple temperature from the last sample as a floating point value.
 
 
Use Sample first, which samples both reference & themocouple temperatures.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|FLOAT]]
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Configures the I2C bus ready for communications.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
 
==Simulation macro reference==
 
 
''This component does not contain any simulation macros''
 
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Thermocouple Type</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''ThermocoupleType''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Thermocouple type.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
Selects which type of thermocouple the IC works with.
+
|-
 
+
|-
<span style="font-weight: normal;"><u>Filter Coefficients</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Thermocouple Type
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''FilterCoef''.
+
|-
 
+
| colspan="2" | Thermocouple type. Selects which type of thermocouple the IC works with.&nbsp;
Digitial filter selection.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
The higher the number the better the filter.
+
| width="90%" | Filter Coefficients
 
+
|-
Results more stable but take longer to update.
+
| colspan="2" | Digitial filter selection. The higher the number the better the filter. Results more stable but take longer to update. &nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Unit</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Unit
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Unit''.
+
|-
 
+
| colspan="2" | Select Temperature results to be celsius or  fahrenheit &nbsp;
Select Temperature results to be celsius or  fahrenheit
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
<span style="font-weight: normal;"><u>Address</u></span>
+
| width="90%" | Address
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''Address''.
+
| colspan="2" | Address ranges 0x60 - 0x67 (96 - 103)&nbsp;
 
+
|-
Address ranges 0x60 - 0x67 (96 - 103)
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Channel
<span style="font-weight: normal;"><u>Channel</u></span>
+
|-
 
+
| colspan="2" | Channel selection&nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_i2c1::CHANNEL''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
Channel selection
+
| width="90%" | SDA
 
+
|-
<span style="font-weight: normal;"><u>SDA</u></span>
+
| colspan="2" | Pin used for SDA (data signal)&nbsp;
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_i2c1::SDA''.
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | SCL
Pin used for SDA (data signal)
+
|-
 
+
| colspan="2" | Pin used for SCL (clock signal)&nbsp;
<span style="font-weight: normal;"><u>SCL</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_i2c1::SCL''.
+
| width="90%" | Console Data
 
+
|-
Pin used for SCL (clock signal)
+
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Simulate Comms</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Scope Traces
This property is of type ''True or false'' and can be referenced with the variable name ''SimComms''.
+
|-
 
+
| colspan="2" | Selects if the scope traces are automatically generated or not&nbsp;
''<span style="color:red;">No additional information</span>''
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | API
 
+
|-
<span style="font-weight: normal;"><u>Console Data</u></span>
+
| colspan="2" | &nbsp;
 
+
|-
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi1::ConsoleData''.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''  
Selects if the console data is automatically generated or not
+
|-
 
+
|-
<span style="font-weight: normal;"><u>Scope Traces</u></span>
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi1::ScopeTraces''.
+
|-
 
+
|-
Selects if the scope traces are automatically generated or not
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Simulate Comms
<span style="font-weight: normal;"><u>API</u></span>
+
|-
 
+
| colspan="2" | &nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::Injector''.
+
|}
 
 
''<span style="color:red;">No additional information</span>''
 

Revision as of 20:47, 16 November 2021

Author Matrix TSL
Version 1.1
Category Environmental


Thermocouple component

Component to interface the MCP960X IC from Microchip. Uses a standard 2-wire I2C interface to connect to the IC and collect the temperature. IC available in different versions to suit different thermocouple types.

Detailed description

No detailed description exists yet for this component

Examples

Here is a basic example to display both the thermocouple temperature and IC surface temperature.

FC6 Icon.png MCP960X Demo

Sim Demo

Sim Demo.png

Downloadable macro reference

Fc9-comp-macro.png ReadReference_Int
Returns the Reference (IC die) temperature from the last sample as an integer value. Use Sample first, which samples both reference & themocouple temperatures. 
[[File:]] - Return


Fc9-comp-macro.png ReadRawDataADC
Returns the thermocouple temperature from the last sample as an integer value in Degrees C. 
[[File:]] - Return


Fc9-comp-macro.png ReadReference_Float
Returns the reference (IC die) temperature from the last sample as a floating point. Use Sample first, which samples both reference & themocouple temperatures. 
[[File:]] - Return


Fc9-comp-macro.png Sample
Must be called before any of the Read functions. Reads the memory of the MCP9600/1 IC. Returns 0 for 9600. Checks for errors, MCP9601 only. Returns: 0 = OK, 1 = O/ C Themocouple & 2=S/C Themocouple. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReadRegister
Reads a byte from a register 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReadThermocouple_Int
Returns the thermocouple temperature from the last sample as an integer value. Use Sample first, which samples both reference & themocouple temperatures. 
[[File:]] - Return


Fc9-comp-macro.png ReadThermocouple_Float
Returns the thermocouple temperature from the last sample as a floating point value. Use Sample first, which samples both reference & themocouple temperatures. 
[[File:]] - Return


Fc9-comp-macro.png WriteRegister
Writes a byte to a register 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


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


Fc9-comp-macro.png Initialise
Configures each matching sensor on the bus with the specified conversion bits. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png WriteRegister
A simple example showing a generic way to write a register using I2C. 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
 
[[File:]] - Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Thermocouple Type
Thermocouple type. Selects which type of thermocouple the IC works with. 
Fc9-type-16-icon.png Filter Coefficients
Digitial filter selection. The higher the number the better the filter. Results more stable but take longer to update.  
Fc9-type-16-icon.png Unit
Select Temperature results to be celsius or fahrenheit  
Fc9-type-21-icon.png Address
Address ranges 0x60 - 0x67 (96 - 103) 
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-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 scope traces are automatically generated or not 
Fc9-type-16-icon.png API
 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations
Fc9-type-7-icon.png Simulate Comms