AN-929: Tuning the AD714x for CapTouch Applications

Introduction

The AD714x CapTouch controller must be tuned to offer the best performance for each user’s application. Tuning is dependent upon what type of sensors, such as buttons, scroll bars, or wheels, are attached to the controller. Sensor size, surroundings, and overlay all have an effect on performance.

The tuning process consists of five easy steps that are described in detail in this application note. These steps are accomplished by two possible methods:

  • Method A consists of reading and writing to registers using a development system other than the AD714x evaluation board. 
  • Method B consists of using an AD714x evaluation board and software.

To begin tuning, make sure you are working with your end product or final design (sensor PCB, as per final product, or as close as possible). The overlay on the sensor should be mounted as per the final product.

Note that any changes to the sensor PCB, mounting, or overlay material will require further tuning.

For each sensor, the five steps are listed below:

  1. Set up the input connections. 
  2. Offset the bulk or stray capacitance. 
  3. Get the high and low clamp values. 
  4. Get the high and low offset values. 
  5. Set the sensitivity. 

Follow Step 1 through Step 5 for each conversion stage.

The eight tuning registers for each stage/sensor, located in Register Bank 2, are:

  • STAGEX_CONNECTION Bits[6:0]
  • STAGEX_CONNECTION Bits[13:7] 
  • STAGEX_AFE_OFFSET 
  • STAGEX_SENSITIVITY 
  • STAGEX_OFFSET_LOW 
  • STAGEX_OFFSET_HIGH 
  • STAGEX_OFFSET_HIGH_CLAMP 
  • STAGEX_OFFSET_LOW_CLAMP

Preliminary Steps

Ensuring that the AD714x is Not Already Programmed


Before getting started, it is important to ensure that the AD714x is not already programmed. To do so, make sure that the first three registers for each stage (X = 0 to 11) are set as follows:

  • StageX_Connection Bits[6:0] = 0xFFFF
  • StageX_Connection Bits[13:7] = 0x3FFF
  • StageX_AFE_Offset = 0x0000

Once the three registers are set, it is time to begin the tuning process. Of the two possible methods to accomplish this task, Method A presumes development system other than AD714x evaluation board is being used while Method B presumes the AD714x evaluation board is being used for tuning.


Connecting an External Sensor PCB to the AD714x Evaluation Board (for Method B Users Only)


The evaluation board software and a host microcontroller can be used to evaluate custom sensors (this is Method B). Method B users must connect an external sensor PCB to the board before proceeding by completing the following steps:

  • Power up the evaluation board.
  • Switch S4 to the off position.
  • Connect the external sensor PCB to either J1 or J2.

The serial interface of the AD714x on the external sensor PCB is now connected to the serial interface of the ADuC841 on the evaluation board.

Note that external sensor PCB must have the AD714x on board. It is not possible to use the AD714x on the evaluation board to control external sensors.


Understanding the Controller Sequencer


The AD714x sequencer (see Figure 1) controls conversions on the AD714x in a time division multiplex (TDM) method. It consists of twelve stages on the AD7142 and AD7147 and eight stages on the AD7143.

Figure 1. Conversion Sequence.

At least one conversion stage is used to measure the capacitance from the sensor each CIN input. Any CIN input can be assigned to any stage. Tuning is done on a per stage basis.

Step 1: Set Up Input Connection

Each CIN input can be connected to the positive or negative input terminal of the converter (see Figure 2). Each CIN input can be connected internally to a bias node or left floating. Any CIN not connected to CDC should be connected to bias.

Figure 2. Input Connection Setup.

Each CIN input has two bits that control this connection.

The CIN input settings are different for each conversion stage. As a general rule, one CIN input is connected to the CDC during a conversion stage, to measure the sensor that is connected to that CIN.


For Buttons


Button sensors can be connected to either positive or negative capacitance-to-digital converter (CDC) input as shown in Figure 3. Two buttons can use the same stage (differential) with one button connected to positive CDC input and the other button connected to negative CDC input. Note that buttons connected differentially cannot be activated together because one cancels out the other.

Figure 3. Connecting Button Sensors.

For Sliders and Wheels 


Sliders and wheels consist of eight separate sensor segments (see Figure 4). Each segment is connected separately to positive CDC input, similar to button connections.

Figure 4. Connecting Sliders/Wheels.

When scrolling, the user interacts with more than one segment. A software algorithm is used to get high resolution positions.

For ratiometric sliders (see Figure 5), only two CIN inputs are used. Each CIN input should be connected to the positive CDC input.

Figure 5. Connecting Ratiometric Sliders.

For Keypads


