7.2.1 Sensor Node Group

qtm_acquisition_control_t
  • A top-level container for an acquisition group
  • Contains pointers to group and node memory containing configurations and run-time data
Structure Contents
qtm_acquisition_control_t qtm_acq_node_group_config_t (*qtm_acq_node_group_config);
qtm_acq_4p_saml10_config_t (*qtm_acq_node_config);
qtm_acq_node_data_t (*qtm_acq_node_data);
qtm_acq_node_group_config_t
  • Common parameters, applied to all sensor nodes in the group
Parameter Size Range/Options Usage
num_sensor_nodes 16-bit 4 to 65532 The total number of sensor nodes configured in the group, for example, a number of 4P sets X4.
acq_sensor_type 8-bit NODE_MUTUAL_4P Parallel sets of 4 mutual capacitance sensor nodes. Each set contains 4x PTC X masks and 1x PTC Y masks for the measurement of XY capacitance.
calib_option_select 1 byte Bits 3:0 Calibration type Selects which parameter is auto-tuned for charge transfer.
CAL_AUTO_TUNE_NONE No auto-tune for charge transfer
CAL_AUTO_TUNE_RSEL Series resistor tuned to the largest value that allows full charge transfer
CAL_AUTO_TUNE_PRSC Prescaler tuned to the lowest (fastest) value that allows full charge transfer
CAL_AUTO_TUNE_CSD Charge share delay tuned to the lowest value that allows full charge transfer
Bits 7:4 Calibration target Target charge time for sensor capacitance.
CAL_CHRG_2TAU Sensor charged for 2 x Time constant
CAL_CHRG_3TAU Sensor charged for 3 x Time constant
CAL_CHRG_4TAU Sensor charged for 4 x Time constant
CAL_CHRG_5TAU Sensor charged for 5 x Time constant
freq_option_select 1 byte

FREQ_SEL_0

to

FREQ_SEL_15
FREQ_SEL_0 to FREQ_SEL_15 inserts a delay cycle between measurements during oversampling, where 0 is the shortest delay, 15 the longest
FREQ_SEL_SPREAD FREQ_SEL_SPREAD varies this delay from 0 to 15 in a sawtooth manner during the oversampling set
ptc_interrupt_priority 1 byte 1 to 3 Arm® NVIC Interrupt priority
wakeup_exp* 1 byte 0 to 15 The Wake-up Exponent is the exponent for the power of two, representing the wake-up count in PTC core clocks
Note: * - Not available on all devices.

qtm_acq_saml10_node_config_t

Note: This data structure is the specific configuration for SAM L10 PTC hardware.
Parameter Size Range/Options Usage
node_xmask[4]

4x4 bytes (16 bytes)

4x8* bytes (32 bytes)

*AVR-DA

Array/bit field Select X pin masks for NODE_MUTUAL_4P.

Set the bit(s) at location(s) corresponding to X line number(s).

For example:

X0 only = 0b00000001 = 0x01 X0 and X2 = 0b00000101 = 0x05
node_ymask

4 bytes

8* bytes

*AVR-DA

(bit field)

Select Y pin mask.

Set the bit(s) at location(s) corresponding to Y line number(s).

For example:

Y5 only = 0b00100000 = 0x20

Y1, Y2 and Y7 = 0b10000110 = 0x86

node_csd 1 byte

For SAM L1x:

0 to 255

For ATtiny81x,161x,321x:

0 to 31

The number of delay cycles to ensure the charging of the sensor node capacitances

Note: If auto-tune is enabled, this value is used for initial compensation capacitor calibration. Ensure it allows sufficient time to charge the sensor.
node_rsel_prsc 1 byte

Bits 7:4 = RSEL

RSEL_VAL_0

RSEL_VAL_20

RSEL_VAL_50

RSEL_VAL_70*

RSEL_VAL_80*

RSEL_VAL_100

RSEL_VAL_120*

RSEL_VAL_200

Internal Y line series resistor selection

* May not be available for all devices

AVR-DA: 70 kΩ, 80 kΩ, 120 kΩ, 200 kΩ

Bits 3:0 = PRSC

PRSC_DIV_SEL_1

PRSC_DIV_SEL_2

PRSC_DIV_SEL_4

PRSC_DIV_SEL_6*

PRSC_DIV_SEL_8

PRSC_DIV_SEL_12*

PRSC_DIV_SEL_14*

PRSC_DIV_SEL_16

Clock Prescaler

Acquisition clock is derived and scaled from CPU clock for AVR® devices.

* May not be available for all devices.

AVR-DA: 6 , 12, 14 **

**The numbers correspond to the prescaler value.

node_gain 1 byte

Bits 7:4 = Analog Gain

GAIN_1

GAIN_2

GAIN_4

GAIN_8

GAIN_16

Analog Gain Setting

Integration capacitor adjusted to control integrator gain.

Bits 3:0 = Digital Gain

GAIN_1

GAIN_2

GAIN_4

GAIN_8

GAIN_16

Digital Gain Setting

The accumulated sum is scaled to Digital Gain.

node_oversampling 1 byte

FILTER_LEVEL_1

FILTER_LEVEL_2

FILTER_LEVEL_4

FILTER_LEVEL_8

FILTER_LEVEL_16

FILTER_LEVEL_32

FILTER_LEVEL_64

The number of samples to accumulate for each measurement.

Note: Oversampling must be configured to be greater than or equal to Digital Gain for correct operation.
qtm_acq_node_data_t
  • Individual node run-time data (array)
Parameter Size Range/Options Usage
node_acq_status 1 byte Bit 7

1 = NODE_CAL_ERROR

The sensor node capacitance exceeds the maximum compensation capacitance supported.

Bit 6 1 = Charge transfer tuning complete
Bit 5 1 = Calibration state set

Bit 4: Bit 2 (3 Bits)

Node calibration state

NODE_MEASURE

NODE_CC_CAL

NODE_PRSC_CAL

NODE_RSEL_CAL

NODE_CSD_CAL

Indicates whether calibration is ongoing and its current stage

Bit 1: Calibration Request

Write a ‘1’ to trigger calibration sequence on this node.

(Reset to ‘0’ by module once actioned.)

Bit 0: Enabled

Write a ‘1’ to enable this node for measurement.

node_acq_signals 2 bytes Most recent measurement for this sensor node. This is a 16-bit unsigned value.

Accumulated and scaled as per node_oversampling and node_gain_digital settings.

node_comp_caps 2 bytes Hardware calibration data Indicates tuning of the compensation circuit for this node