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.

adc result F28377D

Hi all,

Do you know if the ADC results of the 28377D are 16-bit long integer number? if so in the 12-bit single ended ADC are the first (from left to right) 4 bits always zero?

Assuming I need to convert the integer ADC result into a voltage, do I need to execute some bit wise operations first?  my understanding is that I don't have to, since the results have already the first 4 bits set to zero.

Thank you very much.

Leo

  • Hi Leo,

    You need to check whether ADC is configured in 12-bit mode or 16-bit mode first. If in 12-bit mode you can extract only 12-bits from a 16-bit variable by using ">>4"

    Regards,
    Gautam

  • Thanks Gautam, 

    I have configured the ADC in 12-bit mode. I am using ADC-B Channel 4. When I check the ADC result in the memory buffer I display hex numbers as in the picture I have attached.

    It does not look like I have to perform any bit shifting operation, since the first four bits (from left to right) are already zero.

    If this is not correct, could you please let me know?

    Thank you

    Leo

  • HI Leo

    You are correct, in 12 Bit mode the result registers are right aligned, so the 4 most significant bits are always 0. No bit shift / masking needed.

    Roger

  • Thank you Roger for pitching in - in my absence :)

    Regards,
    Gautam