Each column and each row of a keypad use one connection to the positive CDC input (see Figure 6). For matrix keypad operation, check the row and column status to find which key is active. 2. Configure connections for each CIN input in each stage.

Figure 6. Connecting Keypads

The maximum keypad sizes by controller are:

  • For the AD7142 and AD147: 6 × 6 = 36 keys
  • For the AD7143: 4 × 4 = 16 keys

Method A: Writing to the AD714x


  1. Write to the STAGEX_CONNECTION Bits [6:0] and STAGEX_CONNECTION Bits [13:7] registers to configure the CIN connection.
  2. Configure connections for each CIN input in each stage.
    • 00 = CINx not connected to CDC inputs
    • 01 = CINx connected to CDC negative input
    • 10 = CINx connected to CDC positive input
    • 11 = CINx connected to BIAS (connect unused CIN inputs) 
  3. For the majority of applications, connect only one CIN to the CDC input in each stage.
  4. Connect all unused CIN inputs to bias.

For example, set up CIN4 to be measured in conversion Stage 2 as follows:

STAGE2_CONNECTION [6:0] = 0xFEFF

STAGE2_CONNECTION [13:7] = 0x3FFF


Repeat Step 1 through Step 4 for each conversion stage.


Method B: Using the Evaluation Software


To open the input configuration dialog box (see Figure 7), start the evaluation software and select Register Configuration, and then select CIN Configuration Block STAGEX.

Connect all CINx to positive or negative CDC input, or to bias (if unused), as shown in Figure 7. Repeat this procedure for each conversion stage.

Figure 7. Input Configuration Menu.

Step 2: Offset the Bulk/Stray Capacitance

For the AD7142 ad AD7143, CBULK is the capacitance due to PCB material. For the AD7147 CSTRAY is the capacitance to ground. Note the following:

  • It is not desirable for CBULK or CSTRAY to affect the measurement of CIN.
  • CIN is measured in femtoFarads (fF).
  • CBULK/CSTRAY is measured in picoFarads (pF).

On-chip 7-bit DACs are used to offset CBULK/CSTRAY (20 pF offset capability).

Use the DACs to set the CDC output value when the sensor is untouched to the midscale CDC output code (approximately 32,000 codes).


Method A: Writing to the AD714x


  1. Read the CBULK value of the sensor from Register CDC_RESULT_SX.
  2. If CINx is connected to the positive CDC input, increase the POS_AFE_OFFSET value by 1 LSB. Otherwise, if CINx is connected to the negative CDC input, increase the NEG_AFE_OFFSET value by 1 LSB.
  3. Read back from the CDC_RESULT_STAGEX register again.
  4. Repeat Step 2 and Step 3 until the CDC_RESULT_STAGEX value is as close as possible to 32,768. Note that the best value for POS_AFE_OFFSET and NEG_AFE_OFFSET may be zero.

Method B: Using the Evaluation Software


To open the dialog box shown in Figure 8, start the evaluation software and select Register Configuration, and then select CIN Configuration Block STAGEX.

Figure 8. Programming the AFE_OFFSET.

Use the shortcut button to get the required offset value. The output of the CDC should be close to midscale (approximately 32, 700 codes) once the correct offset is programmed. Alternatively, click on the arrows in the POS_AFE_OFFSET or NEG_AFE_OFFSET boxes to change the values.

Step 3: Obtain the High and Low Clamp Values

Registering a Sensor Activation


When the value measured from a sensor increases above the upper threshold, or decreases below the lower threshold, the sensor is active, as shown in Figure 9.

Figure 9. Sensor Activation.

Threshold values are continuously updated by on-chip logic to account for changes in the ambient (background) capacitance level.


Clamp  Values


The on-chip digital logic requires initialization values.

The high and low clamp values are found by determining the maximum and minimum possible responses from the sensor.

These clamp values are used by the environmental compensation and adaptive threshold on-chip digital logic.

For stages when only one CIN input is connected to the CDC, the high clamp value is equal to the low clamp value.

If CINx is connected to the positive CDC input and CINy is connected to the negative CDC input, the high and low clamp values may be different. This is the case for two differentially connected buttons.


Method A: Writing to the AD714x


When the sensor is untouched, read ADC_RESULT_SX (also called CDC_RESULT_SX).

Read ADC_RESULT_SX when touching the sensor. Your largest finger produces the maximum sensor response. The clamp value is the difference between the touch and untouched values.

Clamp = |Touch CDC value – No touch CDC value|

The high clamp value is written to STAGEX_OFFSET_HIGH _CLAMP and the low clamp value is written to STAGEX_OFFSET_LOW_CLAMP.

