Difference between revisions of "Component: One Wire (DS2482) (Comms: Interface)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| MatrixTSL
 
| MatrixTSL
 
|-
 
|-
| 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
 
| Comms: Interface
 
| Comms: Interface
 
|}
 
|}
  
  
 +
==One Wire (DS2482) component==
 +
A One Wire master transciever controlled using I2C comms. Useful for microcontroller devices where One Wire communications timings are too tight to do reliably.
  
==[[File:Component Icon 55831e22_7885_4e0f_a9de_73ebda9d7fe9.png|Image]] One Wire (DS2482) component==
+
==Component Pack==
A One Wire master transciever controlled using I2C comms.
 
Useful for microcontroller devices where One Wire communications timings are too tight to
 
do reliably.
 
  
==Examples==
+
FREE
''<span style="color:red;">No additional examples</span>''
 
  
 +
==Detailed description==
  
==Downloadable macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>ReceiveByte</tt></u></span>===
 
Receives a byte from the one wire bus a bit at a time
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
 
  
  
===<span style="font-weight: normal;"><u><tt>TransmitByte</tt></u></span>===
 
Transmit a byte to the one wire bus a bit at a time
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Command''
+
''No detailed description exists yet for this component''
  
 +
==Examples==
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>SkipROM</tt></u></span>===
 
Performs a bus reset and the sends the SkipROM command byte
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>BusReset</tt></u></span>===
 
Issue a 'ping' on the bus. If there is at least one sensor on the bus then it will generate a presence pulse.
 
  
 +
''<span style="color:red;">No additional examples</span>''
  
  
Returns 0 if a presense pulse was detected
+
==Downloadable macro reference==
  
Returns 1 no device was detected
+
{| 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;" | '''ReceiveByte'''
 +
|-
 +
| colspan="2" | Receives a byte from the one wire bus a bit at a time&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''
 +
|}
  
'''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;" | '''TransmitByte'''
 +
|-
 +
| colspan="2" | Transmit a byte to the one wire bus a bit at a time&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Command
 +
|-
 +
| 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;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SkipROM'''
 +
|-
 +
| colspan="2" | Performs a bus reset and the sends the SkipROM command byte&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''
 +
|}
  
:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false
 
  
 +
{| 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;" | '''BusReset'''
 +
|-
 +
| colspan="2" | Issue a 'ping' on the bus. If there is at least one sensor on the bus then it will generate a presence pulse.  Returns 0 if a presense pulse was detected Returns 1 no device was detected&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>MatchROM</tt></u></span>===
 
Performs a reset followed by the MatchROM code and then the 8-bit ROM code.
 
  
'''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;" | '''MatchROM'''
 +
|-
 +
| colspan="2" | Performs a reset followed by the MatchROM code and then the 8-bit ROM code.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | FamilyCode
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | SerialNumber
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]] ''FamilyCode''
 
  
:[[Variable Types|BYTE]] ''SerialNumber''
+
{| 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;" | '''ScanBus'''
 +
|-
 +
| colspan="2" | Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found.&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''
 +
|}
  
  
'''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;" | '''GetDeviceCount'''
 +
|-
 +
| colspan="2" | Returns the number of devices found by the last ScanBus operation.&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''
 +
|}
  
:''This call does not return a 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;" | '''GetIDByte'''
 +
|-
 +
| colspan="2" | Returns byte ectet of the 64-Bit lasered ROM code, 255 on error&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Device
 +
|-
 +
| colspan="2" | Device ID - Range: 0 - NumDevices - 1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ByteIndex
 +
|-
 +
| colspan="2" | Index of the data byte. 0=FamilyCode, 1-6=Serial, 7=CRC&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>ScanBus</tt></u></span>===
 
Scans the one wire bus to detect all connected devices.
 
  
Returns the number of one wire devices found.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
'''Parameters'''
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
:''This macro has no parameters''
+
|-
 
+
| colspan="2" | &nbsp;
 
+
|-
'''Return value'''
+
|-
 
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
:[[Variable Types|BYTE]]
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
+
|}
 
 
===<span style="font-weight: normal;"><u><tt>GetDeviceCount</tt></u></span>===
 
Returns the number of devices found by the last ScanBus operation.
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>GetIDByte</tt></u></span>===
 
Returns byte ectet of the 64-Bit lasered ROM code, 255 on error
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BYTE]] ''Device''
 
::Device ID - Range: 0 - NumDevices - 1
 
 
 
:[[Variable Types|BYTE]] ''ByteIndex''
 
