Writing To The Eeprom Register - Measurement Computing Data Translation DT9857 User Manual

Table of Contents

Advertisement

Appendix C

Writing to the EEPROM Register

If you want to change the default values for the coupling type, current source, and Sync Bus
termination that are defined in the Open Layers Control Panel programmatically, you can use
the Data Acq SDK function olDiagWriteReg to write to the EEPROM register of each DT9857
ad DT9857E module.
The Open Layers Control Panel has controls for setting the following parameters, which are
stored in 8 consecutive bytes of EEPROM:
• Coupling type. The values COUPLING_TYPE_AC or COUPLING_TYPE_DC are stored
• Current source. The values EXCITATION_CURRENT_SRC_INTERNAL or
• Sync Bus termination (supported on the DT9857E module only). The value is 0x01.
These controls may also be "uninitialized" if, for some reason, the DT9857 or DT9857E module
skipped the post-manufacturing initialization process.
To access the storage locations programmatically, use the olDiagReadReg() and
olDiagWriteReg() functions. The following code shows the location of these controls in the
register map:
#define I2C_MEM_BASE
// Coupling storage offsets relative to the base address for the
// analog input channels
#define EEPROM_OFFSET_COUPLING
#define EEPROM_OFFSET_COUPLING_END
// Current source storage offsets relative to the base address for
// the analog input channels
#define EEPROM_OFFSET_CURRENT_SOURCE
#define EEPROM_OFFSET_CURRENT_SOURCE_END
//Sync Bus termination offset from the base address
#define EEPROM_OFFSET_SYNC_TERMINATION
To update the coupling type, use the olDiagWriteReg() command as follows:
OLSTATUS olStatus = olDiagWriteReg(m_hDev, I2C_MEM_BASE +
To read the coupling type, use the olDiagReadReg() command as follows:
OLSTATUS olStatus = olDiagReadReg(m_hDev, I2C_MEM_BASE +
To update the current source, use the olDiagWriteReg() command as follows:
OLSTATUS olStatus = olDiagWriteReg(m_hDev, I2C_MEM_BASE +
182
as constants for these controls.
EXCITATION_CURRENT_SRC_DISABLED are stored as constants for these controls.
EEPROM_OFFSET_COUPLING + channelNumber, couplingType, 1);
EEPROM_OFFSET_COUPLING + channelNumber, couplingType, 1);
EEPROM_OFFSET_CURRENT_SOURCE + channelNumber, currentSource, 1);
0x00000000
0x0020
0x002F
0x0040
0x004F
0x0C490

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Data Translation DT9857 and is the answer not in the manual?

Questions and answers

Table of Contents