This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS3137: TMS570LS3137: pbistSelfCheck() wait for 32 VBUS clock cycles

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hello,

We used HALCOGEN version 4.7 tool to generate code fo TMS570LS3137. pbistSelfCheck() function has a for loop to wait for 32 VBUS clock cycles (Below is the code snippet). i would like to understand How this for loop is waiting for 32 VBUS clock cycles?

Can you please help me in understanding this?

/* wait for 32 VBUS clock cycles at least, based on HCLK to VCLK ratio */
/*SAFETYMCUSW 134 S MR:12.2 <APPROVED> "Wait for few clock cycles (Value of i not used)" */
/*SAFETYMCUSW 134 S MR:12.2 <APPROVED> "Wait for few clock cycles (Value of i not used)" */
for (i=0U; i<(32U + (32U * 8U)); i++){ /* Wait */ }

 

Thanks,

Kalyan

  • Hi Kalyan,

    As described in the comment, the for-loop waits for atleast 32 VBUS clock cycles.

    Kalyan Vagvala61 said:
    for (i=0U; i<(32U + (32U * 8U)); i++){ /* Wait */ }

    Here the value 8U is based on the HCLK to VCLK ratio which is configurable using the VCLK1 divider value. 

    Regards,

    Akshay