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.

Compiler/TMS320F280049C: configuring two ADC registers simultaneously

Part Number: TMS320F280049C

Tool/software: TI C/C++ Compiler

Hi,

I was trying to configure two ADC registers simultaneously, ADCA and ADCB with 4 pins for each register. The soc and initialization of both the registers have been kept same except for the letters 'a' and 'b' as required. Both are running in INT1 interrupt mode and when executed, both the ISR gets executed. I'm giving 2.5V to every pin with 3.3V as reference for both registers. I observed that ADCA result register shows the corresponding value of 2.2v (around 3102) when I hover on the register during execution. But I don't see the same happening with ADCB result register. They show 4095.  When I give 0V instead of 2.5V, the value seems to be 0 as well. I have used the following line during initialization.

SetVREF(ADC_ADCB, ADC_INTERNAL, ADC_VREF3P3);

I'm confused to why it is not reading the values properly. I'm not sure if there is some command that I've been missing. Please help me sort this out.

Regards
Reshma

  • Hi,

    Which board are you using? In controlcard, you need to select the correct switch configuration in launchpad. Refer to description of S8 in controlcard infosheet. Let me know if the switch is correctly set and still you are getting incorrect result for ADCB.

    Thanks

    Vasudha

  • Hi,

    I'm using TMS320F280049C launch pad for the above operation. According to the launch pad details, I'm using J3-24 pin in the launch pad as b0, J3-26 as b1, J3-27 as b1 and J1-6 as b3. For both the ADCs I'm using internal voltage reference, both in the left position. I don't see this problem with ADCA register even when I'm executing both the ADC ISR  at the same time.

    I referred to the TRM and according to the point given in 13.3.1.4 Non-overlapping Conversions of adc, there needs to be a 180' phase shift between the epwms that I use. Hence, I used SOCA and SOCB for it. But I don't see any change.

    If my configuration is wrong with the control card, will I be able to see ADCA behaving properly? How will I be able to change the configuration now?

    Regards
    Reshma

  • Hi,

    Try setting the VRef for all the ADCs like below and check the results.

    SetVREF(ADC_ADCA, ADC_INTERNAL, ADC_VREF3P3);

    SetVREF(ADC_ADCB, ADC_INTERNAL, ADC_VREF3P3);

    SetVREF(ADC_ADCC, ADC_INTERNAL, ADC_VREF3P3);

    This needs to be done because ADC-B and ADC-C are sharing the reference in 100PZ package.

    Thanks

    Vasudha

  • Hi,

    When I put the following lines, the ADCA works fine but not ADCB.

    SetVREF(ADC_ADCA, ADC_INTERNAL, ADC_VREF3P3);

    SetVREF(ADC_ADCB, ADC_INTERNAL, ADC_VREF3P3);

    When I put the following lines, the ADCB works fine but not ADCA.

    SetVREF(ADC_ADCA, ADC_INTERNAL, ADC_VREF3P3);

    SetVREF(ADC_ADCB, ADC_INTERNAL, ADC_VREF3P3);

    SetVREF(ADC_ADCC, ADC_INTERNAL, ADC_VREF3P3);

    Regards

  • Reshma M1 said:

    Hi,

    When I put the following lines, the ADCA works fine but not ADCB.

    SetVREF(ADC_ADCA, ADC_INTERNAL, ADC_VREF3P3);

    SetVREF(ADC_ADCB, ADC_INTERNAL, ADC_VREF3P3);

    When I put the following lines, the ADCB works fine but not ADCA.

    SetVREF(ADC_ADCA, ADC_INTERNAL, ADC_VREF3P3);

    SetVREF(ADC_ADCB, ADC_INTERNAL, ADC_VREF3P3);

    SetVREF(ADC_ADCC, ADC_INTERNAL, ADC_VREF3P3);

    Regards

    So does that mean, I can't be able to use both ADCA and ADCB simultaneously? How will I be able to solve this?

  • Hi,

    You should be able to use ADCA and ADCB simultaeously. Let me know if you were able to resolve this issue.

    Thanks

    Vasudha