User manual

Appendix B Programmable Configurations
VXI-MXI-2 User Manual B-2 © National Instruments Corporation
After all changes have been written to the EEPROM, the 32-bit value
stored at offset 2FFC hex from the VXI-MXI-2 A24 or A32 base
address should be incremented. This 32-bit value stores the number of
times the EEPROM has been written, since there is a limit of 10,000
writes before writes to the part become unreliable. The 32-bit value can
be read with a 32-bit access but must be written with 8-bit accesses
followed by reads as described in the previous paragraph.
The following pseudo code is an example of a VXI-MXI-2 EEPROM
programming sequence. Assume that the VXI-MXI-2 has been
allocated 200000 hex for its base A24 address. All numbers in the
example are in hexadecimal. The four lines of code labeled with the
comment “/* set options here */” should be repeated for each
configuration setting that is being written to the EEPROM.
xxxxxx
represents the address of the EEPROM location being changed, and
xx
represents the value to change it to.
LONG writecount, temp; /* program variables */
a24_byte_write(address, data); /* function prototype */
a24_byte_read(address, data); /* function prototype */
a24_long_read(address, data); /* function prototype */
a24_byte_write(20075B, 81); /* set IOCONFIG in VMCR2 */
a24_long_read(202FFC, writecount); /* get EEPROM write count */
if (writecount < 2710) { /* check limit (10,000 dec) */
a24_byte_write(
xxxxxx
,
xx
); /* set options here */
do {
a24_byte_read(
xxxxxx
, temp);
} while (temp !=
xx
);
writecount = writecount + 1; /* increment write count */
a24_byte_write(202FFC, (writecount & FF000000) >> 24);
do {
a24_byte_read(202FFC, temp);
} while (temp != (writecount & FF000000) >> 24);
a24_byte_write(202FFD, (writecount & 00FF0000) >> 16);
do {
a24_byte_read(202FFD, temp);
} while (temp != (writecount & 00FF0000) >> 16);
a24_byte_write(202FFE, (writecount & 0000FF00) >> 8);
do {
a24_byte_read(202FFE, temp);
} while (temp != (writecount & 0000FF00) >> 8);