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

DAVE™ Forum Discussions

User5327
Level 4
Level 4
Hi Infineon,
I think that I found the error in file CCU8PWMLIB.c (which is generated for PWMSP002 - which I using in my project)

Description:
I wanted capture contents of Timer ... but I using 2 slices (Timer concatenation).
And in Final result is only lower 16 bit! => contents of upper 16 bit(second slice timer) is not added

... In program I using "PWMSP002_GetTimerRegsVal" function ... this function then call "CCU8PWMLIB_GetTimerRegsVal"
function ... and in this function is error ... there is calculation for TimerReg:
...
ScndSlTMRVal = (RD_REG(HandlePtr->CC8yRegs1Ptr->TIMER,
CCU8_CC8_TIMER_TVAL_Msk, CCU8_CC8_TIMER_TVAL_Pos) << 16UL);
TimerRegsPtr->TimerReg = (uint32_t)((ScndSlTMRVal << 16UL) |
(RD_REG(HandlePtr->CC8yRegsPtr->TIMER,
CCU8_CC8_TIMER_TVAL_Msk, CCU8_CC8_TIMER_TVAL_Pos)));


=> contents of second slices timer is shifted twice

fix could be following:
ScndSlTMRVal = (RD_REG(HandlePtr->CC8yRegs1Ptr->TIMER,
CCU8_CC8_TIMER_TVAL_Msk, CCU8_CC8_TIMER_TVAL_Pos) << 16UL);
TimerRegsPtr->TimerReg = (uint32_t)((ScndSlTMRVal /* << 16UL */) |
(RD_REG(HandlePtr->CC8yRegsPtr->TIMER,
CCU8_CC8_TIMER_TVAL_Msk, CCU8_CC8_TIMER_TVAL_Pos)));


Best regards,
Koumak
0 Likes
1 Reply
Not applicable
Hi Koumak,

Thank you very much for your feedback. A change request was submitted (eTicket ID: 30478400). Will update you once fixed.

Best regards,
Sophia
0 Likes