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.

Piccolo f28027 ADC

Other Parts Discussed in Thread: TMS320F28027

Hello,

I am having a strange issue with ADC of Piccolo tms320f28027. The ADC values are not stable and fluctuating a lot. When I am using this configuration 

ADC_setSocChanNumber (myAdc, ADC_SocNumber_1, ADC_SocChanNumber_A7); //set SOC1 channel select to ADCINA7

ADC_setSocTrigSrc(myAdc, ADC_SocNumber_1, ADC_SocTrigSrc_EPWM1_ADCSOCA); //

ADC_setSocSampleWindow(myAdc, ADC_SocNumber_1, ADC_SocSampleWindow_15_cycles); 

the adcvalues fluctuates a lot. Suppose when i connect the adc pin to 3v3 using internal reference, the adc values fluctuates from 4000 to 4095. And on the other pin the values change from 3097 to 4045. This making my output closed loop unstable ! and i am not sure if the output voltage is right or not !

Thank you.

  • Hi Srini,

    Is this on the launchpad or custom board?

    Regards,
    Gautam
  • Hello Gautham,

    It is on launchpad, i think i found the problem i was sending the data via sci in the main loop after some calculations in the main loop while the adc data was getting updated in the isr all the time before the completion of the instruction in the main loop. I cross checked in the watch graph in ccs.
    can you explain me how to trigger ADC soc when CTR= CMPA ?

    PWM_setSocAPulseSrc(myPwm2, PWM_SocPulseSrc_CounterEqualCmpAincr); // Is is the right instruction ?

    Only pulse source i ve found are these but not sure which triggers the pwm soc at CTR= Cmpa
    PWM_SocPulseSrc_CounterEqualPeriod,
    PWM_SocPulseSrc_CounterEqualZero,
    PWM_SocPulseSrc_CounterEqualCmpAIncr,
    PWM_SocPulseSrc_CounterEqualCmpADecr,

    I am trying to measure the average inductor current in a flyback circuit but i cannot trigger the adc soc at middle of the pwm pulse.
    Not sure how to do this and i cannot find any documents on this. Can you please help
    Thank you.
  • Srinivasan,

    I think both of these options will trigger on CTR=CMPA:

    PWM_SocPulseSrc_CounterEqualCmpAIncr,
    PWM_SocPulseSrc_CounterEqualCmpADecr,

    The difference being whether it triggers when CTR is incrementing or decrementing.  You can reference the EPWM guide for more details.

    -Tommy

  • Hello Tommy,

    Thank you for your reply. Now i am able to do it. Thanks a lot.

    Srinivasan