# Texas Instruments | DN101 -- Using the ADC to Measure Supply Voltage (Rev. A) | Application notes | Texas Instruments DN101 -- Using the ADC to Measure Supply Voltage (Rev. A) Application notes

```Design Note DN101
Using the ADC to Measure Supply Voltage
By Kjetil Aamodt
Keywords
•
•
•
•
•
1
•
•
•
•
VDD
Supply Voltage
CC1110
CC1111
CC2430
CC2431
CC2510
CC2511
Introduction
The above mentioned SoCs contain a
feature for sampling VDD/3 using the
VDD/3 with 1.25 V as internal voltage
reference, VDD can easily be calculated.
SWRA100A
Page 1 of 4
Design Note DN101
KEYWORDS.............................................................................................................................. 1
1
INTRODUCTION............................................................................................................. 1
2
VOLTAGE MEASUREMENT.......................................................................................... 3
3
GENERAL INFORMATION ............................................................................................ 4
3.1 DOCUMENT HISTORY ......................................................................................................... 4
SWRA100A
Page 2 of 4
Design Note DN101
2
Voltage Measurement
The following code sets up the ADC to perform voltage measurement of VDD/3.
/* Reference voltage:
Internal 1.25 V,
Resolution: 12 bits,
ADC input: VDD/3 (VDD is the battery voltage) */
#define SAMPLE_BATTERY_VOLTAGE(v)
do {
v |= (((unsigned int)ADCH) << 8);
} while(0)
//
//
//
//
\
\
\
\
\
\
\
Max ADC input voltage = reference voltage =>
(VDD/3) max = 1.25 V => max VDD = 3.75 V
12 bits resolution means that max ADC value = 0x07FF = 2047 (dec)
(the ADC value is 2’s complement)
// Battery voltage, VDD = adc value * (3.75 / 2047)
// To avoid using a float, the below function will return the battery voltage * 10
// Battery voltage * 10 = adc value * (3.75 / 2047) * 10
#define CONST 0.0183195 // (3.75 / 2047) * 10
unsigned char getBatteryVoltage(void) {
// Note that the conversion result always resides in MSB section of ADCH:ADCL
adcValue >>= 4; // Shift 4 due to 12 bits resolution
}
SWRA100A
Page 3 of 4
Design Note DN101
3
General Information
3.1
Document History
Revision
SWRA100A
Date
2007.10.22
SWRA100
2006.07.06
Description/Changes
Updated code example (12 bits resolution instead of 14).
Changes to Figure 1.
Initial release.
SWRA100A
Page 4 of 4
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements,
improvements, and other changes to its products and services at any time and to discontinue any product or service without notice.
Customers should obtain the latest relevant information before placing orders and should verify that such information is current and
complete. All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s
standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this
warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily
performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and
applications using TI components. To minimize the risks associated with customer products and applications, customers should
provide adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask
work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services
are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such
products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under
the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is
accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an
unfair and deceptive business practice. TI is not responsible or liable for such altered documentation. Information of third parties
may be subject to additional restrictions.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service
voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business
practice. TI is not responsible or liable for any such statements.
TI products are not authorized for use in safety-critical applications (such as life support) where a failure of the TI product would
reasonably be expected to cause severe personal injury or death, unless officers of the parties have executed an agreement
specifically governing such use. Buyers represent that they have all necessary expertise in the safety and regulatory ramifications
of their applications, and acknowledge and agree that they are solely responsible for all legal, regulatory and safety-related
requirements concerning their products and any use of TI products in such safety-critical applications, notwithstanding any
applications-related information or support that may be provided by TI. Further, Buyers must fully indemnify TI and its
representatives against any damages arising out of the use of TI products in such safety-critical applications.
TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are
specifically designated by TI as military-grade or "enhanced plastic." Only products designated by TI as military-grade meet military
specifications. Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is
solely at the Buyer's risk, and that they are solely responsible for compliance with all legal and regulatory requirements in
connection with such use.
TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products
are designated by TI as compliant with ISO/TS 16949 requirements. Buyers acknowledge and agree that, if they use any
non-designated products in automotive applications, TI will not be responsible for any failure to meet such requirements.
Following are URLs where you can obtain information on other Texas Instruments products and application solutions:
Products
Applications
Amplifiers
amplifier.ti.com
Audio
www.ti.com/audio
Data Converters
dataconverter.ti.com
Automotive
www.ti.com/automotive
DSP
dsp.ti.com
Interface
interface.ti.com
Digital Control
www.ti.com/digitalcontrol
Logic
logic.ti.com
Military
www.ti.com/military
Power Mgmt
power.ti.com
Optical Networking
www.ti.com/opticalnetwork
Microcontrollers
microcontroller.ti.com
Security
www.ti.com/security
RFID
www.ti-rfid.com
Telephony
www.ti.com/telephony
Low Power
Wireless
www.ti.com/lpw
Video & Imaging
www.ti.com/video
Wireless
www.ti.com/wireless
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265