6.1.2 DAC Correction Formula
The basic formula for correcting any DAC value is:
Data
=
Value
4
131072
1
corr
corr
Offset
Gain
¸
¹
·
¨
©
§
Value
is the desired DAC value.
Data
is the corrected DAC value that must be sending to the DAC.
Gain
corr
and
Offset
corr
are the DAC correction values from the Calibration Data ROM. They are stored separately
for each of the 8 DAC channels.
The correction values are stored as two’s complement byte wide values in the range from –32768 to +32767. For
higher accuracy they are scaled to ¼ LSB.
Floating point arithmetic or scaled integer arithmetic must be used to avoid rounding errors in computing
above formula.
ADC Operating Modes
6.2
The ADC part of the TPMC851 can operate in two modes: the Manual Mode, with little or none support through
automation, and the Sequencer Mode, with large support through automation.
x
Manual Mode
In this mode, the converter operation relies on the user. The channel and gain are set by the user, and the
user has large influence on the converter operation.
Use this mode to convert specific channels and to control conversion timing or to read a channel
repeatedly without the need to await the settling time.
x
Sequencer Mode
In this mode almost everything is automated and the converter operation is transparent to the user.
Use this mode to convert all channels at specific time intervals, or to always have current data available.
6.2.1 Manual Mode
The Manual Mode is useful if direct control of converter operation is needed. Setup the desired channel and gain
in the ADCCONT register. If the "Automatic Settling Time Control" is deactivated, the user has to wait until the
ADC_SETTL flag reads '0'. Then the conversion can be started with a write access to the ADC Conversion Start
Register ADCCONV. If the Automatic Settling Time Control is activated, the conversion starts automatically after
the settling time has elapsed.
It is possible to select the next channel and/or gain in the ADCCONT register immediately after the write to the
ADC Conversion Start Register ADCCONV. The conversion and the settling time will then proceed
simultaneously.
The conversion data is available in the ADCDATA register when the ADC_BUSY flag in the ADCSTAT register
reads as '0'.
If interrupts are enabled, two interrupts will be generated: the first interrupt is generated when the settling time has
elapsed (and the Automatic Settling Time Control is deactivated); the second interrupt is generated when the
conversion has finished. Using the interrupts exempts from polling the ADC_SETTL and ADC_BUSY flags.
TPMC851 User Manual Issue 1.0.9
Page 48 of 65