PSoC4 scan time in CSD and CSX modes

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

cross mob
AlDS_4485821
Level 2
Level 2
First like given

How does one calculate the scan time per sensor in CSD and CSX mode?

In CSD i did find a equation.

Scan Time   = (2 ^ Resolution  - 1) / Modulator Clock

So if I put in resolution as 8 here, and modulator clock of 24Khz I get a scan time of 10ms per sensor.

I  have to scan a large number of sensors some thing like 60+ and want to get as low a scan time per sensor as possible.

Also if an equation for the CSX mode can be provided it would be helpful.

TIA

0 Likes
1 Solution
BrandonP_16
Employee
Employee
5 sign-ins First question asked 10 solutions authored

Hi TIA,

For CSD,

The scan time equation is right, but the modulator clock value is wrong. I think 24MHz is right value (CapSense cannot support 24kHz modulator clock. So, one CSD sensor scan time is 11us.

For CSX,

The scan time equation is          Scan Time = Number of  sub-conversions / Tx clock frequency.

For example, Number of  sub-conversions is 100 and Tx clock frequency is 300kHz, then one CSX sensor scan time is 333us.

You can get the sensor scan time easily in CapSense component "Scan Order' tap.

pastedImage_2.png

Thanks,

Brandon

View solution in original post

15 Replies
BrandonP_16
Employee
Employee
5 sign-ins First question asked 10 solutions authored

Hi TIA,

For CSD,

The scan time equation is right, but the modulator clock value is wrong. I think 24MHz is right value (CapSense cannot support 24kHz modulator clock. So, one CSD sensor scan time is 11us.

For CSX,

The scan time equation is          Scan Time = Number of  sub-conversions / Tx clock frequency.

For example, Number of  sub-conversions is 100 and Tx clock frequency is 300kHz, then one CSX sensor scan time is 333us.

You can get the sensor scan time easily in CapSense component "Scan Order' tap.

pastedImage_2.png

Thanks,

Brandon

My Bad!

I was referring to

pastedImage_0.png

and I mistook 24000 to 24Khz.

Your feedback is highly appreciated.

Many Many thanks for the CSX resourses.

I guess that screenshot where you show the CSX settings is from PSoC creator, correct? I'm just starting off  with Cypress controllers so am not so well versed with the tools.

So for a matrix scan of 8TX and 8RX, I mean a  matrix of 64 keys would the sub-conversions be considered as 64? so that would be 64 / 300,000 = 213uS.

So is 213uS the whole matrix scan time?

0 Likes

Hi TIA,

No, the Number of sub-conversion(NoC) means how many Tx pulses are used for one sensor in CSX. NoC is used like scan resolution in CSD and key factor of touch sensitivity (Trade-off: Scan time vs. Touch sensitivity)

In above my example, I set the NoC to 100 for one sensor scan, not 100 sensors.

I summarized the total scan time for 64 intersections in matrix buttons with default setting parameters.

1. Using CSX = 100 / 300kHz * 64(nodes) = 21mS

2. Using CSD = (2^12-1)/24M * 24(sensors) = 4mS (with 8-bit resolution settings, 256uS)

* CapSense supports up to 32 intersections (32 keys) in one widget for matrix button. Therefore, you should use two matrix button widgets.

So, 24 sensors are scanned in CSD (= 2 * (8-row_sensor + 4_column_sensor)),

and 64 nodes are scanned in CSX (= 2* (8 Tx * 4 Rx)).

Thanks,

Brandon

0 Likes

Many Thanks again Brandon,

I'm starting to get the hang of the CapSense peripheral.

From what I gather based on you descriptions I would need 2 widgets configured as CSX type and each will handle 8x4 matrix.

1. I didn't understand the CSD part what were you trying to highlight here? I mean in addition to the two 8x4 CSX matrix that will used up 24 I/Os. we can also use the CSD mode ?

2. I see that in PSoC Creator, there is a fixed sequence of scan order. Where the scanning starts from Rx0, Tx0 and goes on till Rx3,Tx7? Can we get more control over this scanning. I mean if I want to scan only a subset of Rx and Tx is that possible?

3. The scanning time for a single key in matrix mode comes to 333 uS. Is there any way to quicken this like get it to around 100uS or less? Get similar performance like the CSD mode in CSX mode?

4. Is it possible to get pressure sensing and also some level of proximity sensing with multiple key press detection in CSX mode?

TIA

0 Likes

Hi TIA,

Please refer below comments for your questions.

1. I do not know your exact design but, CSD can support the matrix button design. In addition, using the sensor ganging feature, you can reduce the I/O to 16. (Two 8(row) x 4(column) matrix button with row sensors sharing.)

For details of CSD matrix button, please refer this document (Rev.*X, page 23).

AN64846 - Getting Started with CapSense®

2. The scan order as you can see the CapSense component means when you command the all sensor scan. You can also scan independently what you want.

3. It depends on touch sensitivity in your module. If the sensitivity is good, scanning time could be more faster.

4. In CSX mode, proximity cannot be supported.

For pressure sesing, I do not understand what you want to design, do you want to distinguish the normal touch and touch with pressure? or detecting pressure levels/steps?

Thanks,

Brandon

Many thanks again for the extended reply!

1. I read in a Cypress document that CSD doesn't detect multiple key presses at the same time. Is that true? it's for that reason that I selected CSX.

2. Ok, agreed. I guess for this I don't need to configure the peripheral in the GUI, just write the code in the C file, correct?

3. How do I calculate the relation between scan time per sensor and resolution, of finger press.

4. Detect Pressure level.

0 Likes

Hi TIA,

Here are my answers.

1. I think the matrix button with CSD doesn't matter to detect in the same time. For the trackpad design, CSD can be matter for the multi-touch. Can you scrap and share the document as you read for multiple touch detection?

2. Yes, CapSense supports the C code APIs for scanning, all sensors or specific sensor.

3. The scan time equation is "Scan Time = (2 ^ Resolution  - 1) / Modulator Clock" as you know. (The sensitivity is related with resolution and modulator clock frequency.)

4. If you want to detect the pressure level, you should design additional force sensors in HW.

Thanks,

Brandon

0 Likes

BrandonP_16 wrote:

Can you scrap and share the document as you read for multiple touch detection?

Hi,

pastedImage_1.png

Please have a look at the screenshot, Its an excerpt form "Getting started with Capsense"

So would this mean that CSD based sensing in not suited for matrix keypad?

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

llo AlDS_4485821

Yes. This is true. CSD cannot detect multiple touches as "Ghost touches" will be observed. As an example, if you touch two switches at the same time, two rows and 2 columns will be active, resulting in four button presses detected by the microcontoller. This is the reason we recommend CSX for multi touch applications.

Is you require pressure sensing, please consider the inductive sensing feature "MagSense" which is available in PSoC 4700S device. This will allow you to detect the pressure applied on the sensor by the deflection of the metal surface on top.

Best regards

Hari

So how does the matrix connections work in CSD mode, lets say the rows are connected to the capsense pins where will the columns be connected, and how would the scan be performed?

I'm trying to understand how these ghost touch occurs, from what I understand sensors are scanned one at a time.

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello AlDS_4485821

So the matrix buttons in CSD has a set of "row sensors" and "column sensors". Lets say you have a 4x3 matrix button configuration (12 buttons in total). There will be 3 row sensors and 4 column sensors.

pastedImage_0.png

If you touch the first button (Button (1,1)), then the row 0 sensor will be active and column 0 sensor will be active. This corresponds to the first button and therefore, the assumption is correct. This works for any such case where only one button is pressed.

Now consider a situation where you are pressing button (1,1) and button (2, 3)

pastedImage_1.png

Now, row 0 reports a button active and row 1 reports a button active. while scanning the column, col0 and col2 report button presses. Their intersection is button (1,1), button (1,3), button (2,1) and button (2,3).

pastedImage_2.png

This is ghost touch effect. 4 buttons are detected as being pressed while only 2 buttons are pressed.

This is the reason CSD is not recommended for matrix button where there is a possibility of multiple button presses.

Thanks and regards

Hari

Many thanks for the detailed explanation.

However I still don't get it for the CSD (self capacitance) matrix scanning part.

i understand that in CSX (mutual capacitance) each capacitor is sampled one at a time so no ghosting effect takes place?

Since I don't have a electrical diagram I don't know how this is done in CSD, is the whole ROW or column sampled at the sampled at the same time? 

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi AlDS_4485821

Yes, in CSD the whole row is scanned at once and then the whole column is scanned. The intersection points of active row and column (where difference in capacitance is observed) is then used to detect which buttons are active.

This is the reason for ghost effect.

Thanks and regards

Hari

0 Likes

Is there any document that describes how the CSD scanning works for in matrix mode?

Does the currrent flow sequencially through all the sensors in the row? and then current flows sequencially in the columns?

Or is there a simultaneous current flow?

TIA

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi AlDS_4485821

You can refer the CapSense design guide  for details on matrix button.

There is no simultaneous sensing in CSD implementation of matrix button. The row is sensed and then the column.

Thanks and regards

Hari

0 Likes