PSoC4S : Idac value and Idac range of CapSense

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Hi,

We are considering CapSense for PSoC4.

We are examining the Raw count, but we do not know the appropriate value for IDAC of CapSense.

The formula is understood below:

PSoC5LP CapSense Calculation of Cs

Raw count = (2^N-1) * Fs * Vref * Cs / Idac


N : 14  // 2^N = 16384

Fs : 3[MHz]

Vref : 1.2 // Specified in the data sheet

Cs : 40[pF] // Sensor capacity was obtained from API.

Actual measured raw count : 13800

From the above, 170uA is calculated as the Idac value.

Idac setting of CapSense component is as follows:

Imod : 27  // (0 to 250) understand it is an 8-bit value

Icomp : 23 // (0 to 127) understand it is an 7-bit value

Then, the current value per bit was examined.

It is described in the PSoC4S family data sheet.

7bit DAC of CapSense

pastedImage_5.png

8bit DAC of CapSense

pastedImage_4.png

Which range can not be determined we are either being applied.

From the calculation result, high range is set,

Imod = 27 * 2.4uA = 64.8uA

Icomp = 23 * 2.4uA = 55.2uA

pastedImage_7.png

Because Imod and Icomp are connected in parallel,

Idac = Imod + Icomp = 120uA

Is the above understanding correct?

Regards,

0 Likes
5 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi MaMi_1205306​,

Please use the below formula for dual mode idac in PSoC 4 and PSoC 6 devices (Refer: PSoC 4 CapSense Design Guide😞

pastedImage_0.png

We recommend you to use the latest CapSense component v7.0 where you can set the IDAC gain in the component itself. The respective IDAC current can be calculated as IDAC gain x IDAC code. Also the IDAC gain is the same for both Modulator and compensation IDAC currents.

By default 2.4 uA range is set by CapSense component v6.0. So, if you are using this component, you can use  2.4 uA  as the IDAC range.

Vref depends on the device you are using. If you are using 3rd gen CapSense devices, Vref is 1.2 V. But if you are using 4th gen capsense devices (PSoC 4S series), Vref needs to be chosen based on VDDA setting. Refer Table 3-3. PSoC Device Family and CapSense Architecture in CapSense design guide. (Pg no 39)

https://www.cypress.com/file/46081/download

In addition to that, for a 40 pF sensor capacitance, 3 MHz is a very high value. You need to set Fsw such that the sensors charges and discharges completely. Please refer section Sense Clock Frequency in Pg 60 of CapSense design Guide

https://www.cypress.com/file/46081/download

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Bragadeesh-san,

Thank you for your reply.

We use dual Idac sourcing mode.

N : 14

Fs : 3 [MHz]

Cs : 40 [pF]

Vref : 1.2

Imod = 27 * 2.4uA = 64.8 [uA]

Icomp = 23 * 2.4uA = 55.2 [uA]

pastedImage_0.png

Raw conunt = 36407 - 13956 = 22451

The value of the formula is 22451.
However, the actual value was 13800.

Do you know why these values are so different?

Regards,

0 Likes

Hi,

1. Please check if you are using Direct mode for Fsw setting.

2. Use IDAC auto calibration to see the correct IDAC settings

3. What is the PSoC 4 device you are using?

4. Fsw setting is incorrect in your case. Please check if your sensors are getting charged and discharged correctly. The equations good only if the sensors charge and discharge completely.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes
lock attach
Attachments are accessible only for community members.
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Bragadeesh-san,

1. Please check if you are using Direct mode for Fsw setting.

=> We are setting AUTO. so We may be using Direct mode.

2. Use IDAC auto calibration to see the correct IDAC settings

=> We have "Enable IDAC auto-calibration" and "Enable compensation IDAC" settings.

  Therefore, "Modulator IDAC" and "Compensation IDAC" are grayed out on Launch Tuner of PSoC Creator.

3. What is the PSoC 4 device you are using?

=> CY8C4147AZI-S453

    We use PSoC Creator 4.2 and CapSense v5.0

4. Fsw setting is incorrect in your case. Please check if your sensors are getting charged and discharged correctly. The equations good only if the sensors charge and discharge completely.

=> Do you know the specific confirmation method to judge as correct or incorrect?

Regards,

0 Likes

Hi MaMi_1205306​ - san,

Please switch to direct mode for measuring the absolute sensor Cp. Once the Cp measurement is complete, calculate the maximum Fsw that can be set that satisfies the below condition:

Fsw max < 1/ 10 RC , where R = 560 + 500 ohms (External series resistor + Internal resistance), C is the parasitic capacitance of the sensor.

Please validate that the Fsw you have set completely charges and discharges the sensor capacitance. You can also confirm this by probing the sensor pin and checking the charging and discharging waveform of the sensor.

After Fsw is set according to the above equation, program the device and launch Tuner to see the IDAC codes set.

If you do not have a Tuner interface, use the CapSense_GetParam() API to check the IDAC value. Refer component datasheet for details. Use the Export Register Map option to check the correct param ID for the IDAC for each widget. A snapshot of the register map is shown below:

pastedImage_1.png

In the same way, you can see the IDAC gain set also by passing the right param ID from the register map.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes