CCG2+NCP81239 car charger reference design source code

Announcements

Live Webinar: USB-C adoption. Simple & Cost-efficient solutions | April 18th @9am or 5pm CEST. Register now !

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
WiCh_3149431
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

Hi, rajath bhargav:

You had released the CCG2+NCP81239 car charger reference design source code to me around July, 18. My application has a MCU to control CCG2 and NCP81239 through CCG Host Processor Interface(HPI). My question is the source code you released to me include HPI or not ? I did not find relative files. How do I add HPI to the source code, or you can release me the source code include HPI? I already got HPI document through NDA flow. Thanks.

William Chen/ROIN Technology Co., Ltd.

0 Likes
1 Solution
RajathB_01
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

Hi William,

By default, HPI in the source code is disabled, since CCG2 has a small flash and inclusion of HPI might leave less space for customization.

If you can optimize your code and include HPI, you can enable it in this location -

Firmware\SDK\CYPD2134-24LQXI_PA_NCP82139\CYPD2134-24LQXI_PA_NCP82139.cydsn\src\pd_common\usbpd.h

In the 'usbpd.h' file, you find this:

/* HPI Configuration

* HPI_SUPPORTED

* HPI_NOT_SUPPORTED

*/

#define HPI_CONFIGURATION                  (HPI_NOT_SUPPORTED)

You have to change (HPI_NOT_SUPPORTED) to (HPI_SUPPORTED)

After this you can build your application as before and program the device. Be sure to optimize the code and not run out of flash size.

Best regards,

Rajath

View solution in original post

0 Likes
11 Replies
RajathB_01
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

Hi William,

By default, HPI in the source code is disabled, since CCG2 has a small flash and inclusion of HPI might leave less space for customization.

If you can optimize your code and include HPI, you can enable it in this location -

Firmware\SDK\CYPD2134-24LQXI_PA_NCP82139\CYPD2134-24LQXI_PA_NCP82139.cydsn\src\pd_common\usbpd.h

In the 'usbpd.h' file, you find this:

/* HPI Configuration

* HPI_SUPPORTED

* HPI_NOT_SUPPORTED

*/

#define HPI_CONFIGURATION                  (HPI_NOT_SUPPORTED)

You have to change (HPI_NOT_SUPPORTED) to (HPI_SUPPORTED)

After this you can build your application as before and program the device. Be sure to optimize the code and not run out of flash size.

Best regards,

Rajath

0 Likes

Thanks, Rajath. I will try it. By the way, the CCG2 60W car charger reference design use CYPD2134-24LQXI, can I replace with CYPD2122-24LQXIT, are they compatible in hardware and firmware at car charger reference design?

0 Likes

Hi,

2122 will have DRP application, which means it supports alternate mode and can be negotiated for sinking power. On the other hand 2134 is only for providing power. Though you can use 2122 in place of 2134, it will have less space for customization. Hence it is recommended to use 2134.

Regards,

Rajath

0 Likes
WiCh_3149431
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

Hi, Rajath:

I changed (HPI_NOT_SUPPORTED) to (HPI_SUPPORTED). But there are 2 error as attach screen capture during compile. How to fix them?

HPI_SUPPORTED_error.jpg

0 Likes

HI William!

Just a thought here: In our project we have both implemented a custom DC/DC IC and are using the HPI interface, but we are controlling the DC/DC directly from the CCG4 (in our case) using I2C. IMHO it will be very complicated to control the DC/DC through the HPI since I'm not sure you get all the required events and it will be tricky to manage the state-machine between different ICs that you will have.

I think you should first really consider if it is not possible to control the DC/DC directly by the CCG2 via I2C as you have in the default source code for the car charger. Or you can use the I2C master block that is used to control the DC/DC and instead communicate to your MCU. Going via the HPI i/f will be a complicated strategy I believe.

Just 2 cents

Cheers

Olof

0 Likes

Hi, Olof:

You did not answer my question. I need to know how to fix these two compile error?

0 Likes

I compile with (HPI_NOT_SUPPORTED), generate two hex file, there are CYPD2134-24LQXI_PA_NCP82139.hex and cc_boot-pa.hex. I program by CY8CKIT-002 MiniProg3 to CCG2+NCP81239 reference design with CYPD2134-24LQXI_PA_NCP82139.hex file, the CCG2+NCP81239 reference design do not work, program with cc_boot-pa.hex, the CCG2+NCP81239 reference design only output with 5V 0.5A power rail, what was I mistake?

CCG2 5V 0.5A only.jpg

0 Likes

Hi, Rajath:

Could you give me the hex file for the latest version FW of CCG2+NCP81239 reference design for I program the reference design and make it work normal?

0 Likes

Hi William,

1. I guess Rajath have shared latest SDK project to you before as per your description in this thread, so the latest HEX file you have already on your hands. You can get it after you build the project with PSoC Creator 3.3 DP1 without any changes. I also attached it for your reference. Or you can use the HEX attached in the link: http://www.cypress.com/documentation/reference-designs/ccg2-60w-car-charger-reference-design 

2. As per your description about the test results after programmed cc_boot-pa.hex , the Type-C port have 5V/500mA out on your end after attached Type-C device. If you could like to debug why 5V voltage on VBUS, I would like recommend you to test below points:

Pin#15 of CCG2 (J13) : Check whether it is HIGH or LOW. If you only programmed bootloader file, this point shall be unstable states.

Pin#19 and pin#20 of CCG2 (J12): Check whether there is I2C interactions under this condition.

3. For your original concerns about HPI.

>> The SDK project for CYPD2134 is not enabled HPI. If you want to enable HPI, to be more convenience,  recommend you use CYPD2122 example project, the HPI have been enabled. Please kindly noticed CCG2+NCP81239 car charger reference design have additional I2C master in the project.

>> If you want to try to disable HPI in CYPD2122 to see what is difference, you can refer link: Simple CCG2 example firmware for power bank

Best Regards,

Lisa

0 Likes

Hi, Lisa:

1. It is strange that I program several times on last Friday, the CCG2+NCP81239 do not work, but today it become normally.

2. The two compile error with HPI_SUPPORTED also disappear.

Thanks

William

Hi William,

I am glad to hear that the issue was resolved.

I have been met some issue if the compiler setting is not correct. Just for your reference.

Best Regards,

Lisa