8 Replies Latest reply on Nov 24, 2020 11:39 PM by AH_96

    Design guidelines to use capsense tuner with custom board

    JeSi_4326976

      Hi,
      on my last custom board, I only had a 5 pin SWD programmer connector, and another i2c connector to communicate with a psoc devkit

       

       

      I believe there was no way to directly use capsense tuner with this board. However, for my next iteration, I would like to do so! I would like to know my options, but it is not very clear. Can I do it with a miniprog4 programmer? I also have CYUSB232 and CYUSB234 chips, I don't know if creating a usb connector is a possibility?

       

      Thank you!

        • 1. Re: Design guidelines to use capsense tuner with custom board
          AH_96

          Hi JePI_3825071

           

          Can I do it with a miniprog4 programmer?

          Yes, this would be the easiest way to have tuner running. You can connect the SDA and SCL lines to that of the miniprog4 and use Tuner directly from PSoC creator. You don't need a secondary PSoC kit.

           

          CYUSB232 is a USB-UART bridge and will work only with the asynchronous Tuner communication, it would be better to use CYUSB234 for synchronous I2C communication.


          Synchronous communication will help in setting the parameters directly from the Tuner and avoids the need to reprogram. It eliminates any spikes in the raw count reading due to error in reading.

           

          Best regards,

          Hari

          1 of 1 people found this helpful
          • 2. Re: Design guidelines to use capsense tuner with custom board
            JeSi_4326976

            Very good,
            that means I should be able to use the tuner with my old design, right? I tried connecting my I2C lines to the kitprog4, but the kitprog doesnt seem to be recognized by the tuner UI, no matter what is connected to it

             

            The kit is plugged in and the device is powered, but nothing appears on the tuner!

             

            • 3. Re: Design guidelines to use capsense tuner with custom board
              RiOD_2845421

              Don't connect the I2C SDA and SCL to the 5-pin connector (as you show in the image above).

              The MiniProg3 would allow that, but the MiniProg4 does not.

              The MiniProg4 connects I2C via pins 2 and 4 of the 12-pin connector.

              • 4. Re: Design guidelines to use capsense tuner with custom board
                JeSi_4326976

                RiOD_2845421
                Nice! I should have noticed this... I tried something sketchy since I do not have a 12pin connector on my custom board. I connected the pins to 2-4 of the connector, but it unfortunately doesn't work.

                I do get extra info that the kitprog i2c and spi are recognized now, however, so this is good news!

                 

                Is it possible to do some kind of wire arrangement with the onboard 5pin swd connector and a i2c connector with the kitprog4 12pin connector, or there is nothing I can do until I design my nect iteration with the 12pin connector on board? thanks!

                • 5. Re: Design guidelines to use capsense tuner with custom board
                  AH_96

                  Hi JePI_3825071,

                   

                  You can see under port information that the error is caused as the port cannot be opened by tuner. There is some other application that is acquiring the MiniProg. Please check if there is any other application that is acquiring the port, could be PSoC programmer, bridge control panel or even another Tuner instance that might be open.

                   

                  Please close the other applications and try again.


                  Best regards,
                  Hari

                  1 of 1 people found this helpful
                  • 6. Re: Design guidelines to use capsense tuner with custom board
                    JePI_3825071

                    Hi,

                    I am not the correct receipt for this discussion.

                    Regards,

                    Jean-Christophe

                     

                     

                    De : AH_96

                    Envoyé : lundi 23 novembre 2020 05:40

                    À : PIQUET Jean-Christophe

                    Objet : You have been mentioned by AH_96 in Re: Design guidelines to use capsense tuner with custom board in Cypress Developer Community

                     

                    <http://www.cypress.com>

                     

                    Cypress Developer Community <https://community.cypress.com/?et=notification.mention>

                     

                     

                    You have been mentioned

                     

                    by AH_96<https://community.cypress.com/people/AH_96?et=notification.mention> in Re: Design guidelines to use capsense tuner with custom board in Cypress Developer Community - View AH_96's reference to you<https://community.cypress.com/message/259175?et=notification.mention#259175>

                    • 7. Re: Design guidelines to use capsense tuner with custom board
                      JeSi_4326976

                      Hi,

                      The problem was PSoC programmer acquiring the port as you mentioned...
                      I still can't read my device but I am one step further. I seem not be sending the right i2c packets to the tuner. Now I can setup my i2c settings in the tuner, but I get the "cannot read from device" error when trying to connect, even though I setup my i2c exactly as my i2c block in the topDesign. I am not sure I do what is needed in my software. I use the Capsense_RunTuner() API in my loop, but nowhere do I assign my i2c block to it, so I am not sure if I am actually sending the packets through my i2c pins. I wonder if I have to tell psoc creator somehow I am not using predetermined i2c pins that would be defined somewhere and normally linked to the kitprog i2c-usb on a development kit...

                       

                      I attached my project just in case.. Thank you!

                      • 8. Re: Design guidelines to use capsense tuner with custom board
                        AH_96

                        Hi JeSi_4326976,

                         

                        The issue is due to incorrect set up of I2C parameters. For running tuner, you need to configure an EzI2C slave - PSoC cannot be the master. Tuner acts as the master. Please refer any CapSense CE for this.

                         

                        I also want to point out that you need to use CapSense_ProcessAllWidgets API instead of UpdateAllBaseline for the new component and it is recommended to execute CapSense_RunTuner between CapSense_ProcessAllWidgets and CapSense_ScanAllWidgets.

                         

                        An example firmware flow:

                            /* Start the EZI2C component to tune CapSense sensors */  
                            EZI2C_Start(); 
                            
                            /* Set the CapSense data structure as the I2C buffer to be exposed to the 
                             * master on primary slave address interface. Any I2C host tools such as the
                             * Tuner or the Bridge Control Panel can read this buffer but you can 
                             * connect only one tool at a time.
                             */
                            EZI2C_EzI2CSetBuffer1(sizeof(CapSense_dsRam), sizeof(CapSense_dsRam),
                                                    (uint8_t *)&(CapSense_dsRam));
                            
                        
                        
                            /* Start the CapSense block */
                            CapSense_Start();
                            
                            /* Scan all the enabled widgets */
                            CapSense_ScanAllWidgets();
                            
                            for(;;)
                            {
                                /* Initiate a new scan only if the CapSense block is idle */ 
                                if(CapSense_NOT_BUSY == CapSense_IsBusy())
                                {
                                    /* Performs full data processing of all enabled widgets */
                                    CapSense_ProcessAllWidgets();
                                    
                                    /* Sync with the Tuner application to fetch the latest CapSense  
                                     * parameters and update back the sensor data such as rawcount,
                                     * baseline etc.
                                     */
                                    CapSense_RunTuner();
                                    
                                    /* Scan all enabled widgets */
                                    CapSense_ScanAllWidgets();
                                }
                            }
                        

                         

                        Best regards,
                        Hari

                        1 of 1 people found this helpful