2021-06-06 07:28 PM
The M41T62 driver provided in STSW-M41T62 appears to have an error related to calibration of positive adjustments. Refer to the code below from line 750 of M41T62.c
The sign parameter is 0 or 1. To program the M41T62 for positive compensation requires programming the control register bit 5 with a logical 1. The code does not do this as it effects only bit 0 of the control register.
I suggest adding the following code at line 758:
sign = sign <<5;
M41T62_Error_et M41T62_Set_SignForCalibration(M41T62_SignCalibrationStatus_et sign)
{
uint8_t tmp;
M41T62_assert_param(IS_M41T62_CALIBRATION_SIGN(sign));
if(M41T62_ReadRegs(M41T62_CALIBRATIONREG, 1, &tmp))
return M41T62_ERROR;
tmp &= ~M41T62_SIGN_CALIBRATION_MASK;
tmp |= ((uint8_t)sign);
if(M41T62_WriteRegs(M41T62_CALIBRATIONREG, 1, &tmp))
return M41T62_ERROR;
return M41T62_OK;
}
2021-06-18 02:39 AM
Hello @GWitt and welcome to the Community :)
Thanks for pointing out this issue.
I added the right topics "Analog and Audio" to your post in order to increase its chance to be reviewed by our Analog experts.
I will try to contact expert internally and I will come back to you with details.
Imen
2021-06-18 05:31 AM
Hi @GWitt ,
I've heard back from the Analog team, and they said that the M41T62 driver has been discontinued and is unfortunately no longer supported by ST.
Thank you for your understanding.
Imen