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: How does ADC input channel related to input pin

Part Number: TMS320F280049
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Hi, TI experts,

If the psychical pin that i want to do ADC is A2, how do i config ADC channel?

Thanks,

Shengnan

  • Hello Shengnan,

    The ADCs for most C2000 devices are SOC-based, meaning each of the SOCs available for an ADC can be configured to read from a different/same ADC pin. You can configure the input to the ADC SOC using the CHSEL bits in the ADCSOCnCTL register. Please refer to the reference manual for more detail.

    Also as a recommendation, you should use SysConfig in your software to help configure these settings to do any error checking, in case a particular ADC input is not available.

  • Sorry, I am still not quite clear. Can we do an example as shown in the picture?

    In this example, the physical connection of the filtered IL feedback is Pin8 (A2/B6/PGA1) of F280049CRSHS. How do i config the fourth parameter of this function ADC_setupSOC()?

     

  • This is a line of code generated from SysConfig, you can use that tool as a reference for what your configurations should look like:

    ADC_setupSOC(myADC0_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN1, 8U);
  • Sorry, I don't have this GUI installed. Just want to understand the mechanism behind it.

  • SysConfig should already be installed with CCS I believe, and if you have the latest C2000Ware then examples with SysConfig should be available. However, if you just want you use driverlib I've already attached the line of code from driverlib in my post. Let me know if you have specific questions on it. The code is provided in C2000Ware if you want to see the function definition itself: C2000Ware_5_01_00_00\driverlib\f28004x\driverlib\adc.h

  • I saw you rejected my last response, please let me know if you have a specific question(s) about the details I've provided.

  • 1. A straight forward answer is appreciated, don't circumvent.

    2. the information you provided is helpful, as support of a straight forward answer.

    3. the answer i am looking for here is A2 correspond to Ch2 (the number after the letter, correspond to the channel #), if you don't know that you should do better.

  • I wasn't sure what integer "BUCK_IL_FILT_ADC_PIN" represented, which is why I was recommending using the macros/enumerations provided by C2000Ware. If you don't mind using constant values in your code, you can substitute the "BUCK_IL_FILT_ADC_PIN" with "2U". I was simply using ADC_CH_ADCIN1 as an example, you could use ADC_CH_ADCIN2 too.

    Using macros/enumerations is recommended just in case there's a chance that the code will be migrated to another C2000 device, which SysConfig makes extremely simple.