AD74413R error margin in voltage input mode

Hello,

I configured the AD-SWIO 2 Click Channel A as voltage input, I've put 5V as voltage input between the screw terminals. When I read data from the READ_SELECT register, and apply the equation on the datasheet page 34, the result is around 4.6V, is this normal? how to get more accurate data?

Thank you. 

  • 0
    •  Analog Employees 
    on Sep 20, 2021 8:24 AM

    Hi,

    No, this is not normal.  You should contact the MikroE support team to report this and get the necessary support. 

    Meanwhile, I can help to confirm that the device is configured correctly. Can you read & print here the contents of the following registers, for the channel that you are using. 

    CH_FUNC_SETUP:

    ADC_CONFIG:

    ADC_CONV_CTRL:

    ADC_RESULT:

    Also, the readback select register is the pointer to the register that you want to read from. So, can you confirm that you are reading from the ADC_RESULT register and not the READ_SELECT register?

    Thanks,

    Bríde

  • Hello,

    These are the frames sent to the module :

    Data_Send_ALERT_STATUS[4] = {0x2E, 0xFF, 0xFF, 0x4B} 

    Data_Send_CH_FUNC_SETUPx[4] = {0x01, 0x00, 0x03, 0x62}

    Data_Send_ADC_CONFIGx[4] = {0x05, 0x00, 0x00, 0xC0}

    Data_Send_ADC_CONV_CTRL[4] = {0x23, 0x02, 0x01, 0xD3}

    Data_Send_ADC_RESULTx[4] = {0x41, 0x00, 0x26, 0x1F}

    Then : 

    HAL_GPIO_WritePin(SPI3_CS_GPIO_Port, SPI3_CS_Pin, GPIO_PIN_RESET);
    HAL_SPI_Receive(&hspi3, Data_Receive, 4, 500);
    HAL_GPIO_WritePin(SPI3_CS_GPIO_Port, SPI3_CS_Pin, GPIO_PIN_SET);

    I add Data_Receive to the watch 1 and this is its content : 

    0x46 7707 E9 

    When I convert 7707 to decimal and use it in the equation provided in the datasheet on page 34 the result is 4.65 V.

    Thank you.

  • 0
    •  Analog Employees 
    on Sep 20, 2021 11:06 AM in reply to KhalilTR

    Thank you for sending this information.

    The configuration writes look correct to me. Your use of the equation also looks correct. 

    Can you try a different voltage on the I/OP screw terminal and report back the corresponding ADC_code, please? It would help to show a pattern in the error.

    Also, please also submit this issue on the MikroE forum at this link: Forum

    Thanks,

    Bríde

  • Hi,

    I tried 3V on the I/OP screw terminal and the result is 0xA6 53EE 82, which corresponds to 3.27V, again there is an error margin, I will submit this issue on the MikroE forum. 

    Thank you. 

  • 0
    •  Analog Employees 
    on Sep 20, 2021 11:37 AM in reply to KhalilTR

    Thank you. 

    There does not seem to be a pattern to the data: one result is too high, the other too low. 

    A few more questions: 

    • Can you double check that the readback for the 5V measurement is 0xA6 7707 E9 and not 0x46 7707 E9? 
    • Do you have access to measure the reference voltage on REFIN?  It would be good to confirm that the reference is correct.
    • Can you read the contents of the ALERT_STATUS register? It would be good to see if there are any alert conditions present
    • Are the results you get repeatable? - if you measure the same voltage 10 times is the result stable?

    Thanks,

    Bríde