2 Replies Latest reply on Aug 25, 2009 11:36 PM by tom.hunter

    How to get more then one button to work with CSD

    tom.hunter
              I have created a 4 button application using a CY8C24894-24LFX. Why can I see raw count values changing for button0 but all other buttons remain at a static raw count of 255. The C source is:   
         
      void main()   
      {   
      M8C_EnableGInt;   
      CSD_Start();   
      CSD_InitializeBaselines();   
      CSD_SetDefaultFingerThresholds();   
         
      while (1)   
      {   
      CSD_ScanAllSensors();   
      CSD_UpdateAllBaselines();   
      CSD_bIsAnySensorActive();   
      for (i = 0; i < CSD_ButtonCount; i++)   
      {   
      printRawCount(i, CSD_waSnsResult    );
      }
      printNewLine();
      }
      }

      Why don't I see the CSD_waSnsResult values changing for i > 0?

      Thanks

      Tom
        • 1. Re: How to get more then one button to work with CSD
          pmad
                  Hi Tom,   
             
          CSD_waSnsResult is an array which should be accessed CSD_waSnsResult    format. If you are doing it correctly and the raw counts for other sensors is stuck at FF value then it means that your sensors has saturated. Try tuning your board as per the attached tuning guidelines and let me know whetehr it helps or not.
          • 2. Re: How to get more then one button to work with CSD
            tom.hunter
                    Hi Pushek,   
               
            Thanks for your help. The problem was indeed that the sensors where staturated.   
               
            I have been trying your calibration flowchart, but don't get a good signal to noise ratio.   
               
            The prototype I am working with uses an ITO touchscreen and using 12 bit resolution I get raw counts of about 0xA00 and when touched about 0xA10 - 0xA18. This is using the CSD User Module on a CY8C24894. I have been trying different Prescaler Periods, Comparator Ref Values and Scan Speeds, Rb and Cmod values. The best I get is a touch value of about 0x10 - 0x18 from the baseline.   
               
            Any ideas?   
               
            Best regards   
               
            Tom Hunter