3 Replies Latest reply on Oct 30, 2011 1:07 PM by vikram._21

    How to disable shield electrode thru firmware? (CY8C21534B)

    amin.kamarulzaman

      Hi All,

         

      I'm designing a capsense application with shield electrode implemented for CY8C21534B.

         

      I saw in one of the documentation saying that it is recommended to "drive the shield only during a scan, additional code in the firmware is needed". Will someone help to share with me the code that was meant for this function?

         

      I'm guessing it is the CSD_DisableSensor function... but need comfirmation or other option (if any).

         

      ===========================================================================

         

      CSD_DisableSensor

         


      Description:
      Disables the sensor selected by the CSD_wGetPortPin() function. The drive mode is changed to
      Strong (001). This effectively grounds the sensor. The connection from the port pin to the Analog-
      MuxBus is turned off. The function parameters are returned by CSD_wGetPortPin() function.

         

      ===========================================================================

         

       

         

      Thanks!

        • 1. Re: How to disable shield electrode thru firmware? (CY8C21534B)
          pushekm_21

          When a shield signal is routed on the hatch pattern then the signal is always driven whether sensor is scanned or not because the shield signal is a free running clock. You can stop this clock by using a couple of additional line of codes, here is a code snippet:

             

           

             

          //Configure the drive mode to Strong

             

          PRT1DM2 |= 0x80;

             

          PRT1DM1 |= 0x80;

             

          PRT1DM0 &= ~0x80;

             

          CSD_ScanAllSensors();

             

          //Configure the drive mode to High Impedance Analog

             

           

             

          PRT1DM2 &= ~0x80;

             

          PRT1DM1 &= ~0x80;

             

          PRT1DM0 |= 0x80;

             

           

             

          Best regards,

             

          Pushek

          • 2. Re: How to disable shield electrode thru firmware? (CY8C21534B)
            amin.kamarulzaman

            Thanks. I check in the technical reference, I think you interchanged between Strong and High Impedance Analog... will you please confirm? I assume the example below is for Port 1 pin[7] right?

               

             

               

            //Configure the drive mode to Strong

               

            PRT1DM2 &= ~0x80;

               

            PRT1DM1 &= ~0x80;

               

            PRT1DM0 |= 0x80;

               

             

               

            CSD_ScanAllSensors();

               

             

               

            //Configure the drive mode to High Impedance Analog

               

            PRT1DM2 |= 0x80; 

               

            PRT1DM1 |= 0x80;

               

            PRT1DM0 &= ~0x80;

            • 3. Re: How to disable shield electrode thru firmware? (CY8C21534B)
              vikram._21

               Yes,the code snippets have been intergchanged for strong and high impedance analog mode.

                 

              The below code sets the mode for P1.7 (Port 1pin[7])

                 

               

                 

              //Configure the drive mode to Strong

                 

              PRT1DM2 &= ~0x80;

                 

              PRT1DM1 &= ~0x80;

                 

              PRT1DM0 |= 0x80;

                 

               

                 

              CSD_ScanAllSensors();

                 

               

                 

              //Configure the drive mode to High Impedance Analog

                 

              PRT1DM2 |= 0x80; 

                 

              PRT1DM1 |= 0x80;

                 

              PRT1DM0 &= ~0x80;