cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

MaMi_1205306
Honored Contributor

Hi,

The PSoCLP CapSense component datasheet includes the following:


We understand the relationship between scan speed and resolution scan speed and resolution.

 

For example,

CapSense input clock : 24MHzScan Speed : Fast

Divides the component input clock by 2 = 12MHz

 

What does this frequency indicate?
Is it a digital circuit clock?

Is this clock is "Clock from UDB"?

Regards,

0 Likes
Reply
1 Solution
Hari
Moderator
Moderator

Hello MaMi_1205306

This clock frequency indicates the modulator clock frequency that is provided to the counter. The scan time of a widget is calculated as (2^N - 1)*mod_clk_frequency, where N is the resolution of the widget.

This is a digital clock and is derived from MASTER_CLK.

You can check the Clocks tab in design wide resources for more details on the clock source.

Thanks and regards

Harigovind

View solution in original post

0 Likes
Reply
16 Replies
Hari
Moderator
Moderator

Hello MaMi_1205306

This clock frequency indicates the modulator clock frequency that is provided to the counter. The scan time of a widget is calculated as (2^N - 1)*mod_clk_frequency, where N is the resolution of the widget.

This is a digital clock and is derived from MASTER_CLK.

You can check the Clocks tab in design wide resources for more details on the clock source.

Thanks and regards

Harigovind

View solution in original post

0 Likes
Reply
MaMi_1205306
Honored Contributor

Thank you for your reply.

We have calculated the formula you have been taught.

(2^N - 1)*mod_clk_frequency

For example,

Resolution : 13bit

Master clock : 48MHz

Scan clock input for Clock settings : 24MHz

Mod clk frequency : fast = 24MHz / 4 = 6MHz

Scan time = ( 2^13 - 1 ) * 24MHz / 4 = 4.9 * 10^10

If the frequency is calculated in terms of time,

6MHz = 167ns,

Scan time= 1.37ms

However, the PSoC Creator display is 1.405ms,
It is 1400us (1.400ms) in the data sheet.

What is the effect of this difference?

Regards,

0 Likes
Reply
Hari
Moderator
Moderator

Hello MaMi_1205306

The scan time shown in this tab includes scanning time and estimated setup and pre-processing time. If you check, the difference between the calculated value and the value shown in the tab is 0.041ms. This is the estimated setup and pre-processing time of the sensor.

Please note that this value is the approximate sensor scan time and the actual value might be slightly different. This is given in the "Total Scan Time" section in the component datasheet.

pastedImage_0.png

Do let us know in case of any further queries.

Thanks and regards
Harigovind

0 Likes
Reply
MaMi_1205306
Honored Contributor

Harigovind-san,

It turns out that the scan time is determined by the speed of the Mod frequency.
I thought that the RAW count would not change even if the scan time changed.

Scan Speed : Raw count
NOMAL : 6612
FAST : 6537

The RAW count value changes as described above.
Do you understand this factor?

Is setup and pre-processing time affected?

Regards,

0 Likes
Reply
Hari
Moderator
Moderator

Hi MaMi_1205306

The Mod clock is the input to the counter which actually produces the count value that is interpreted as raw counts. Therefore, changing the mod cock frequency will result in a difference in raw counts.

The setup and pre-processing time are generally not affected. This can be observed as the difference in theoretical calculated value of scan time and the scan time shown in component configuration window remains same even when scan speed is varied. However, the actual time might be slightly different based on factors such as Cp.

Thanks and regards

Harigovind

0 Likes
Reply
MaMi_1205306
Honored Contributor

Faster Mod clock shortens scan time,
Is it correct to understand that the raw count value will decrease?

Because we have large fluctuations in power
I would like to take measures by slowing down the scan time.
However, I don't understand the relationship between scan time and raw count.

1. Power on sysytem
2. Initialize the baseline
3. Long press the Caos sensor
4. Release finger from the Caps sensor

The RAW count does not return to the "2. Initialize the baseline" because the power supply voltage has dropped when the finger is released.
Since the DIFF value (= RAW - Baseline) is large, there is a problem that the baseline does not follow.

Tuner Helper has no problem, but Bridge Contorl Panel can confirm the problem.
We understand that the longer the scan time, the less susceptible to power fluctuations.

0 Likes
Reply
Hari
Moderator
Moderator

Hi MaMi_1205306

Raw counts are not directly related to mod clock frequency. Raw counts are proportional to the resolution, sense clock frequency, parasitic capacitance of the sensor, reference voltage and inversely proportional to Imod.

The scan time is calculated as the time required for the counter to reach the maximum counts (2^N -1) with a particular mod clock frequency. Therefore, while there will be slight variations in raw counts when mod clock is changed, we cannot establish a direct relationship.

In the CSD component, there is an option for sensor auto reset (in advanced tab). This causes the baseline to always update. Please note that this limits the long press duration but solves the problem of high raw counts due to power fluctuations.

Thanks and regards
Harigovind

0 Likes
Reply
MaMi_1205306
Honored Contributor

Harigovind-san,

Auto reset cannot be used because there is a mode to use by pressing and holding the button.

pastedImage_0.png

The above description is in the data sheet.

It has been confirmed that if the scan speed is delayed, the raw count error due to the voltage fluctuation decreases.

Do you have a document that shows the relationship between scan speed and voltage fluctuation(IDAC)?

Regards,

0 Likes
Reply
MaMi_1205306
Honored Contributor

When reading various documents, we understand that "Scan Speed" is the discharge time.

We thought that the raw count would change greatly because the slew rate of the voltage drop during discharge was the same.

pastedImage_0.png

