Difference between revisions of "Component: Thermocouple (MAX31855) (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.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Environmental
 
| Environmental
 
|}
 
|}
  
  
 +
==Thermocouple component==
 +
Component to interface the MAX31855 IC from MAXIM. Uses a standard 3-wire SPI interface to connect to the IC and collect the temperature. IC available in different versions to suit different thermocouple types.
  
==[[File:Component Icon 97e631c7_51d9_4482_9b65_481b390a686d.png|Image]] Thermocouple (MAX31855) component==
+
==Detailed description==
Component to interface the MAX31855 IC from MAXIM.
+
 
Uses a standard 3-wire SPI 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==
 +
 +
  
 
Example program showing how to use the Thermocouple component.
 
Example program showing how to use the Thermocouple component.
Line 27: Line 28:
 
==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 temperature from the last sample as an integer value in Degrees C.
+
|-
 +
| 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 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''
 +
|}
  
'''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;" | '''ReadReference_Float'''
 +
|-
 +
| colspan="2" | Returns the reference temperature from the last sample as a floating point 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''
 +
|}
  
  
'''Return value'''
+
{| 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" | Reads the memory of the MAX31855 IC and checks for errors. Must be called before any of the Read functions. Returns: 0=OK, 1=Open Circuit, 2=Short GND, 3=Short VCC&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''
 +
|}
  
:[[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;" | '''ReadThermocouple_Int'''
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>ReadReference_Float</tt></u></span>===
 
Returns the reference temperature from the last sample as a floating point value in Degrees C.
 
  
'''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 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;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Configures the SPI 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''
 +
|}
  
'''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;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Initialise to default of 11 bit resolution&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>Sample</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Reads the memory of the MAX31855 IC and checks for errors.
+
|-
 +
| 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''
 +
|}
  
Must be called before any of the Read functions.
 
  
Returns: 0=OK, 1=Open Circuit, 2=Short GND, 3=Short VCC
+
{| 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''
 +
|}
  
'''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]]
'''Return value'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
+
|-
:[[Variable Types|BYTE]]
+
| colspan="2" | &nbsp;
 
+
|-
 
+
|-
===<span style="font-weight: normal;"><u><tt>ReadThermocouple_Int</tt></u></span>===
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
Returns the thermocouple temperature from the last sample as an integer value in Degrees C.
+
| 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 in Degrees C.
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|FLOAT]]
 
  
  
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Configures the SPI 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;"
 
+
|-
Specified at the end of the MAX part number MAX31855X where X is the 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>Channel</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 ''cal_spi1::CHANNEL''.
+
|-
 
+
| colspan="2" | Specified at the end of the MAX part number MAX31855X where X is the Thermocouple type. Selects which type of thermocouple the IC works with.&nbsp;
SPI Channel selector
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>Prescale</u></span>
+
| width="90%" | Channel
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::PR_SCALE''.
+
| colspan="2" | SPI Channel selector&nbsp;
 
+
|-
Prescale option selector
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Prescale
<span style="font-weight: normal;"><u>MOSI Remap Pin</u></span>
+
|-
 
+
| colspan="2" | Prescale option selector&nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::MOSIPins''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
Select which the target pin to assign the MOSI hardware pin functionality.
+
| width="90%" | MOSI
 
+
|-
<span style="font-weight: normal;"><u>MOSI</u></span>
+
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.&nbsp;
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::MOSI''.
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | MISO
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.
+
|-
 
+
| colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.&nbsp;
<span style="font-weight: normal;"><u>MISO Remap Pin</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::MISOPins''.
+
| width="90%" | CLK
 
+
|-
Select which the target pin to assign the MISO hardware pin functionality.
+
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>MISO</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | CS / SS
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::MISO''.
+
|-
 
+
| colspan="2" | Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device. &nbsp;
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
<span style="font-weight: normal;"><u>CLK Remap Pin</u></span>
+
| width="90%" | Console Data
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::CLKPins''.
+
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
 
+
|-
Select which the target pin to assign the CLK hardware pin functionality.
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Scope Traces
<span style="font-weight: normal;"><u>CLK</u></span>
+
|-
 
+
| colspan="2" | Selects if the scope traces are automatically generated or not&nbsp;
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::CLK''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
SPI Clock Pin CLK - The Clock signal is driven by the SPI master.
+
| width="90%" | API
 
+
|-
<span style="font-weight: normal;"><u>CS / SS</u></span>
+
| colspan="2" | &nbsp;
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::SS''.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''  
Chip Select / Slave Select Pin  
+
|-
 
+
|-
Master Mode: General purpose output pin used to select the remote SPI device.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''  
Slave Mode: Hardware chip select pin input used to select the SPI device.
+
|-
 
+
|-
<span style="font-weight: normal;"><u>Simulate Comms</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Simulate Comms
This property is of type ''True or false'' and can be referenced with the variable name ''SimComms''.
+
|-
 
+
| colspan="2" | &nbsp;
''<span style="color:red;">No additional information</span>''
+
|}
 
 
 
 
 
 
<span style="font-weight: normal;"><u>Console Data</u></span>
 
 
 
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi1::ConsoleData''.
 
 
 
Selects if the console data is automatically generated or not
 
 
 
<span style="font-weight: normal;"><u>Scope Traces</u></span>
 
 
 
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
 
 
 
<span style="font-weight: normal;"><u>Injector</u></span>
 
 
 
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.0
Category Environmental


Thermocouple component

Component to interface the MAX31855 IC from MAXIM. Uses a standard 3-wire SPI 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

Example program showing how to use the Thermocouple component. FC6 Icon.png MAX31855_Example

Downloadable macro reference

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


Fc9-comp-macro.png ReadReference_Float
Returns the reference temperature from the last sample as a floating point value in Degrees C. 
[[File:]] - Return


Fc9-comp-macro.png Sample
Reads the memory of the MAX31855 IC and checks for errors. Must be called before any of the Read functions. Returns: 0=OK, 1=Open Circuit, 2=Short GND, 3=Short VCC 
Fc9-u8-icon.png - BYTE Return


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


Fc9-comp-macro.png ReadThermocouple_Float
Returns the thermocouple temperature from the last sample as a floating point value in Degrees C. 
[[File:]] - Return


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


Fc9-comp-macro.png Initialise
Initialise to default of 11 bit resolution 
Fc9-u8-icon.png - BYTE 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
Specified at the end of the MAX part number MAX31855X where X is the Thermocouple type. Selects which type of thermocouple the IC works with. 
Fc9-type-16-icon.png Channel
SPI Channel selector 
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png CS / SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
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