Hi, I'm evaluating a solution for a 1 ms reading using the SDADC driver provided with the SPC Studio (SPC58NE). I found this check in the code, that sometimes causes a missing reading. I add a comment with the SFR register that I'm currently using.
uint8_t sdadc_lld_read(SDADCDriver *sdadcp, float* converted_value) {
int16_t data;
uint8_t return_value = SDADC_DATA_NOTVALID;
/* check if valid data is available */
if (sdadcp->sdadc->SFR.B.DFEF == 0U) /* <- Check if the FIFO is not empty */
/* if (sdadcp->sdadc->SFR.B.CDVF == 1U) */ /* <- Check if data is valid */
{
/* read converted data */
data = (int16_t)((uint16_t)sdadcp->sdadc->CDR.R);Is it right to check the DFEF (which is related with the FIFO) and not the CDVF (valid data)?
