Appendix C
182
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
as constants for these controls.
• Current source. The values EXCITATION_CURRENT_SRC_INTERNAL or
EXCITATION_CURRENT_SRC_DISABLED are stored as constants for these controls.
• 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
0x00000000
// Coupling storage offsets relative to the base address for the
// analog input channels
#define EEPROM_OFFSET_COUPLING
0x0020
#define EEPROM_OFFSET_COUPLING_END
0x002F
// Current source storage offsets relative to the base address for
// the analog input channels
#define EEPROM_OFFSET_CURRENT_SOURCE
0x0040
#define EEPROM_OFFSET_CURRENT_SOURCE_END
0x004F
//Sync Bus termination offset from the base address
#define EEPROM_OFFSET_SYNC_TERMINATION
0x0C490
To update the coupling type, use the
olDiagWriteReg()
command as follows:
OLSTATUS olStatus = olDiagWriteReg(m_hDev, I2C_ME
EEPROM_OFFSET_CO channelNumber, couplingType, 1);
To read the coupling type, use the
olDiagReadReg()
command as follows:
OLSTATUS olStatus = olDiagReadReg(m_hDev, I2C_ME
EEPROM_OFFSET_CO channelNumber, couplingType, 1);
To update the current source, use the
olDiagWriteReg()
command as follows:
OLSTATUS olStatus = olDiagWriteReg(m_hDev, I2C_ME
EEPROM_OFFSET_CURRENT_ channelNumber, currentSource, 1);
Summary of Contents for Data Translation DT9857
Page 1: ...DT9857 and DT9857E UM 25656 M User s Manual Title Page ...
Page 4: ......
Page 10: ...Contents 10 ...
Page 14: ...About this Manual 14 ...
Page 25: ...Part 1 Getting Started ...
Page 26: ......
Page 40: ...Chapter 2 40 ...
Page 64: ...Chapter 4 64 ...
Page 71: ...Part 2 Using Your Module ...
Page 72: ......
Page 126: ...Chapter 6 126 ...
Page 132: ...Chapter 7 132 ...
Page 140: ...Chapter 8 140 ...
Page 180: ...Appendix B 180 ...
Page 181: ...181 C Register Level Programming Writing to the EEPROM Register 182 ...
Page 184: ...Appendix C 184 ...
Page 192: ...Index ...