Seems like this is used for Dithered PWM, but the only period
I could find used was 48, so does not explain commented duty
cycle. Unless someone else can explain download ap note and you
will get an email indicating who is now the "owner" at Cypress of
the ap note, and reply to them asking the question.
Or file a CASE -
To create a technical case at Cypress -
“Create a Case”
You have to be registered on Cypress web site first.
I will do
in your avatar a star is missing!
A star? What does a bass-loudspeaker has to do with a star? Or am I too short-sighted to recognise something else?
Leo2, did tech support get back to you, if so what
was the answer ?
The reply from technical support:
Q: I am reading the code of this project but can not find out why the #define HILIMIT 0x1600 means /*45% duty cycle*/ . in the LiIonCharger_H sourcefile. What is the relationship between the 0x1600 and the 45%.
A: User defined Dithered PWM is been used here.
HILIMT = 0x1600
You can see in ChargerProtocol.c
-----> DitheredPWM_1_SetPeriod(48); /* Generates 500KHz frequency */
And in DitheredPWM_1_DitheredPWM.c
-----> DitheredPWM_1_PWMDuty = DitheredPWM_1_Duty>>8;
So what we got here is Period = 48
And Duty Cycle = 0x1600>>8 = 0x16 = 22
Thereby duty cycle in percentage = 22/48 ~= 45%
I hope this answers your query. Please let us know if you have any additional queries regarding this issue. We will be glad to assist you.
Thanks for your and Jobin's help.
BTW, I have tried to update my photo in profile, but failed. Thanks for your mention.
Thanks for posting the tech support answer.