This function uses the DAC to generate an analog voltage from the given 6-bit digital value. This voltage is then compared with that on the specified channel (options are: MainBattery, BkUpBattery, Reference) and the logical result of this comparison is returned to the caller. The practical use is for a reasonably fast threshold comparison on the selected channel voltage.
The result is not adjusted based on the reference voltage, and only a single comparison is made. If repeated calls to this service are utilized to perform a battery measurement, the results obtained will differ slightly from the more reliable results returned from services 6000h and 6001h.
The service will error if the DAC is in-use at the time of the call. If the ERR bit is set, the LOW bit should be removed and the call repeated. If the ERR bit is clear, then the LOW bit is "1" iff Vd < V, where Vd is the DAC generated voltage corresponding to the digital input d, and V is the voltage on the specified channel.
The voltage Vd corresponding to the digital input value d can be obtained from the formula:
Vd = [(3.3-1.57)/63]*d + 1.57
It is worth noting that NiCad and alkaline batteries have different characteristics and that the battery voltage is not always a reliable indication of remaining battery capacity.