VTI Instruments Corp.
336
EX1629 Onboard Memory
While it could be arranged for this example code to stop returning data once the end of the
memory is reached, the code would be significantly harder to read, and, therefore, it is up to the
user to determine where their memory ends. The example code is intended to be a starting point.
The READ_MEMORY output for this device is very long, as 144 bytes of data must be returned:
sent packet without errors
Packet length: 9
08 82 0A 04 22 F0 00 00 85
got a packet without errors on receive
Packet length: 39
26 82 00 0A 22 F0 00 00 AA 02 03 04 05 06 07 08 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
sent packet without errors
Packet length: 9
08 82 0A 04 22 F0 20 00 85
got a packet without errors on receive
Packet length: 39
26 82 00 0A 22 F0 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
sent packet without errors
Packet length: 9
08 82 0A 04 22 F0 40 00 85
got a packet without errors on receive
Packet length: 39
26 82 00 0A 22 F0 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
sent packet without errors
Packet length: 9
08 82 0A 04 22 F0 60 00 85
got a packet without errors on receive
Packet length: 39
26 82 00 0A 22 F0 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
sent packet without errors
Packet length: 9
08 82 0A 04 22 F0 80 00 85
got a packet without errors on receive
Packet length: 39
26 82 00 0A 22 F0 80 00 00 00 00 00 00 55 00 00 00 00 00 00 00 00 02
0C FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
This device is empty except for the 8 bytes written in the example, so there are many empty
segments. Notice the “55” near the end of the device – many of the registers near the end of
memory control advanced uses of the device, such as write-protecting data. Please refer to the
DS2431 data sheet for more information on the device features.
WRITE_AND_COPY_SCRATCHPAD_2431
Like all 1-Wire devices, the DS2431 chips are powered down between MLAN commands on the
EX1629. This can cause the volatile scratchpads to lose data, and, as such, the individual
WRITE_SCRATCHPAD and COPY_SCRATCHPAD commands are only recommended for
demonstration purposes.
The combined WRITE_AND_COPY command set issues a single MLAN buffer and has the
advantage if being an atomic operation, meaning the device will not lose data in the middle. The
disadvantage is that data verification is not possible until after the write has occurred.
int write_and_copy_scratchpad_2431(const char* data, int channel, int
address)
{