If it is the same period, the count of FAST will increase,
However, since the counting time of FAST is shortened, the count values are almost the same FAST and NOMAL..

Because it is "resolution - count of counter", The FAST and NOMAL raw counts are similar.

When the power supply voltage is high, the IDAC current will increase and the RAW count decrease.
When the power supply voltage is low, the IDAC current decreases and the RAW count increases.

FAST has low voltage amplitude. In other words, it is susceptible to changes in IDAC.
NOMAL has a large voltage amplitude. Therefore, it is hard to be affected by changes in IDAC.

Is it correct with the above recognition?

0 Likes
Reply
Hari
Moderator
Moderator

Hello MaMi_1205306

As long as the sensor charges and discharges completely (which is a requirement for correct operation of the device), the Cmod will be discharged to the same level. And moreover, the Cmod charging and discharging is determined by the sense clock frequency(not mod clock) and this is decided by the analog switch divider value that is set.

When the mod clock is set to a low value, the scan time increases and results in lower peak to peak noise. This is the reasoning behind the statement given in the component datasheet.

For the issue that you are facing, you can try to increase the noise threshold so that the baseline tracks even for slight change in the raw counts.

Please let me know the difference counts for a button press and the difference counts during the power change.

Thanks and regards

Harigovind

0 Likes
Reply
MaMi_1205306
Honored Contributor

Harigovind-san,

/* Scan Speed : Fast */

When the sensor is not pressed.

6536 at 4.7V

6357 at 5.0V

Raw count difference : 6536 - 6357 = 179

/* Scan Speed : Normal */

When the sensor is not pressed

6708 at 4.7V

6612 at 5.0V

Raw count difference : 6709 - 6612 = 97

For example,

It is initialized at 5V in fast of scan speed, baseline and raw count are 6357.

Press the sensor, raw count is up and baseline is stop.

Take finger off the sensor when the voltage is 4.7V, raw count is 6536,

However baseline is 6357.

In other words, the noise threshold must be set to 180 for Fast of scan speed.

> When the mod clock is set to a low value,

> the scan time increases and results in lower peak to peak noise.

> This is the reasoning behind the statement given in the component datasheet.

I think the reason you mentioned above is the reason why you are not affected by noise,

but we would like to know the cause and effect of fluctuations in power supply voltage.

(a )As the scan speed decreases, the scan time increases, so the charge and discharge times increase.

=> We understand the above.

(b) IDAC current changes when power supply voltage changes.

=> CapSense component data sheet also shows.

(c) Since the charge / discharge time becomes longer, it was considered less susceptible to changes in IDAC current.


This is shown in the previous diagram. Is this correct recognition?

Regards,

0 Likes
Reply
Hari
Moderator
Moderator

Hello MaMi_1205306

(a)  The charge and discharge time of the sensor (and Cmod) is not determined by scan speed. It is determined by Sense Clock Frequency. This parameter is set by choosing the Analog switch divider.

(b) Yes This is the correct understanding. It is the fluctuation in IDAC that appears as noise and results in incorrect raw counts.

(c) There will be more charge discharge cycles when the mod clock is set to low frequency. Hence the noise will average out and will result in lower peak to peak noise. The charge and discharge time (per cycle) will still remain same as long as the sense clock frequency is constant.

Thanks and regards

Harigovind

0 Likes
Reply
MaMi_1205306
Honored Contributor

I have new questions in your explanation.

The charge / discharge of the sensor ( Cmod ) is a sense clock, which is a fixed value of  ( Component Clock / Analog switch Divider ).
The scan speed is mod Clock, which is the component clock divided by each mode.
Of course, the component clock is constant.

It can be understood from the data sheet that the scan time changes when the scan speed is changed.

Assuming that one charge / discharge cycle is the same in the sense clock, If the scan time simply doubles, does the counter value also double?

It has been answered that the raw count value does not affect the mod clock.

Could you tell us more about this relationship?

0 Likes
Reply
MaMi_1205306
Honored Contributor

In your description below,

(c) There will be more charge discharge cycles when the mod clock is set to low frequency. Hence the noise will average out and will result in lower peak to peak noise. The charge and discharge time (per cycle) will still remain same as long as the sense clock frequency is constant.

"There will be more charge discharge cycles when the mod clock is set to low frequency"

"The charge and discharge time (per cycle) will still remain same as long as the sense clock frequency is constant"

We don't understand the two opposite meanings.

0 Likes
Reply
Hari
Moderator
Moderator

Let us assume your sense clock frequency is set to 1 MHz (For easy calculation), and the modulator clock frequency is set to 4 MHz with resolution being 16. The charge and discharge time per cycle will be 1 us (since sense clock frequency is 1 MHz).

The total scan time would be 16.38 ms (65535/4M). In 16.38 ms, there will be 16380 charge and discharge cycles of the sensor as a result of the sense clock frequency that is set. (0.01638 * 1M).

Now, if the mod clock frequency is set to 10 MHz, the total scan time will be 6.553 ms. In 6.553 ms, there will be 6553 charge and discharge cycles.

You can observe that in both cases, the charge and discharge time for the sensor is 1 us which is determined by the sense clock frequency, but the number of cycles is different.

Thanks and regards
Harigovind

0 Likes
Reply
Hari
Moderator
Moderator

Hi MaMi_1205306

The clock input to the counter, the output of which is raw counts, is mod clock. Scan time is defined by the time required for the counter to reach maximum count (2^N - 1). Hence, when the mod clock slows down, the counter's speed also slows. Hence the raw counts remain almost constant with change in mod clock frequency.

Thanks and regards

Harigovind

0 Likes
Reply