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

From Flowcode Help
Jump to navigationJump to search
Line 48: Line 48:
  
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
 +
 +
  
  
Line 206: Line 208:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  

Revision as of 12:21, 3 February 2023

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 Source Code

Please click here to download the component source project: FC_Comp_Source_temp/One_Wire_DS2482_I2C.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_temp/One_Wire_DS2482_I2C.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples





Macro reference

BusReset

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


GetDeviceCount

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


GetIDByte

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


Initialise

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


MatchROM

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


ReceiveByte

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


ScanBus

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


SkipROM

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


TransmitByte

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


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