Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Swra 471

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Application Report

SWRA471 – December 2014

CC112X/CC120X On-Chip Battery Monitor

Fredrik Eriksen

ABSTRACT
This application report provides the necessary information in order to use the voltage sensor of the
CC112x and CC120x family. The voltage sensor can be used to monitor the supply and battery voltage
(VDD).

Contents
1 Acronyms Used in This Document ........................................................................................ 2
2 Digital Readout of Supply Voltage (VDD) .................................................................................. 2
3 Calibration Example ......................................................................................................... 3
4 References ................................................................................................................... 4
Appendix A CC120X Code for Digital Readout................................................................................ 5

List of Tables
1 Register Settings for Digital Readout Using CC112X ................................................................... 2
2 Register Settings for Digital Readout Using CC120X ................................................................... 3
3 ADC Value vs Supply Voltage ............................................................................................. 3

All trademarks are the property of their respective owners.

SWRA471 – December 2014 CC112X/CC120X On-Chip Battery Monitor 1


Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
Acronyms Used in This Document www.ti.com

1 Acronyms Used in This Document

Acronym Description
ADC Analog-to-Digital Converter
DC Direct Current
IF Intermediate Frequency
IFAMP Intermediate Frequency Amplifier
IFADC Intermediate Frequency Analog-to-Digital Converter
RX Receive (mode)

2 Digital Readout of Supply Voltage (VDD)

2.1 Operation
The IFADC in the receive chain is used to convert the analog sensor voltage to a digital value, which can
be read from the CHFILT register.
In order to get a digital readout the following must be done:
• The chip must be in receive mode (RX).
• The DC filter must be disabled and the IF frequency set to zero. Otherwise the DC information is
filtered out.
• The IFAMP must be off and this is done with the chip set in debug mode. For details about debug
mode, see Section 2.2. Note that the chip needs to be reset (by issuing an SRES strobe) to get out of
debug mode.
• Optionally the DVGA_GAIN setting in the MDMCFG1 register can be adjusted to increase/decrease
the amplitude of the signal to prevent an overflow in the output value.
• Table 1 and Table 2 list the registers used to activate digital readout when using CC112x and CC120x,
respectively. For details, see code in Appendix A. All the SPI functions used in the code is found in the
CC112x and CC120x software examples ( [7] and [8]).

Table 1. Register Settings for Digital Readout Using CC112X


Register Value Comment
DCFILT_CFG 0x40 Turn off DCFILT
MDMCFG1 0x01 Only I-Channel
CHAN_BW 0x01 Channel filter on
FREQ_IF_CFG 0x00 Off
ATEST 0x2B Battery sensor on
ATEST_MODE 0x08 Battery sensor on
PA_IFAMP_TEST 0x01 FAMP to test module
Debug Mode
WOR_EVENT0_LSB 0x1F Put IFAMP in PD - Must run SXOFF after to effectuate

2 CC112X/CC120X On-Chip Battery Monitor SWRA471 – December 2014


Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
www.ti.com Digital Readout of Supply Voltage (VDD)

Table 2. Register Settings for Digital Readout Using CC120X


Register Value Comment
DCFILT_CFG 0x40 Turn off DCFILT
MDMCFG1 0x01 Only I-Channel
CHAN_BW 0x01 Channel filter on
FREQ_IF_CFG 0x00 Off
ATEST 0x2B Battery sensor on
ATEST_MODE 0x08 Battery sensor on
PA_IFAMP_TEST 0x01 FAMP to test module
Debug Mode
WOR_EVENT0_LSB 0x1F Put IFAMP in PD - Must run SXOFF after to effectuate

2.2 Debug Mode


In order to turn off the IFAMP the chip has to be set in Debug Mode. This is done by filling the TX FIFO
with a specific string and writing 0x01 to the BIST register. With the radio in debug mode the IFAMP can
be turned off for correct measurement of VDD. Note that the radio has to be reset to get out of debug
mode. Because of this the radio has to be reconfigured after exiting debug mode.

3 Calibration Example
The voltage offset in the ADC varies from chip to chip; therefore, it is necessary to do a calibration before
use.
Figure 1 shows that the digital readout is quite linear to the related voltage and a simple linear equation is
sufficient for coarse voltage measurement.

Figure 1. ADC Value vs Supply Voltage

