About CSR settings

Trackpads, buttons, sliders, or touch screens PSoC can do them all. This is the forum for CapSense.

Moderator: TedTsui

About CSR settings

Postby quipu on Mon Mar 12, 2007 2:54 am

I all.
I'am trying to test the CY3212-CapSense demo board with
Plastic (Nylon) Overlay Thickness of 3 mm.

To calibrating CSR User Module, I started form AN2355
and AN2397.
Basing on AN2397 Projets (CSD_3213), I modified project
to adapt to CSR User Module instaed of CSD User Module.
With the following settings:
CSR_SetDacCurrent(5,CSR_DAC_LOW);
CSR_SetScanSpeed(3);

I can see, with MultiChart applicaton, the attached immages:
1 - NoFingerPresent.bmp
2 - FingerPresent.bmp

In case 1 the value of Signal (CSR_waSnsDiff for button 0)
is from 200 to 1600, while in the case 2 le value of signal
is from 200 to 2100.

How I sets noise and finger thresholds?
Why the values of signal oscillate so much?

Thanks.

Software version:
- PD 4.3 build 1884
- SP1 build 162
- SP2 build 305
- CY24x94 build 128
- CY20x34 build 394
- CYRF69xx3 build 228
- EP NewUMs build 221
- +UM:SDCARD
- +UM:USBUART
- +UM:CSD
Code: Select all
//----------------------------------------------------------------------------
// C main line
//----------------------------------------------------------------------------

#include <m8c.h> // part specific constants and macros
#include "PSoCAPI.h" // PSoC API definitions for all User Modules
#include "TX8.h"

//#define BOTTON_NUM CSR_BUTTONS_EXIST
#define BOTTON_NUM 0x1

// Keeps track of button press status
BYTE prev_buttons = 0;

void Scan_Buttons()
{
   // Scan all sensors starting from sensor 0
   CSR_StartScan(0,BOTTON_NUM,CSR_SCAN_ONCE);
   // wait till all the scans are complete
   while(!(CSR_bGetScanStatus() & CSR_SCAN_SET_COMPLETE));

   CSR_bUpdateBaseline(0);
}

void main()
{
   M8C_EnableGInt;

   CSR_Start();
   //Set DAC current for all button
   CSR_SetDacCurrent(5,CSR_DAC_LOW);
   //Set scan speed for all button
   CSR_SetScanSpeed(3);

   TX8_Start();

   while (1) {
      //Scan all sensors starting with sensor 0
      Scan_Buttons();

      TX8_PutCRLF();
      TX8_Write((char *) (CSR_waSnsResult), BOTTON_NUM*2);
      TX8_Write((char *) (CSR_waSnsBaseline), BOTTON_NUM*2);
      TX8_Write((char *) (CSR_waSnsDiff), BOTTON_NUM*2);
      TX8_PutChar(0);
      TX8_PutChar((CHAR)0xFF);
      TX8_PutChar((CHAR)0xFF);
   }
}
Attachments
MultiChart_Images.rar
(66.99 KiB) Downloaded 184 times
User avatar
quipu
Newbie
Newbie
 
Posts: 9
Joined: Thu Aug 10, 2006 12:07 am

Postby graaja on Mon Mar 12, 2007 3:19 am

DAC current setting of 5 is too low. This may result in too slow an oscillation which is causing this problem. Start midway with a setting of 0x80 and adjust the DAC current accordingly to get a raw count of 300.
User avatar
graaja
PSoC Master
PSoC Master
 
Posts: 3078
Joined: Thu Dec 18, 2003 4:35 pm
Location: India

Postby quipu on Mon Mar 12, 2007 3:56 am

Thank for reply.

I setted DAC current to 0x20. Now I can see with Multichart application a Raw count of approximately 300.

The average value of Signal (CSR_waSnsDiff) varies from approximately 60 to 80 respectively without and with the finger.

I attached new captured diagram.
Now, how I sets noise and finger thresholds?

Regards.
Attachments
MultiChart_Images_DAC_0x20.zip
(52.57 KiB) Downloaded 162 times
User avatar
quipu
Newbie
Newbie
 
Posts: 9
Joined: Thu Aug 10, 2006 12:07 am

