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.

Is there ADC self-test source code available

Other Parts Discussed in Thread: HALCOGEN

I am now developing our project on TMS570 platform, In TRM, chapter 15.8.2 ADC self-test mode. As a ADC safety feature, It is for testing the ADC core. This feature is independent with application, So, do you have any source code for this feature ? Manually coding is hard for implementing table 15-5 "determination of ADC input channel condition" in TRM,  Could you share source code with customer? Thanks a lot.

  • Fumin Li,

    Find attached a code where the ADC self-test mode is exercised.

    Let me know if this helps.0268.MibADC_SelfTest.zip

    This is of use to check ADC pin failures.

    Let me know if you like to know more about this feature and anything in specific.

     

    Best Regards,

    Pratip

    TI AUTO MCU SOFTWARE

  • Hi Pratip, many thanks for your great help.

    But a bad news is that, after i go through the ADC self-test code, "the determination of ADC input channel condition" feature is not fully implemented, so , could you please be kindly enough sending me another demo code, i need fully implemented ADC self test feature in our project.  Thanks again.  maybe you can send me via email: fumin.li@siemens.com

    The following code is copied from your attached demo code, that is not i want:

    if(vn < vd)
     error = -1;

     if(vn > vu)
     error = -1;

       if(error != 0)
      pstatus = 1;
     else
      pstatus = 0;

  • Fumin Li,

    This was a sample code to start with. You may have to retrofit at the moment.

    I'll try and get some changes done ,and you can analise it and see if that helps.

     

     

  • Hi Pratip,

    Thanks for your great help. I'm highly expecting your updated complete code. Help to solve my problems ASAP, as my project schedule is very tight. Thanks again.

  • Fumin Li,

    Find attached the code.

    Refer to adc specification Table 2 Determindation of ADC input channel Condition to interpret the code completely.

    This  test is for only one pin ADIN0 , you may have to replicate it for the pins that you need.

    1018.MIBADC6_selfTest.c

     

  • Hi Pratip,

    Thanks for your quick response. After go through your update code, I think the attached table15-5 is not fully implement. I want to determine "Good", "shorted to ADREFHI", "ADREFLO", "Open". Could you please update your code to fully implement this table? Thanks so much. And by the way, in the attached table, is the ADREFHI and ADREFLO is fixed to value 0xFFF and 0x000 ? if not fixed to these value, how to get these two value, please implement how to get these two values in code. Thanks again. 

  • Fum Li,

    The sample codes that we have at the moment doesnt cover the other two scenarios.

    But the plan is to provide it in one of the comming release of HALcogen.

    - Pratip  

    MCU Auto Software

  • I'd like some clarification of this as well.  I don't need any sample code, but the table listed above doesn't give tolerances.

    When a reading is ADRefLo or ADRefHi, does that mean the conversion is 0x000 or 0xFFF respectively?  Or within some number of counts?  What does "approx ADRefLo" mean.

    How do you discriminate between a large but valid voltage and "shorted to ADRefHi", for example?

    Thanks!

  • Tom,

    Sorry for the delay in answering.

    The ADRefLo and ADRefHi are used by the ADC as reference supplies and these determine the lower and upper bound of the conversion range. That is, an input of ADRefLo will convert to 0x000 and an input of ADRefHi will convert to 0xFFF.

    When in self-test mode, the input from the analog channel plus a reference voltage (hi or low) are connected to the ADC input for conversion. If an analog channel is shorted to ADRefHi and you select ADRefLo as the reference voltage, the expected conversion result is still going to be very close to ADRefHi. There will be some drop due to the resistive pull down to ADRefLo, hence the "approx. ADRefHi" expected conversion result.

    Regards,

    Sunil