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.

TMS320F280049: External referencing with the ADC VREFLO limits.

Part Number: TMS320F280049


Hello,

I need to set ADC voltage limits for my project such that, if the value exceeds the VREFHI  value, it sets one condition. And if the input value if below the VREFHI value it sets another. Ideally, this would have been made a lot easier if I could use the VREFLO pin to set the reference voltage externally. However due to conflicting information in the reference manual and the datasheet, I'm not sure I can do that. The reference manual says that the VREFLO can be set externally. But the datasheet says that VREFLO values can only be connected to the VSSA pin, which is the analog ground pin. Yet again, in both these documents there is a mention of a signal mode, and the diagram shows an ADC signal between VREFHI and VREFHI/2 in the datasheet. So my question is simple:

1) Can I set the VREFLO pin to a value other than ground or 0?

2) If not, can I use two VREFHI values as upper and lower voltage references for my input signal in the same ADC module? If so, how will the interrupt  work? 

3) And if neither of the above, then how can I proceed?

Thank you.

  • Hi Utsav,

    The VREFLO must be connected to 0V w.r.t. VSSA.  

    In general, I'm not following how or why you intend to use multiple VREFHI voltages on the same ADC? If you want to detect if a signal is above or below some threshold using the ADC, you would just sample the signal and then make some decision in the ISR (or automatically using the post-processing block (PPB) limit compare functionality).  Furthermore, if it is just a single threshold that you want to detect, and speed of detection is important, the comparator module (CMPSS) will be faster (albeit a little less accurate).

  • Thank you so much for your quick reply Mr Cottier!

    To clarify, I am very new to microcontrollers. This is my first time trying to work with them, in fact! Which is why it took me sometime to understand the reference manual and subsequently the datasheet.

    I don't intend to use multiple VREFHI voltages. It was just one of the possibilities that ran through my head when I realized that I could not externally change the VREFLO value (perhaps it should be specified better  in the reference manual, rather than redirecting towards the datasheet as it can get a bit confusing, and I am not the first person to have this query towards the C2000 series). I do not understand the '0V connection wrt to VSSA concept' I'm afraid.

    I do want to just detect one threshold, but based on whether the value I'm monitoring is higher or lower than the threshold, I intend to program the microcontroller towards appropriate pulse delay actions, or at least an interrupt. Yes, the speed of comparison is important.  I am not entirely sure how the CMPSS module works, but I will have a look at it. 

    Thank you once again for your reply! I wish you a good day!

  • Hi Utsav,

    Some good resources to start would be the C2000 device workshops:

    https://training.ti.com/c2000-f28004x-microcontroller-workshop?context=1137791-1137780

    And the TI precision labs series on data converters:

    https://training.ti.com/ti-precision-labs-data-converters?context=1139747-1140267

    For an ADC, you'll almost always set the VREFHI and VREFLO to some static values that set the range of the ADC.  Let's say that these are 0V and 3.0V.  Each time the ADC converts the signal on its input pin, it will return a digital result corresponding to the applied input voltage.  The formula for this conversion is given in the TRM table "Analog to 12-bit Digital Formulas"

    For instance, if the applied voltage is 1.1V, the ADC output will be (1.1V/3.0V)*4096 = 1502

    If the applied voltage is 1.8V, the ADC output will be (1.8V/3.0V)*4096 = 2458

    So you'll want to figure out the digital result that corresponds to your threshold, then take an ISR after each ADC conversion to compare with the threshold. If the voltage threshold isn't in the 0 to 3.0V range, you'll need to use some method to get it into that range (e.g. a voltage divider + op-amp buffer or an op-amp to amplify and/or add an offset to the signal).  

    The ADC samples at discrete times when triggered, so the time between the signal crossing the threshold and detecting the crossing depends on the ADC sample rate. 

    The comparator module, on the other hand, uses an analog comparator which is constantly comparing the input to a specified threshold.  You don't get any information about the signal other than if it is above or below the specific threshold, but the trip from crossing the threshold is more-or-less immediate (<100ns).