Postby graaja on Mon Mar 12, 2007 5:31 am

You are only through the first step. 300 counts is not good enough to get a good signal to noise ratio or to detect the presence of the finger. Now set the SetScanSpeed to a high value so that you can get a high raw count of 3000 or 4000 without the finger. Try a scan speed of 15 to 20.

After doing this, now log the raw counts without finger. Find the max and min counts. Divide the difference by 2. Multiply this by 1.2. This will be the noise threshold. For example if you have max and min values of 3200 and 3140, the noise threshold would be 36 (1.2 * (3200 - 3140)/2).

Find the difference counts when the finger is present. Set the finger threshold to 80% of the difference counts.
User avatar
graaja
PSoC Master
PSoC Master
 
Posts: 3078
Joined: Thu Dec 18, 2003 4:35 pm
Location: India

Postby quipu on Mon Mar 12, 2007 7:33 am

After some test the values for Scan Speed to obtain a raw count
from 3000 to 4000 is from 12 to 15. I set to 13.

Now I readed this values for raw count:
1) No Finger:
* Max Counts = 3396;
* Min Counts = 2896;
2) Finger:
* Max Counts = 3619;
* Min Counts = 2896;

If I use the formula I obtain 300 as noise threshold that is out of range for this parameter.
I not understand why the diffrence between min and max is too wide.
Any suggestion.
User avatar
quipu
Newbie
Newbie
 
Posts: 9
Joined: Thu Aug 10, 2006 12:07 am

Postby graaja on Mon Mar 12, 2007 8:15 am

The signal to noise ratio of your design is very poor. This could be because of physical reasons. Make sure that there is no air gap between the overlay and the board. Even if there is slight air gap, you can see very high noise in the counts.
User avatar
graaja
PSoC Master
PSoC Master
 
Posts: 3078
Joined: Thu Dec 18, 2003 4:35 pm
Location: India

Postby quipu on Tue Mar 13, 2007 12:05 am

According to you, I can resolve the problem passing from the CSR to the CSD?

Regards,
quipu
User avatar
quipu
Newbie
Newbie
 
Posts: 9
Joined: Thu Aug 10, 2006 12:07 am

Postby graaja on Tue Mar 13, 2007 1:00 am

Definitely. CSD is much better than CSR in terms of noise handling. In CSD also, you will have to fine tune the value of Rfb to get the best results.
User avatar
graaja
PSoC Master
PSoC Master
 
Posts: 3078
Joined: Thu Dec 18, 2003 4:35 pm
Location: India

Postby quipu on Tue Mar 13, 2007 1:18 am

Thank you, very much and best Regards
User avatar
quipu
Newbie
Newbie
 
Posts: 9
Joined: Thu Aug 10, 2006 12:07 am

About CDS settings

Postby quipu on Fri Mar 23, 2007 5:09 am

Hello Ganesh,

I acquired a CY3213-capsense training board.
I ported projects to transmit CSD_waSnsResult, CSD_waSnsBaseline and
CSD_waSnsDiff of seven buttons over serial line (with external RS232 transceiver) and I use Multichart applications from AN2397 to view data.
I also have overlay of various thickness.
The overlay's material is what I would want to use to construction
of keypad's covering.

Can you suggest which are the fundamental steps for calibration, or
some documents ?

Regards
Attachments
MultiChart_without_overlay.JPG
Button zero data with or without finger and without overlay
MultiChart_without_overlay.JPG (38.74 KiB) Viewed 3135 times
User avatar
quipu
Newbie
Newbie
 
Posts: 9
Joined: Thu Aug 10, 2006 12:07 am

Postby ander45 on Fri Mar 23, 2007 2:11 pm

Calibration isn't as necessary with CSD, because it doesn't use the IDAC. Try 16-bit resolution, normal scan speed, reference = ASE11, ref value = 2. You should have enough SNR with the overlay you are using. If not, you may need to increase Rb to 5k or greater, and/or set ref value lower.

Erik
Cypress CapSense
User avatar
ander45
Newbie
Newbie
 
Posts: 4
Joined: Thu Oct 26, 2006 7:15 am
Location: Lynnwood, WA


Return to CapSense

Who is online

Users browsing this forum: No registered users and 1 guest