Jump to content

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

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(12 intermediate revisions by 2 users not shown)
Line 5: Line 5:
|-
|-
| width="20%" style="color:gray;" | Version
| width="20%" style="color:gray;" | Version
| 1.1
| 6.0
|-
|-
| width="20%" style="color:gray;" | Category
| width="20%" style="color:gray;" | Category
Line 15: Line 15:
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.
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.


==Component Source Code==
==Version information==
 
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ThermocoupleMCP960X.fcfx FC_Comp_Source_ThermocoupleMCP960X.fcfx]


Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ThermocoupleMCP960X.fcfx FC_Comp_Source_ThermocoupleMCP960X.fcfx]
Library Version, Component Version, Date, Author, Info
6.0, 6.0, 02-07-24, MW, As requested By Stefan. Exposed ReadRegister/s, WriteRegister and renamed with underscore. Added Write_N_Registers.


==Detailed description==
==Detailed description==
Line 83: Line 82:


[[File:Sim Demo.png]]
[[File:Sim Demo.png]]




Line 88: Line 95:
==Macro reference==
==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Initialise===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
| colspan="2" | Configures the I2C bus ready for 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''
|}
 
 
===ReadReference_Float===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
===ReadReference_Int===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadReference_Int'''
| width="90%" class="mtx-class-macrohead" | '''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. 
| 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. 
Line 101: Line 137:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ReadThermocouple_Float===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadRawDataADC'''
| width="90%" class="mtx-class-macrohead" | '''ReadThermocouple_Float'''
|-
|-
| colspan="2" | Returns the thermocouple temperature from the last sample as an integer value in Degrees C. 
| colspan="2" | Returns the thermocouple temperature from the last sample as a floating point value. Use Sample first, which samples both reference & themocouple temperatures. 
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ReadThermocouple_Int===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadReference_Float'''
| width="90%" class="mtx-class-macrohead" | '''ReadThermocouple_Int'''
|-
|-
| 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. 
| colspan="2" | 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:Fc9-f32-icon.png]] - FLOAT
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Read_N_Registers===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Read_N_Registers'''
|-
| colspan="2" | Reads a number of sequential bytes starting from the specified register 
|-
|-
| 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
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| colspan="2" |  
| 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. 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Count
|-
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Read_Register===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Read_Register'''
|-
| colspan="2" | Reads a byte from a register 
|-
|-
| 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. 
| 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-s16-icon.png]] - INT
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Sample===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadThermocouple_Float'''
| width="90%" class="mtx-class-macrohead" | '''Sample'''
|-
|-
| colspan="2" | Returns the thermocouple temperature from the last sample as a floating point value. Use Sample first, which samples both reference & themocouple temperatures. 
| 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. 
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Write_N_Registers===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Write_N_Registers'''
|-
| colspan="2" | Writes a set of data values to a sequential registers on the accelerometer 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Start_Reg
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Num_Regs
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| colspan="2" |  
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
|-
| colspan="2" | Configures the I2C bus ready for communications. 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Data
|-
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 179: Line 256:




===Write_Register===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Write_Register'''
|-
| colspan="2" | Writes a byte to a register 
|-
|-
| 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''
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Thermocouple Properties
| width="90%" class="mtx-class-propfolder" | Thermocouple Properties
|-
|-
|-
|-
Line 208: Line 307:
| colspan="2" | Select Temperature results to be celsius or  fahrenheit  
| colspan="2" | Select Temperature results to be celsius or  fahrenheit  
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | I2C Properties
| width="90%" class="mtx-class-propfolder" | I2C Properties
|-
|-
|-
|-
Line 232: Line 331:
| colspan="2" | Pin used for SCL (clock signal) 
| colspan="2" | Pin used for SCL (clock signal) 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|-
|-
Line 241: Line 340:
| colspan="2" |  
| colspan="2" |  
|}
|}
==Component Source Code==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ThermocoupleMCP960X.fcfx FC_Comp_Source_ThermocoupleMCP960X.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ThermocoupleMCP960X.fcfx FC_Comp_Source_ThermocoupleMCP960X.fcfx]

Latest revision as of 14:37, 13 July 2026

Author Matrix TSL
Version 6.0
Category Environmental


Thermocouple (MCP960X) 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.

Version information

Library Version, Component Version, Date, Author, Info
6.0, 6.0, 02-07-24, MW, As requested By Stefan. Exposed ReadRegister/s, WriteRegister and renamed with underscore. Added Write_N_Registers.

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.

MCP960X Demo

Sim Demo






Macro reference

Initialise

Initialise
Configures the I2C bus ready for communications. 
- VOID Return


ReadReference_Float

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. 
- FLOAT Return


ReadReference_Int

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. 
- INT Return


ReadThermocouple_Float

ReadThermocouple_Float
Returns the thermocouple temperature from the last sample as a floating point value. Use Sample first, which samples both reference & themocouple temperatures. 
- FLOAT Return


ReadThermocouple_Int

ReadThermocouple_Int
Returns the thermocouple temperature from the last sample as an integer value. Use Sample first, which samples both reference & themocouple temperatures. 
- INT Return


Read_N_Registers

Read_N_Registers
Reads a number of sequential bytes starting from the specified register 
- BYTE Address
 
- BYTE Data
 
- BYTE Count
 
- VOID Return


Read_Register

Read_Register
Reads a byte from a register 
- BYTE Address
 
- BYTE Return


Sample

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. 
- BYTE Return


Write_N_Registers

Write_N_Registers
Writes a set of data values to a sequential registers on the accelerometer 
- BYTE Start_Reg
 
- BYTE Num_Regs
 
- STRING Data
 
- VOID Return


Write_Register

Write_Register
Writes a byte to a register 
- BYTE Address
 
- BYTE Data
 
- VOID Return


Property reference

Properties
Thermocouple Properties
Thermocouple Type
Thermocouple type. Selects which type of thermocouple the IC works with. 
Filter Coefficients
Digitial filter selection. The higher the number the better the filter. Results more stable but take longer to update.  
Unit
Select Temperature results to be celsius or fahrenheit  
I2C Properties
Address
Address ranges 0x60 - 0x67 (96 - 103) 
Channel
Channel selection 
SDA
Pin used for SDA (data signal) 
SCL
Pin used for SCL (clock signal) 
Simulation
Simulate Comms
 

Component Source Code

Please click here to download the component source project: FC_Comp_Source_ThermocoupleMCP960X.fcfx

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