::Index of the data byte. 0=FamilyCode, 1-6=Serial, 7=CRC
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
'''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>Max Devices</u></span>
 
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''BufferSize''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Controls the maximum number of devices that can be detected during a ScanBus.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
For each additional device we require 8 bytes to store the ROM ID.
+
|-
 
+
|-
Default: 8 = 64 Bytes of RAM
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Max Devices
<span style="font-weight: normal;"><u>Device Address</u></span>
+
|-
 
+
| colspan="2" | Controls the maximum number of devices that can be detected during a ScanBus. For each additional device we require 8 bytes to store the ROM ID. Default: 8 = 64 Bytes of RAM&nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''DevAddress''.
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
''<span style="color:red;">No additional information</span>''
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | I2C Properties
 
+
|-
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>Channel</u></span>
+
| width="90%" | Device Address
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_i2c1::CHANNEL''.
+
| colspan="2" | &nbsp;
 
+
|-
Channel selection
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
<span style="font-weight: normal;"><u>SDA</u></span>
+
|-
 
+
|-
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-16-icon.png]]
 
+
| width="90%" | Channel
Pin used for SDA (data signal)
+
|-
 
+
| colspan="2" | Channel selection&nbsp;
<span style="font-weight: normal;"><u>SCL</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_i2c1::SCL''.
+
| width="90%" | SDA
 
+
|-
Pin used for SCL (clock signal)
+
| colspan="2" | Pin used for SDA (data signal)&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Stop Delay</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | SCL
This property is of type ''True or false'' and can be referenced with the variable name ''cal_i2c1::StopDel''.
+
|-
 
+
| colspan="2" | Pin used for SCL (clock signal)&nbsp;
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
a 10ms delay between an I2C stop event and the next I2C start event.
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Options
 
+
|-
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  
+
| width="90%" | Stop Delay
 
+
|-
I2C communications.
+
| 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. &nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Baud Select</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Baud Select
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_i2c1::BAUD_LIST''.
+
|-
 
+
| colspan="2" | Baud rate option selector&nbsp;
Baud rate option selector
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
<span style="font-weight: normal;"><u>Baud Rate</u></span>
+
| width="90%" | Baud Rate
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''cal_i2c1::BAUD''.
+
| colspan="2" | Baud rate to be used&nbsp;
 
+
|-
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
<span style="font-weight: normal;"><u>Simulate Comms</u></span>
+
|-
 
+
|-
This property is of type ''True or false'' and can be referenced with the variable name ''SimComms''.
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Simulate Comms
''<span style="color:red;">No additional information</span>''
+
|-
 
+
| colspan="2" | &nbsp;
 
+
|}
 
 
<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_i2c1::ScopeTraces''.
 
 
 
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.
 
 
 
<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_i2c1::ConsoleData''.
 
 
 
Selects if the console data is 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_i2c1::Injector''.
 
 
 
Specifies the injector component on the panel to interact with to provide comms simulation.
 

Latest revision as of 17:21, 9 November 2022

Author MatrixTSL
Version 1.0
Category Comms: Interface


One Wire (DS2482) component

A One Wire master transciever controlled using I2C comms. Useful for microcontroller devices where One Wire communications timings are too tight to do reliably.

Component Pack

FREE

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

Fc9-comp-macro.png ReceiveByte
Receives a byte from the one wire bus a bit at a time 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png TransmitByte
Transmit a byte to the one wire bus a bit at a time 
Fc9-u8-icon.png - BYTE Command
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SkipROM
Performs a bus reset and the sends the SkipROM command byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png BusReset
Issue a 'ping' on the bus. If there is at least one sensor on the bus then it will generate a presence pulse. Returns 0 if a presense pulse was detected Returns 1 no device was detected 
Fc9-bool-icon.png - BOOL Return


Fc9-comp-macro.png MatchROM
Performs a reset followed by the MatchROM code and then the 8-bit ROM code. 
Fc9-u8-icon.png - BYTE FamilyCode
 
Fc9-u8-icon.png - BYTE SerialNumber
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ScanBus
Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetDeviceCount
Returns the number of devices found by the last ScanBus operation. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetIDByte
Returns byte ectet of the 64-Bit lasered ROM code, 255 on error 
Fc9-u8-icon.png - BYTE Device
Device ID - Range: 0 - NumDevices - 1 
Fc9-u8-icon.png - BYTE ByteIndex
Index of the data byte. 0=FamilyCode, 1-6=Serial, 7=CRC 
Fc9-u8-icon.png - BYTE Return


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



Property reference

Fc9-prop-icon.png Properties
Fc9-type-21-icon.png Max Devices
Controls the maximum number of devices that can be detected during a ScanBus. For each additional device we require 8 bytes to store the ROM ID. Default: 8 = 64 Bytes of RAM 
Fc9-conn-icon.png I2C Properties
Fc9-type-16-icon.png Device Address
 
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-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-conn-icon.png Options
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 Simulation
Fc9-type-7-icon.png Simulate Comms