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.

SD16 Input Range Overflow Detection

Other Parts Discussed in Thread: MSP430F47196

Hello,

I am using an MSP430F47196's SD16 to measure mains voltages. The problem I am having is that if the input goes above or below the maximum range of the SD16 (~+-32768), the resulting ADC values do not clip, but fold over. This could happen because of a short term interference spike and I would like to ignore these overrange readings and clip the results to the maximum or minimum values in software for that time. Is there any way to detect in software that the input has overflowed?

Regards

Chris

  • I am still struggling with this. I am considering to add some code to try to predict the ADC values entering a band close to the positive and negative extremes and waiting for the polarity to change suddenly, then clipping the results until the ADC values are outside that band again.  This makes assumptions on the maximum rise time of the signal and seems overly complicated and error prone to me.

    Is there no easier and more reliable way of dealing with this?

  • Hi Chris!


    Are you sure that the result rolls over? I can't remember the SD16 doing so - although I do not know at the moment. This would be a little bit weird. Which data-format do you use? Offset binary or 2's complement. I would suggest you are using 2's complement because you talk about +/-32768. By the way it is -32768 to +32767. Can you show some calculations you are doing with the ADC result?

    Dennis

  • IIRC, the SD16 has a result register that is larger than 16 bit. Based on a control bit, the result register returns the upper or lower 16 bit of the result. However, the bits partly overlap depending on OSR value. You may read both value and combine them, or, in case of large voltages, use just the upper 16 bit, or on low voltages, use only the lower 16 bit. It depends on application.

**Attention** This is a public forum