Component: One Wire (DS2482) (Comms: Interface)
Author | MatrixTSL |
Version | 1.0 (Release) |
Category | Comms: Interface |
Contents
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.
Examples
No additional examples
Downloadable macro reference
ReceiveByte
Receives a byte from the one wire bus a bit at a time
Parameters
- This macro has no parameters
Return value
TransmitByte
Transmit a byte to the one wire bus a bit at a time
Parameters
- BYTE Command
Return value
- This call does not return a value
SkipROM
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
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
Parameters
- This macro has no parameters
Return value
- BOOL : Returns true if the operation is a success, else false
MatchROM
Performs a reset followed by the MatchROM code and then the 8-bit ROM code.
Parameters
- BYTE FamilyCode
- BYTE SerialNumber
Return value
- This call does not return a value
ScanBus
Scans the one wire bus to detect all connected devices.
Returns the number of one wire devices found.
Parameters
- This macro has no parameters
Return value
GetDeviceCount
Returns the number of devices found by the last ScanBus operation.
Parameters
- This macro has no parameters
Return value
GetIDByte
Returns byte ectet of the 64-Bit lasered ROM code, 255 on error
Parameters
- BYTE Device
- Device ID - Range: 0 - NumDevices - 1
- BYTE ByteIndex
- Index of the data byte. 0=FamilyCode, 1-6=Serial, 7=CRC
Return value
Initialise
No additional information
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
Max Devices
This property is of type Unsigned integer and can be referenced with the variable name BufferSize.
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
Device Address
This property is of type Fixed list of ints and can be referenced with the variable name DevAddress.
No additional information
Channel
This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::CHANNEL.
Channel selection
SDA
This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SDA.
Pin used for SDA (data signal)
SCL
This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SCL.
Pin used for SCL (clock signal)
Stop Delay
This property is of type True or false and can be referenced with the variable name cal_i2c1::StopDel.
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.
Baud Select
This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::BAUD_LIST.
Baud rate option selector
Baud Rate
This property is of type Signed integer and can be referenced with the variable name cal_i2c1::BAUD.
Baud rate to be used
Simulate Comms
This property is of type True or false and can be referenced with the variable name SimComms.
No additional information
Scope Traces
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.
Console Data
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
Injector
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.