3 Replies Latest reply on Jul 11, 2020 3:57 AM by ShAk_4697856

    CCG3PA switch to type-C only source

    ShAk_4697856

      Hello,

       

      Background

      I am working with a CCG3PA, using the CY4532 EVK for prototyping, modifying the provided PA/CLA firmware. In my application, I need to be able to modulate power delivered to an attached USB-C sink device, depending on external power conditions. This is accomplished by either changing source capabilities (for PD capable sink devices) or modulating Rp (for non-PD, Type-C only sink devices). My application does not support USB-A or BC1.2 devices.

      For the most part I am able to achieve this and everything is working as expected.

       

      The Problem

      In some circumstances, I would like to cancel an existing negotiated contract with a PD capable sink device and revert to modulating power using Type-C current only.

      I know this may seem like an odd requirement. This is to support certain known sink devices that draw more than the PD negotiated current, due to errors in their PD implementation. For these devices, 5V current can instead be modulated appropriately via Type-C/Rp. These types of port partners can only be identified once a PD contract has already been established.

       

      Essentially, for certain devices, I would like to send a Hard Reset (or simulate a disconnection) and then proceed as if the CCG3PA is not a PD capable source, modulating power only via Rp, until a disconnect event is received. Sending a Hard Reset to cancel the existing contract is straightforward, however, I'm unsure how I should prevent the CCG3PA from automatically re-negotiating a new PD contract afterwards.

       

      In order to prevent the CCG3PA from negotiating a new PD contract after the Hard Reset I have tried calling one of these functions:

      • pe_disabled()
      • dpm_disable()

      I have tried calling one or both of these functions at these times:

      • prior to sending Hard Reset
      • upon receipt of APP_EVT_HARD_RESET_SENT in sln_pd_event_handler()
      • upon receipt of APP_EVT_HARD_RESET_COMPLETE in sln_pd_event_handler()

       

      In all cases, the CCG3PA always re-negotiates a new PD contract. It's as if the pe/dpm are automatically being re-enabled sometime after the Hard Reset.

       

      If I call dpm_typec_command(port, DPM_CMD_PORT_DISABLE, NULL) then the port seems to be disabled altogether and calling it again with DPM_CMD_SET_RP_DFLT, DPM_CMD_SET_RP_1_5A and DPM_CMD_SET_RP_3A have no effect.

       

      How can I use Type-C only (Rp) to communicate source current capabilities, even when the sink port partner is PD capable?

       

      TIA

        • 1. Re: CCG3PA switch to type-C only source
          ShifangZ_26

          Hi ,

           

          1. dpm_disable() is the correct API to enable Type-C only and disable power delivery SPEC.

          2. Since you sent Hard reset on CC line, all of PD/Type-C controller shall be reset and start dpm_start() after reset, so that you need make sure dpm_disable() have been recalled after hard reset and dpm_start() is not called. Recommend you add some condition in main() and distinguish the difference conditions.

           

          Best Regards,

          Lisa

          • 2. Re: CCG3PA switch to type-C only source
            ShAk_4697856

            Hi Lisa,

             

            Thank you for your help.

             

            As you suggested, I have tried not calling dpm_start() in main() when I want to disable PD protocol and use Type-C (Rp) only. This prevents the CCG3PA from sending Source_Capabilities and initiating a PD contract, as desired.

             

            Unfortunately, if I don’t call dpm_start() then Rp is not asserted either and the following calls have no effect:

            dpm_typec_command(0, DPM_CMD_SET_RP_DFLT, NULL);

            dpm_typec_command(0, DPM_CMD_SET_RP_1_5A, NULL);

            dpm_typec_command(0, DPM_CMD_SET_RP_3A, NULL);

             

            It seems as though it is necessary to call dpm_start() to support asserting/changing Rp, in order to act as a Type-C only source.

             

            Another technique I thought of, to prevent a PD contract from being negotiated, is to still call dpm_start(), but first call dpm_update_port_config(ctx->port, 1, 1, 0, 0), to disable Try.SRC. Unfortunately this results in a linker error. Apparently dpm_update_port_config() is no longer supported by the CCGx Power SDK, even though it’s declared in dpm.h. I am using the latest CCGx Power SDK, version 3.4.

             

            Any help you can provide in getting the CCG3PA to perform as a Type-C only source, while disabling PD protocol would be greatly appreciated.

             

            Best,

            Shea

            • 3. Re: CCG3PA switch to type-C only source
              ShAk_4697856

              Hi Lisa,

               

              I have an update.

               

              I was able to resolve the linker errors related to dpm_update_port_config() by doing the following:

              • #define CCG_SOURCE_ONLY                            (0u)
              • link against libccg3_pd3 (instead of libccgx_pd3_src)
              • resolve additional linker errors by adding empty definitions for psnk_set_voltage(), psnk_set_current(), psnk_enable(), psnk_disable()

               

              Unfortunately, calling dpm_update_port_config(port, 1, 1, 0, 0) before calling dpm_start(), to disable Try.SRC, still does not prevent the CCG3PA from negotiating a source PD contract.

               

              Thank you for your help.

               

              Best,

              Shea