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.

Formula for calculating output digital code of SD16_A ADC in MSP430F4784

Other Parts Discussed in Thread: MSP430F4784, MSP430P325

Hello All,


I am using MSP430F4784 in my application.


I want to know the formula for calculating output digital code of SD16_A ADC in MSP430F4784.

It is not mentioned in MSP4304x family user guide.

Thank you,


Sunil

  • SUNIL SAWANT said:
    I want to know the formula for calculating output digital code of SD16_A ADC in MSP430F4784.

    I am afraid that it is not clear what you are looking for. Please explain in details what you mean by asking for " formula for calculating output digital code "

  • e.g.,

    For MSP430P325, the digital code (decimal) expected within any one range is:

    Ntyp = INT(((Vin x 2^14) / Vref) - (2^13 x ACTL.10) - (2^12 x ACTL.9))

    I need a similar formula for expected digital code (decimal) for SD16_A in MSP430F4784.

    so that i can verify obtained results with calculated results.

  • You shall read two chapters of SD16_A User's guide:

    30.2.2 Analog Input Range and PGA

    and

    30.2.8 Conversion Memory Register: SD16MEMx

    subchapter: Output Data Format

  • I read the sections in user guide you have mentioned in your reply.

    But my question is still unanswered.

    If analog input voltage is not equal to +Vfsr, then how do i calculate the output digital code (decimal) of SD16_A.

    It is not mentioned in user guide, then how to interpolate digital codes between 0 to +Vfsr?

    I will explain you with an example.

    e.g.,

    If Vref = 1.2V, PGA Gain = 1, then +Vfsr = 0.6V,

    Now if analog input voltage (Vin) = 0.3V, then what would be the output digital code (decimal) ?

    or if analog input voltage (Vin) = -0.3V, then what would be the output digital code (decimal) ?

  • SUNIL SAWANT said:
    But my question is still unanswered.

    Mentioned chapters have all the information needed to do the calculation yourself. And I am not your assistant :)

    SUNIL SAWANT said:

    Now if analog input voltage (Vin) = 0.3V, then what would be the output digital code (decimal) ? or if analog input voltage (Vin) = -0.3V, then what would be the output digital code (decimal) ?

    As you mention both positive and negative input voltages, supposedly you want to use bipolar mode. In bipolar, offset binary mode input/output relation is -Vfsr = 0x000 and +Vfsr = 0xFFFF. Don't you see how to calculate? - At least try...

  • Hey...

    My point was i have not got the expected answer.

    I never asked any accountability from you. It is an open forum. Those who know MSP430 architecture well are free to write answers to questions voluntarily without obligations.

    Anyways thank you for your replies to my question.

  • SUNIL SAWANT said:
    Anyways thank you for your replies to my question.

    Please understand me right - sitting here I can't see you are unable to do the math or you just don't wish to. If you are still stuck having no idea - then say so and if not me then somebody else perhaps will write formula for you :)

  • Using your earlier reply, i have used proportionality formula for calculating output digital code (decimal) of SD16_A.

    i.e., For Vfsr = 0.6V, if output digital code = 0xFFFF,

    then for Vin = 0.3V, output digital code = (0.3/0.6) x 0xFFFF = 0x7FFF

    Generalising the formula:

    Output Digital Code = (+Vin / +Vfsr) x Full Scale Digital Code

  • SUNIL SAWANT said:

    i.e., For Vfsr = 0.6V, if output digital code = 0xFFFF,

    then for Vin = 0.3V, output digital code = (0.3/0.6) x 0xFFFF = 0x7FFF

    This is right for unipolar output where voltage span is 0.. +Vfsr.

    For bipolar output of bipolar input (-Vfsr .. +Vfsr) formula is different. You shall look at "Figure 30−7. Input Voltage vs. Digital Output" closer.

  • For bipolar output, bipolar input signal:

     

    1.     When bipolar output format is 2's complement binary:

    Case 1:   Input is positive, output digital code = (+Vin / +Vfsr) x 0x7FFF

    Case 2:   Input is negative, output digital code = (-Vin / -Vfsr) x 0x8000

     

    2.     When bipolar output format is offset binary:

    Case 1:   Input is positive, output digital code = (+Vin / +Vfsr) x 0xFFFF

    Case 2:   Input is negative, output digital code = 0x8000 - ((-Vin / -Vfsr) x 0x8000)

**Attention** This is a public forum