Other Parts Discussed in Thread: TPS659037
Please see the following function in pdk_am57xx_1_0_6\packages\ti\board\src\idkAM571x\device\pmic_device.c:
uint32_t Board_GetPMICOffset(uint32_t voltOffset, pmic_data_t *pmic) { uint32_t offsetCode; offsetCode = (26 + ((voltOffset - 700)/10)) & 0x7F; return offsetCode; }
The calculation of offsetCode does not take into account the following information from the TRM: "In some cases, the AVS Class 0 voltage that is read from the CTRL_CORE_STD_FUSE_OPP_VMIN_xxx_y registers has a value between two incremental voltage steps of the power supply. If such a case occurs, the higher voltage value should be selected." The TPS659037 step size is 10 mV, so the correct calculation would be:
offsetCode = (26 + ((voltOffset - 700 + 9)/10)) & 0x7F;
Note that this is consistent with how the offset is calculated in PmhalTps659037VoltageToVselOffset() in the PM LLD (pdk_am57xx_1_0_6\packages\ti\drv\pm\src\pmhal\prcm\pmhal_tps659037.c):
/* The vsel is always chosen to be greater than equal to the AVS
* voltage.
*/
*vsel = (((voltage - regulator->minVolt) + (regulator->stepVolt - 1U)) / regulator->stepVolt) + regulator->minVoltVsel;
Best regards,
Dave