www.vtiinstruments.com
APPENDIX C
93
M
ICRO
LAN
(MLAN)
I
NTRODUCTION
The MicroLAN specification details five major functions that are the centerpiece of any operations
involving TEDS devices. These five functions are:
•
Read serial/URN from device (GET_URN)
•
Write to volatile memory scratchpad (READ_SCRATCHPAD)
•
Read from volatile memory scratchpad (WRITE_SCRATCHPAD)
•
Copy volatile scratchpad to nonvolatile memory (COPY_SCRATCHPAD)
•
Read from non-volatile memory (READ_MEMORY)
The GET_URN command is a vital precursor to any of the other four operations. If the URN of the
TEDS (1-wire) device is not queried before the other operations are called, these operations will
fail.
In general, there can be multiple 1-wire devices per 1-wire bus master (MLAN repeater) and the
MLAN responder in the unit holds the state of the device being addressed. To interact with a 1-wire
device, the URN of the device is used as an address, allowing a single device to be selected. Each
channel on the instrument has a 1-wire bus master. Under typical operation on the instrument, only
a single 1-wire device will be connected to each channel.
The GET_URN function is designed to identify a single 1-wire TEDS device and return its unique
64-bit URN value. Sample code for how this function is implemented is provided. A variant of the
GET_URN function can be used to search through multiple devices in order to select a specific
device, but the example version of this function only supports one device per channel.
Once the 1-wire device has been addressed, the MLAN responder will store its address, and it will
not need to be referenced again until it is necessary to change devices. Any of the other commands
can now be used to view or change data.
The READ_MEMORY function is probably the most commonly used MLAN command. It allows
the user to query the non-volatile memory of any 1-wire device and read back its contents. For some
devices, notably the DS2431, the READ_MEMORY function may return multiple MLAN packets.
The “scratchpad” is a volatile buffer on a 1-wire device where data is written before it is copied to
memory. In order to write data to the main memory, it must first be written to the scratchpad. After
writing to the scratchpad, the data can then be copied to the main memory.
WARNING
The scratchpad will be erased if you unplug your MLAN device, power off the instrument, or wait
a significant amount of time between commands.
VTI Instruments recommends performing
scratchpad operations in a production environment using the “write_and_copy” atomic command
which is discussed in detail later.
The WRITE_SCRATCHPAD command can be used to write arbitrary data to the scratchpad of a
1-wire device. Unlike the GET_URN function, WRITE_SCRATCHPAD (and all other MLAN)
functions are specific to the type of MLAN device being used. In the example code,
write_scratchpad_2430() and write_scratchpad_2431() functions are used to represent the
differences between the DS2430 and DS2431 devices. Be careful of the size differences between
various devices’ scratchpad buffers. In the case of the DS2431, 8 bytes of data, aligned on an 8-byte
address, must be written together - that is, all memory writes involve 8 bytes. To modify a single
byte of memory requires that the 8-byte block be read back from the device, the byte in question
Содержание EMX-4016B
Страница 6: ......
Страница 7: ...www vtiinstruments com Introduction 7 ...
Страница 83: ...www vtiinstruments com APPENDIX B 83 Figure 4 429 EMX 4016B Break Out Box Figure 4 30 EMX 4016M Break Out Box ...
Страница 84: ...VTI Instruments Corp APPENDIX B 84 Figure 4 31 EMX4016B Outline Drawing Figure 4 32 Drawing Represent ...
Страница 116: ......