Guide to Interpreting CC Calibration Value

This page provides information on computing sensor capacitance values using the Compensation Capacitor (CC) value. The CC value is also called the CC calibration value as it is computed during the calibration phase. The CC value of each touch button can be obtained as follows:

uint16_t cc_value = ptc_qtlib_node_stat1[SENSOR_NUMBER].node_comp_caps;

The unsigned 16-bit CC values are stored as node_comp_caps in Peripheral Touch Controller (PTC) CC register format.

PTC CC Register Format

Depending on the device, the CC register format changes.

cc-register.png
SAME54/SAME53/SAME51, SAMD51/SAMD20/SAMD21/SAMDA1/SAMD10/SAMD11, ATmega328PB/ATmega324PB, SAML21/SAML22/SAMC20/SAMC21/SAMHA1/SAML10/SAML11 devices

cc-register-tinyself.png
ATtiny81x/ATtiny161x/ATtiny321x - Self-Capacitance
cc-register-tinymutual.png
ATtiny81x/ATtiny161x/ATtiny321x - Mutual Capacitance

CC Register Bit Values

coarse-fine-accure.png
Coarse/Fine/Accurate Bit Values

rough.png
Rough Bit Values

Computing Sensor Capacitance

SAMD20/SAMD21/SAMDA1/SAMD10/SAMD11, ATmega328PB/ATmega324PB, SAML21/SAML22/SAMC20/SAMC21/SAMHA1 Devices

  • Read CC value in decimal: 11639
  • Read CC value in hexadecimal: 0x2D77
  • Substitute the rough, coarse, fine, and accurate values from the table.
    • Rough = 13.5
    • Coarse = 8.775
    • Fine = 0.4725
    • Accurate = 0.04725

Sensor Capacitance (pF) = Rough + Coarse + Fine + Accurate = 22.79 pF (maximum 32 pF)

ATtiny81x/ATtiny161x/ATtiny321x - Self-Capacitance

  • Read CC value in decimal: 46967
  • Read CC value in hexadecimal: 0xB777
  • Substitute the rough, coarse, fine, and accurate values from the table.
    • Rough1 = 20.25
    • Rough2 = 13.5
    • Coarse = 4.725
    • Fine = 0.4725
    • Accurate = 0.04725

Sensor Capacitance (pF) = Rough + Coarse + Fine + Accurate = 38.99 pF (maximum 53.73 pF)

SAME54/SAME53/SAME51/SAMD51/SAML10/SAML11 - Maximum Sensor Capacitance

Self-Capacitance
Here, the internal compensation capacitance can compensate twice the sensor capacitance.
The maximum supported sensor capacitance is twice the maximum compensation capacitance value (2* 32 pF).
So, if computed capacitance from CC is 10 pF, then actual sensor capacitance is 20 pF.

Mutual Capacitance
The maximum sensor capacitance is the same as the maximum compensation capacitance value, which is 32 pF.

© 2019 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.