For the stage where only one CIN input is connected, the high clamp value and the low clamp value are the same.

For stages where two sensors are connected to the CDC, follow Step 1 through Step 3.

  1. Touch the sensors one at a time.
  2. Get the high clamp value from the sensor that shows an increase in the CDC code when touched.
  3. Get the low clamp value from the sensor that shows a decrease in the CDC code when touched.

Method B: Using the Evaluation Software


  1. Plot the CDC output for each sensor using the evaluation software (see Figure 10).

    Figure 10. Measuring the Sensor Response.
    Begin by starting the evaluation software and selecting Register Configuration, and then selecting Calibration STAGEX. Click on the Read Continuously button to plot the CDC value.
  2. Use your largest figure to obtain the maximum/minimum sensor responses.
  3. The clamp values are obtained using the calculation:

    Clamp = |Touch – No Touch| CDC value

    In this example:

    Clamp = | 34540 – 33450 |

    STAGEX_OFFSET_HIGH _CLAMP = 1090

    STAGEX_OFFSET_LOW _CLAMP = 1090

  4. Program the STAGE_OFFSET_CLAMP registers with the values measured in Step 3.

Step 4: Get the High and Low Offset Values

The procedure for obtaining the high and low offset values is the same whether Method A or Method B is used.

The high and low offset values are the values used for calculating the sensor activation thresholds on power-up. The actual thresholds also take into account sensitivity settings.

The calculations are:

Offset = Clamp Value × 0.8

STAGEX_OFFSET_LOW =
STAGEX_OFFSET_LOW_CLAMP × 0.8

STAGEX_OFFSET_HIGH =
(STAGEX_OFFSET_HIGH_CLAMP × 0.8

For example, with LOW_CLAMP = 2000 and HIGH_CLAMP = 2500.

STAGEX_OFFSET_LOW = 1600

STAGEX_OFFSET_HIGH = 2000


Using the Evaluation Software to Modify the Clamp Offset Values


To open the dialog box shown in Figure 11, start the evaluation software and select Register Configuration, and then select Calibration STAGEX.

Figure 11. Programming the Offset and Clamp Values.

To change the STAGEx_OFFSET_CLAMP values, and the STAGEx_OFFSET values, use the appropriate arrows to increase or decrease the values.

Step 5: Set the Sensitivity

Unique sensitivity levels for each sensor are possible. Up to 16 levels of sensitivity are available. The sensitivity setting sets the activation threshold between 25% to 95% of the average maximum sensor output, referenced from ambient. Refer to Figure 12.

Figure 12.

A low value for the sensitivity setting means that a light touch triggers the sensor while a high value for the sensitivity setting means that only a hard touch triggers the sensor.


Method A: Writing to the AD714x


The sensitivity setting is totally dependant on how the designer wants the sensor to feel to the user.

Begin by setting the sensitivity to 53%.

STAGEX_SENSITIVITY = 0110

If more sensitive response is required, decrease sensitivity setting.

For example:

STAGEX_SENSITIVITY = 0001 = 29%

If less sensitive response is required, increase the sensitivity setting.

For example:

STAGEX_SENSITIVITY = 1101 = 85%


Method B: Using the Evaluation Software


The sensitivity setting depends on what the customer wants (a hard or soft touch to activate the sensor). See Figure 13.

Figure 13. Altering the Sensitivity Settings using the Evaluation Software.

Begin by setting the sensitivity to a nominal 50%.

If more sensitivity is required (a lighter touch to activate the sensor), decrease the sensitivity percentage. If less sensitivity is required, (a heavier touch to activate the sensor), increase the sensitivity percentage.

Conclusion

This application note describes in detail the five step process for tuning the AD714x CapTouch controller.

  1. Set up the input connections.
  2. Offset the bulk or stray capacitance.
  3. Get the high and low clamp values.
  4. Get the high and low offset values.
  5. Set the sensitivity.

After following Step 1 through Step 5 for each conversion stage, the complete Bank 2 configuration values for theAD714x are obtained. On device power-up, these values should be written to the AD714x to configure it correctly for the application.


Using the Evaluation Software to Save the AD714X Configuration


Open the window (see Figure 14) by starting the evaluation software and selecting Register Configuration.

Figure 14. Saving Configuration Data.

To save the configuration data in C code, choose the Create Config File button. This saves the AD714X register configuration to a C code header file.

To save the configuration data so that it can be reloaded onto the AD714x using the evaluation software, choose the Setup Registers button, and then choose Save.

Author

Generic_Author_image

Susan Pratt