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.

How to update TRIM values for LPOMONCTL Register

Other Parts Discussed in Thread: TMS570LS0432, HALCOGEN

Hello Support,

For TMS570LS0432 device, I want to update the TRIM values from OTP in the LPOMONCTL register.

The OTP data at 0xF008_01B4 for HFLPO_TRIM and LFLPO_TRIM are shown as 8 bits.

But LPOMONCTL Register shows as 5-Bits of DATA.

Is it that upper 3 bits of OTP TRIM Values are always ZERO and shall be ignored?

Thank you.
Regards
Pashan

  • We received your question and our expert will get back to you soon.

    Regards,

    Haixiao

  • The upper 3bit of OTP trim value is 'don't care' since those 3bit in the trim register is "read returns 0, writes have no effect". Here are some example code from HalCoGen:

    #define LPO_TRIM_VALUE       (((*(volatile uint32   *)0xF00801B4U) & 0xFFFF0000U)>>16U)

    void trimLPO(void)
    {

    /* USER CODE BEGIN (4) */
    /* USER CODE END */

        /** @b Initialize Lpo: */
        /** Load TRIM values from OTP if present else load user defined values */
        if(LPO_TRIM_VALUE != 0xFFFFU)
        {
       
            systemREG1->LPOMONCTL  = (1U << 24U)
                                    | LPO_TRIM_VALUE;
        }
        else
        {

         systemREG1->LPOMONCTL  = (1U << 24U)
                                     | (16U << 8U)
                                     | 8U;
        }

    /* USER CODE BEGIN (5) */
    /* USER CODE END */

    }