Post Go back to editing

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. 

Parents
  • 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

Reply
  • 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

Children
  • 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.

  • 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. 

  • 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

  •  

    • readback for the 5V measurement is 0xA6 7707 E9
    • How can I measure the reference voltage? ad-swio module uses the external reference with the ADR4525, it's selected by a jumper.
    • Now there is a problem, after I wrote 0xFFFF to ALERT_STATUS register, when I read from it this is the result: 0xAE 3000 9D, maybe a NOP frame is needed?
    • I got different patterns, which means it's not stable, but these results are so close to each other, the results are always between 4.6V and 4.7V. Here are some examples of the results I got: A6 7718 B4, A6 7723 15, A6 7721 1B, A6 7714 90, A6 76FC 13, A6 76F5 2C, A6 76F8 0F.

    Thank you.

  • Thank you 

    • Yes, A6.... makes more sense, thanks.
    • Is there any way for you to hook a meter to the pin of the jumper to measure the reference voltage? (I don't suspect that the reference is the issue here, but it is worth checking to make sure it's correct)
    • Can you double check that you allow at least 10ms after power up before accessing the SPI and double check that the reset pin is pulled high at all times (unless you are trying to do a reset)
    • If you successfully write 0xFFFF to the ALERT_STATUS after power-up or reset, I would expect all bits in the ALERT_STATUS register to be 0 when you read back its contents. Reading back 0x3000 suggests that the device has just exited a reset sequence. I wonder if all the writes are being executed correctly? Would you mind checking that you can do consecutive successful reads & writes to the SCRATCH register (0x45). (Try writing 0xAAAA and 0x5555 to exercise all bits). The ADC results do seem to be consistent. Is anything else connected to the I/OP terminal, other than your voltage source? 

    Thanks,

    Bríde

  • Hello,

    The problem is solved, I just changed the supply source, 5V measurement is 5.02V and 3.3V is 3.29V.

    Thank you for your support.

  • Glad to hear it is resolved. 

    Regards,

    Bríde