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.

TMAG5173-Q1: AFE CHECK Test Execution Time

Part Number: TMAG5173-Q1

Tool/software:

Hello,

I am testing this sensor for AFE CHECK.

The execution time is 200us according to safety manual. But I get wrong result in that time. I need to wait at least 500us to complete conversion and get correct results.

I am trying to minimize the test execution time. Where am I doing wrong?

Config Registers

0xCCU, //DEVICE_CONFIG_1

0x00U, //DEVICE_CONFIG_2

0x40U, //SENSOR_CONFIG_1

0x00U, //SENSOR_CONFIG_2

AFE CHECK Code

uint16_t w_TMAG5173_checkAFE(tmag5173_t *ps_tmag)
{
  //6.3.7 Analog Front-End (AFE) Check (SM#7) 200 μsec
  int16_t i_adcp[3] = {0}, i_adcn[3] = {0};
  uint16_t w_status = 0U;

  //positive AFE
  v_TMAG5173_setMagChannelsTrig(ps_tmag, TMAG5173_MAG_CH_XYZPAFE);
  //DEVICE_DELAY_US(500U);
  while(w_status == 0U)
  {
    i_adcp[2] = i_TMAG5173_getResultZ(ps_tmag);
    w_status = ps_tmag->aw_values[2] & 0x01U;
  }

  if(w_status != 0U)
  {
    v_TMAG5173_getResultXY(ps_tmag);
    i_adcp[0] = i_TMAG5173_calcResult16(ps_tmag->aw_values[0], ps_tmag->aw_values[1]);
    i_adcp[1] = i_TMAG5173_calcResult16(ps_tmag->aw_values[2], ps_tmag->aw_values[3]);
  }

  //negative AFE
  v_TMAG5173_setMagChannelsTrig(ps_tmag, TMAG5173_MAG_CH_XYZNAFE);
  DEVICE_DELAY_US(500U);

  i_adcn[2] = i_TMAG5173_getResultZ(ps_tmag);
  w_status = ps_tmag->aw_values[2] & 0x01U;
  if(w_status != 0U)
  {
    v_TMAG5173_getResultXY(ps_tmag);
    i_adcn[0] = i_TMAG5173_calcResult16(ps_tmag->aw_values[0], ps_tmag->aw_values[1]);
    i_adcn[1] = i_TMAG5173_calcResult16(ps_tmag->aw_values[2], ps_tmag->aw_values[3]);
  }

  return w_TMAG5173_checkAFE_Limits(ps_tmag, i_adcp, i_adcn);
}

  • Hi Mesut,

    Thank you for posting to the Sensors forum!

    From your current register configuration, it looks like you have conversion averaging enabled and set to 8x averaging. The 200us time for the AFE check does not take into account the additional time it takes for the conversion averaging to take place.

    If your biggest care about is reducing time, I would recommend reducing the conversion averaging to 1x averaging to ensure that it only takes 200us seconds for the conversion to complete. 

    Best,

    ~Alicia