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.
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Downloadable macro reference
|
ReceiveByte
|
Receives a byte from the one wire bus a bit at a time
|
- BYTE
|
Return
|
|
TransmitByte
|
Transmit a byte to the one wire bus a bit at a time
|
- BYTE
|
Command
|
|
- VOID
|
Return
|
|
SkipROM
|
Performs a bus reset and the sends the SkipROM command byte
|
- VOID
|
Return
|
|
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
|
[[File:]] -
|
Return
|
|
MatchROM
|
Performs a reset followed by the MatchROM code and then the 8-bit ROM code.
|
- BYTE
|
FamilyCode
|
|
- BYTE
|
SerialNumber
|
|
- VOID
|
Return
|
|
ScanBus
|
Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found.
|
- BYTE
|
Return
|
|
GetDeviceCount
|
Returns the number of devices found by the last ScanBus operation.
|
- BYTE
|
Return
|
|
GetIDByte
|
Returns byte ectet of the 64-Bit lasered ROM code, 255 on error
|
- BYTE
|
Device
|
Device ID - Range: 0 - NumDevices - 1
|
- BYTE
|
ByteIndex
|
Index of the data byte. 0=FamilyCode, 1-6=Serial, 7=CRC
|
- BYTE
|
Return
|
|
Initialise
|
|
- VOID
|
Return
|
|
GetDeviceCount
|
Returns the number of devices found by the last ScanBus operation.
|
- BYTE
|
Return
|
|
GetIDByte
|
Returns byte ectet of the 64-Bit lasered ROM code, 255 on error
|
- BYTE
|
Device
|
Device ID - Range: 0 - NumDevices - 1
|
- BYTE
|
ByteIndex
|
Index of the data byte. 0=FamilyCode, 1-6=Serial, 7=CRC
|
- BYTE
|
Return
|
|
Initialise
|
Sets up the 1-Wire output pin ready for communications.
|
- VOID
|
Return
|
|
SetAnalogInput
|
Sets the state of a single analogue input.
|
- UINT
|
Address
|
Coil Address
|
- UINT
|
Value
|
Analogue Value range 0 - 65535
|
- VOID
|
Return
|
|
Initialise
|
Starts up the UART to allow communications and initialises the states of the various Modbus Coils, Inputs and Registers to 0.
|
- VOID
|
Return
|
|
Initialise
|
Initialises the MIDI component and sets up the UART.
|
- VOID
|
Return
|
|
CommsBaud
|
Sets the Baud rate of the alt communications channel
|
- BYTE
|
Baud
|
Range: 0-7 : 0=1200 / 7=115200
|
- VOID
|
Return
|
|
LCDOptions
|
Controls some of the LCD options
|
- BYTE
|
Foreground
|
Range: 0-1
|
- BYTE
|
Background
|
Range: 0-1
|
- BYTE
|
Transparent
|
Range: 0-1
|
- VOID
|
Return
|
|
LCDVerbose
|
Controls the Verbose mode. When enabled the LCD automatically displays an account of the incoming API commands and parameters. When switched off the LCD is free for the user to control as required.
|
- BYTE
|
Mode
|
Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode
|
- VOID
|
Return
|
|
ReadDigitalInput
|
Reads a single digital input.
|
- BYTE
|
Channel
|
|
- BYTE
|
Return
|
|
PWMConfig
|
Sets the PWM configuration. Channel = 0 - 1 : 0 = EN_AB, A, B / 1 = EN_CD, C, D Period = 0 - 65535 Scaler = 0 - 3 : 0=1:1 1=1:8 2=1:64 3=1:256
|
- BYTE
|
Channel
|
Range 0-1
|
- UINT
|
Period
|
Range: 0-65535
|
- BYTE
|
Scaler
|
Range: 0-3
|
- VOID
|
Return
|
|
PWMEnable
|
Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD
|
- BYTE
|
EnableMask
|
Range 0-63 or 0b00000 to 0b111111
|
- VOID
|
Return
|
|
PWMDuty
|
Sets a single PWM channel duty. Channel = 0 - 5 : 0=EN_AB, 1=A, 2=B, 3=C, 4=D, 5=EN_CD Duty = 0 - 65535
|
- BYTE
|
Channel
|
Range 0-5
|
- UINT
|
Duty
|
|
- VOID
|
Return
|
|
LCDCursor
|
Sets the cursor position for the MIAC display
|
- BYTE
|
X
|
Range: 0-21
|
- BYTE
|
Y
|
Range: 0-4
|
- VOID
|
Return
|
|
WriteTran
|
Allows a single transistor output to be switched on or off.
|
- BYTE
|
Channel
|
Range 1-4
|
- BYTE
|
Value
|
0 = Off, 1 = On
|
- VOID
|
Return
|
|
Initialise
|
|
- VOID
|
Return
|
|
LCDClear
|
Clears the MIAC display
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
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
|
|
Device Address
|
|
|
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.
|
|
Baud Select
|
Baud rate option selector
|
|
Baud Rate
|
Baud rate to be used
|
|
Scope Traces
|
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
|
Selects if the console data is automatically generated or not
|
|
API
|
Specifies the injector component on the panel to interact with to provide comms simulation.
|
|
Connections
|
|
Channel
|
Channel selection
|
|
SDA
|
Pin used for SDA (data signal)
|
|
SCL
|
Pin used for SCL (clock signal)
|
|
Simulations
|
|
Simulate Comms
|
|