3 Replies Latest reply on Jun 8, 2020 6:57 AM by ShifangZ_26

    How use controller CYPD3120 with its own firmware?

    NaMe_2085021

      Hello,

       

      Please help me. I want to write firmware for my own project. In my project I use controller CYPD3120. I tried boot my own firmware with help PSoC Creator by MiniProg3.

      You can view my schematic in attach. This  will use for control stepper motors.

       

      Thank you!

        • 1. Re: How use controller CYPD3120 with its own firmware?
          ShifangZ_26

          Hi ,

           

          1. I have reviewed the schematic you have attached, below is my comments for your reference:

          a. CYPD3120 is for Type-C to DisplayPort dongle application by default. And the firmware is match the hardware schematic(link: https://www.cypress.com/documentation/reference-designs/ez-pd-ccg3-usb-type-c-displayport-cable-solution  ). Which is meaning of this firmware is enabled below features:

          * Power sink only (5V/900mA)

          * DisplayPort sink (UFP_D) -- pin assignment C

          * USB billboard

          >> For your schematic, I found you just need a power sink only feature.

           

          b. The AUX_P/AUX_N of CCG3 just could configured as below pull-up/down resistors on AUX channel and disconnect/connect between SBU and AUX, you need make sure those three mode is the one you are looking for, especially AUX_P circuits on your schematic.

          --------------------------------------------------------------------------------------------------------------------------------

              AUX_1_1MEG_PU_RESISTOR = 9,                 /**< AUX1 1M0hm Pullup resistor. */

              AUX_1_100K_PD_RESISTOR = 10,                /**< AUX1 100KOhm Pulldown resistor. */

              AUX_1_470K_PD_RESISTOR = 11,                /**< AUX1 470KOhm Pulldown resistor. */

              AUX_2_100K_PU_RESISTOR = 12,                /**< AUX2 100KOhm Pullup resistor. */

              AUX_2_4P7MEG_PD_RESISTOR = 13,              /**< AUX2 4.7M0hm Pulldown resistor. */

              AUX_2_1MEG_PD_RESISTOR = 14,                /**< AUX2 1M0hm Pulldown resistor. */

          ---------------------------------------------------------------------------------------------------------------------------------

          Relates API is below:

          /*

          * @brief Configure SBU Switch

          *

          * This function CCG3's SBU Switch which can connect SBU1/2 to AUX1/2 or isolate

          * them.

          *

          * @param port PD port on which SBU switch is to be configured.

          * @param sbu1_state SBU1 switch state

          * @param sbu2_state SBU2 switch state

          *

          * @return CCG_STAT_SUCCESS or CCG_STAT_INVALID_ARGUMENT.

          */

          ccg_status_t sbu_switch_configure(uint8_t port, sbu_switch_state_t sbu1_state, sbu_switch_state_t sbu2_state);

           

          /*

          * @brief Configure AUX 1/2 resistor configuration

          *

          * This function controls AUX 1/2 resistor configuration.

          *

          * @param port PD port to be configured.

          * @param aux1_config AUX1 configuration

          * @param aux2_config AUX2 configuration

          *

          * @return Void

          */

          void aux_resistor_configure(uint8_t port, aux_resistor_config_t aux1_config,

                  aux_resistor_config_t aux2_config);

           

          For your question about how to use the CYPD3120 with his own firmware, you could get the CYPD3120 firmware from the link:

          https://www.cypress.com/documentation/software-and-drivers/ez-pd-sdk-v302-ccg2-all-applications-ccg3-cable-adapter

           

          After you installed the SDK above, you will have PSoC Creator 3.3, EZ-PD configuration Utility software on your computer and SDK firmware project and user guide of SDK and API. You coul get start from here.

           

          Kindly let me know if you have any concerns/updates.

           

          Best Regards,

          Lisa

          • 2. Re: How use controller CYPD3120 with its own firmware?
            NaMe_2085021

            Thanks for the help.

             

            I have questions about adjusting the voltage for the sink.

            For example, I want a voltage for the sink 15V, when you press the button, the sink required a different voltage from the source.

            Is this possible?

            • 3. Re: How use controller CYPD3120 with its own firmware?
              ShifangZ_26

              Hi ,

               

              It is possible if you have chance to customize the firmware project. You just need update the source_cap mask after CCG3 have been detect the press button.

               

              The API is:

              /**

              * @brief This function updates the source PDO mask at runtime thereby

              * overriding the source PDO mask in the config table.

              * @param port Port index.

              * @param mask PDO mask.

              * @return CCG_STAT_SUCCESS if operation is successful, CCG_STAT_BAD_PARAM

              * otherwise.

              */

              ccg_status_t dpm_update_src_cap_mask(uint8_t port, uint8_t mask);

               

              Best Regards,

              Lisa