Table 3. ADC Value vs Supply Voltage


Supply Voltage ADC Value
2.612 V 106300
2.804 V 107300
3.022 V 108700
3.199 V 110000
3.403 V 111500
3.603 V 114000

SWRA471 – December 2014 CC112X/CC120X On-Chip Battery Monitor 3


Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
References www.ti.com

The equation can be found by performing measurements across the wanted voltage range and make a
trend line as shown Table 3. The equation for the trend line can then be used in the software to calculate
the supply and battery voltage. The equation found in this example is:
Voltage = 0.0001 * ADCvalue - 7.9 (1)

4 References
1. CC1120 High-Performance RF Transceiver for Narrowband Systems Data Sheet (SWRS112)
2. CC1121 High-Performance Low-Power RF Transceiver Data Sheet (SWRS111)
3. CC1125 Ultra-High Performance RF Narrowband Transceiver Data Sheet (SWRS120)
4. CC112X/CC1175 Low-Power High Performance Sub-1 GHz RF Transceivers/Transmitter User's Guide
(SWRU295)
5. CC1200 Low-Power, High-Performance RF Transceiver Data Sheet (SWRS123)
6. CC120X Low-Power High Performance Sub-1 GHz RF Transceivers User's Guide (SWRU346)
7. CC112x Software Examples (http://www.ti.com/lit/zip/swrc219)
8. CC120x Software Examples (http://www.ti.com/lit/zip/swrc274)

4 CC112X/CC120X On-Chip Battery Monitor SWRA471 – December 2014


Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
www.ti.com

Appendix A CC120X Code for Digital Readout

The following code is for CC120x, but can easily be rewritten for use with the CC112x.
/*******************************************************************************
* @fn voltageRead
*
* @brief Reads voltage sensor
*
* @param none
*
* @return none
*/
static float voltageRead(void) {
// Variables
uint8 RegValue = 0;
uint8 marcStatus;
uint8 writeByte;
float voltage = 0;

// String to put radio in debug mode


uint8 txBuffer[18] =
{0x0F,0x28,0x02,0x90,0x42,0x1B,0x7E,0x1F,0xFE,0xCD,0x06,0x1B,0x0E,0xA1,0x0E,0xA4,0x00,0x3F};

// Configure ADC
writeByte = 0x02;
cc120xSpiWriteReg( CC120X_IF_ADC2, &writeByte, 1);
writeByte = 0xEE;
cc120xSpiWriteReg( CC120X_IF_ADC1, &writeByte, 1);
writeByte = 0x10;
cc120xSpiWriteReg( CC120X_IF_ADC0, &writeByte, 1);

// Set SINGLE_ADC_EN to "Only I-channel" &0x1


// DVGA Gain to 6dB - This directly modifies the amplitude of the signal
// and can be used to get the signal within range together with the CHAN_BW register.
writeByte = 0x05;
cc120xSpiWriteReg( CC120X_MDMCFG1, &writeByte, 1);

// ADC Decimation factor max


writeByte = 0x88;
cc120xSpiWriteReg( CC120X_CHAN_BW, &writeByte, 1);

// Zero-IF
writeByte = 0x00;
cc120xSpiWriteReg( CC120X_IF_MIX_CFG, &writeByte, 1);

// Disable DC_FILT
writeByte = 0x40;
cc120xSpiWriteReg( CC120X_DCFILT_CFG, &writeByte, 1);

// Make sure CHFILT_BYPASS is not set


writeByte = 0x00;
cc120xSpiWriteReg( CC120X_MDMCFG0, &writeByte, 1);

// Route ATEST MUX to battmon


writeByte = 0x2B;
cc120xSpiWriteReg( CC120X_ATEST, &writeByte, 1);

// Set ATEST to battmon


writeByte = 0x08;
cc120xSpiWriteReg( CC120X_ATEST_MODE, &writeByte, 1);

// Enable test at IFAMP output


writeByte = 0x01;
cc120xSpiWriteReg( CC120X_PA_IFAMP_TEST, &writeByte, 1);

SWRA471 – December 2014 CC112X/CC120X On-Chip Battery Monitor 5


Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
Appendix A www.ti.com

// Set chip in RX
trxSpiCmdStrobe(CC120X_SRX);

// Read marcstate and wait until chip is in RX


do {
cc120xSpiReadReg(CC120X_MARCSTATE, &marcStatus, 1);
} while (marcStatus != 0x6D);

// Put radio in debug mode


// Write debug init to tx fifo
cc120xSpiWriteTxFifo(txBuffer,sizeof(txBuffer));

// Run code from FIFO


writeByte=0x01;
cc120xSpiWriteReg( CC120X_BIST, &writeByte, 1);

// Strobe IDLE
trxSpiCmdStrobe(CC120X_SIDLE);

// Set IF AMP in PD
writeByte=0x1F;
cc120xSpiWriteReg( CC120X_WOR_EVENT0_LSB, &writeByte, 1);

// Strobe SXOFF to copy command over


trxSpiCmdStrobe(CC120X_SXOFF);

// Turn off VCO to save power and eliminate voltage


// drop on the reference voltage from different settings.
writeByte=0xFF;
cc120xSpiWriteReg( CC120X_WOR_EVENT0_LSB, &writeByte, 1);

// Strobe SXOFF to copy command over


trxSpiCmdStrobe(CC120X_SFSTXON);

// Radio now in Debug Mode

// Wait until channel filter data is valid


do {
cc120xSpiReadReg(CC120X_CHFILT_I2, &RegValue, 1);
} while (!RegValue&0x08);

// Read ADC value from CHFILT_I registers


cc120xSpiReadReg(CC120X_CHFILT_I2, &RegValue, 1);
ADCValue_I = ((int32)RegValue) << 16;
cc120xSpiReadReg(CC120X_CHFILT_I1, &RegValue, 1);
ADCValue_I |= (((int32)RegValue) << 8) & 0x0000FF00;
cc120xSpiReadReg(CC120X_CHFILT_I0, &RegValue, 1);
ADCValue_I |= (int32)(RegValue) & 0x000000FF;

// Simple conversion of ADC value to voltage


voltage = (ADCValue_I * 0.0001) - 7.9;

// Return voltage
return voltage;

6 CC112X/CC120X On-Chip Battery Monitor SWRA471 – December 2014


Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated
IMPORTANT NOTICE

Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other
changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest
issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and
complete. All semiconductor products (also referred to herein as “components”) are sold subject to TI’s terms and conditions of sale
supplied at the time of order acknowledgment.
TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI’s terms
and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary
to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily
performed.
TI assumes no liability for applications assistance or the design of Buyers’ products. Buyers are responsible for their products and
applications using TI components. To minimize the risks associated with Buyers’ products and applications, Buyers should provide
adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or
other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information
published by TI regarding third-party products or services does not constitute a license 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 significant portions 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. TI is not responsible or liable for such altered
documentation. Information of third parties may be subject to additional restrictions.
Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service
voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice.
TI is not responsible or liable for any such statements.
Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements
concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support
that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which
anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause
harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use
of any TI components in safety-critical applications.
In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI’s goal is to
help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and
requirements. Nonetheless, such components are subject to these terms.
No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties
have executed a special agreement specifically governing such use.
Only those TI components which TI has specifically designated as military grade or “enhanced plastic” are designed and intended for use in
military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components
which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and
regulatory requirements in connection with such use.
TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of
non-designated products, TI will not be responsible for any failure to meet ISO/TS16949.

Products Applications
Audio www.ti.com/audio Automotive and Transportation www.ti.com/automotive
Amplifiers amplifier.ti.com Communications and Telecom www.ti.com/communications
Data Converters dataconverter.ti.com Computers and Peripherals www.ti.com/computers
DLP® Products www.dlp.com Consumer Electronics www.ti.com/consumer-apps
DSP dsp.ti.com Energy and Lighting www.ti.com/energy
Clocks and Timers www.ti.com/clocks Industrial www.ti.com/industrial
Interface interface.ti.com Medical www.ti.com/medical
Logic logic.ti.com Security www.ti.com/security
Power Mgmt power.ti.com Space, Avionics and Defense www.ti.com/space-avionics-defense
Microcontrollers microcontroller.ti.com Video and Imaging www.ti.com/video
RFID www.ti-rfid.com
OMAP Applications Processors www.ti.com/omap TI E2E Community e2e.ti.com
Wireless Connectivity www.ti.com/wirelessconnectivity

Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2014, Texas Instruments Incorporated

You might also like