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.

TMS320F28P550SJ: The ADC result register value suddenly changes to a very small value

Part Number: TMS320F28P550SJ


Tool/software:

HI TI experts,

         TMS320F28P55SJ  ADC result register value suddenly changes to a very small value

        When sampling the three-phases input current, due to it has positive and negative, 0A corresponds to  AD value of 4096/2=2048. when the current is around 0A, The theoretical AD sampling result register value should be around 2048. However, occasionally one phase current AD sampling drops instantly, approaching 0, but the actual voltage sent to the DSP analog port does not fluctuate. In addition, the reference 3.3V also does not fluctuate. By adjusting AQCPS and SOC conversion channels, the phenomenon still  exists.


QUESTION:

     The voltage of the analog port sent to the DSP is normal, but the actual AD result register fluctuates. How do I configure AD sampling? Is there any  disturbance? How to check if DSP is affected by disturbance.

    thanks.

  • Hi Zhang,

    Did you scope the input signal on ADC and verified its always present?

    Are you using internal or external VREFHI (voltage reference)? Please double check configuration of this.

    Thanks,

    Susmitha

  • Hi Susmitha, 

    Customer side use external reference voltage, We scope the input signal on ADC pin but didn't find noise from the waveform. External reference voltage is also stable. Regarding the ADC configuration, it is migrated from their last-gen F280049.

    We don't have clue to figure out the root cause now. Could you please share some suggestions to help us? Thanks!

    BR,

    Fengyu

  • Hi Fengyu,

    Can you please share your part of code, where ADC Is configured?

    Thanks,
    Susmitha

  • HI Susmitha,

    28p55 150M, the ADC configuration as follows, sample frequency is 80K, 12.5us.

        EALLOW;
        ADC_setOffsetTrim(ADCA_BASE);
        ADC_setOffsetTrim(ADCB_BASE);
        ADC_setOffsetTrim(ADCC_BASE);
        ADC_setOffsetTrim(ADCD_BASE);
        ADC_setOffsetTrim(ADCE_BASE);
        EDIS;
    
        EALLOW;
        ADC_setVREF(ADCA_BASE, ADC_REFERENCE_EXTERNAL, ADC_REFERENCE_2_5V);
        ADC_setVREF(ADCB_BASE, ADC_REFERENCE_EXTERNAL, ADC_REFERENCE_2_5V);
        ADC_setVREF(ADCC_BASE, ADC_REFERENCE_EXTERNAL, ADC_REFERENCE_2_5V);
        ADC_setVREF(ADCD_BASE, ADC_REFERENCE_EXTERNAL, ADC_REFERENCE_2_5V);
        ADC_setVREF(ADCE_BASE, ADC_REFERENCE_EXTERNAL, ADC_REFERENCE_2_5V);
        EDIS;
    
        EALLOW;
        //
        //
        AdcaRegs.ADCCTL2.bit.PRESCALE = 8;
        AdcbRegs.ADCCTL2.bit.PRESCALE = 8;
        AdccRegs.ADCCTL2.bit.PRESCALE = 8;
        AdcdRegs.ADCCTL2.bit.PRESCALE = 8;
        AdceRegs.ADCCTL2.bit.PRESCALE = 8;
        //
        //
        AdcaRegs.ADCCTL1.bit.INTPULSEPOS = 1;
        AdcbRegs.ADCCTL1.bit.INTPULSEPOS = 1;
        AdccRegs.ADCCTL1.bit.INTPULSEPOS = 1;
        AdcdRegs.ADCCTL1.bit.INTPULSEPOS = 1;
        AdceRegs.ADCCTL1.bit.INTPULSEPOS = 1;
    
        //
        //
        AdcaRegs.ADCCTL1.bit.ADCPWDNZ = 1;
        AdcbRegs.ADCCTL1.bit.ADCPWDNZ = 1;
        AdccRegs.ADCCTL1.bit.ADCPWDNZ = 1;
        AdcdRegs.ADCCTL1.bit.ADCPWDNZ = 1;
        AdceRegs.ADCCTL1.bit.ADCPWDNZ = 1;
        EDIS;
        
        
        AdcbRegs.ADCSOC0CTL.bit.TRIGSEL = 0x11;
        AdcbRegs.ADCSOC0CTL.bit.ACQPS = 0x28;          
        AdcbRegs.ADCSOC0CTL.bit.CHSEL = ADCIv; //b1
        
        AdccRegs.ADCSOC2CTL.bit.TRIGSEL = 0x11;    
        AdccRegs.ADCSOC2CTL.bit.ACQPS = 0x28;         
        AdccRegs.ADCSOC2CTL.bit.CHSEL = ADCIw; //c4             
    
        AdccRegs.ADCSOC5CTL.bit.TRIGSEL = 0x11;    
        AdccRegs.ADCSOC5CTL.bit.ACQPS = 0x28;         
        AdccRegs.ADCSOC5CTL.bit.CHSEL = ADCIu; //c14             
        
        AdcaRegs.ADCSOCPRICTL.bit.RRPOINTER = 0x0f;
        AdcbRegs.ADCSOCPRICTL.bit.RRPOINTER = 0x0f;
        AdccRegs.ADCSOCPRICTL.bit.RRPOINTER = 0x0f;
        AdcdRegs.ADCSOCPRICTL.bit.RRPOINTER = 0x0f;
        AdceRegs.ADCSOCPRICTL.bit.RRPOINTER = 0x0f;
    
        AdcaRegs.ADCSOCPRICTL.bit.SOCPRIORITY = 0x10;
        AdcbRegs.ADCSOCPRICTL.bit.SOCPRIORITY = 0x10;
        AdccRegs.ADCSOCPRICTL.bit.SOCPRIORITY = 0x10;
        AdcdRegs.ADCSOCPRICTL.bit.SOCPRIORITY = 0x10;
        AdceRegs.ADCSOCPRICTL.bit.SOCPRIORITY = 0x10;
        
        
       EPwm7Regs.ETSEL.bit.SOCAEN = 1;              //
       EPwm7Regs.ETSEL.bit.SOCASEL = ET_CTR_ZERO;   //80K=12.5us
       EPwm7Regs.ETPS.bit.SOCAPRD = ET_1ST;         //

  • Hi Zhang,

    Can you please refer to this thread

    TMS320F28P559SJ-Q1: P55x external voltage reference for ADC setting - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums

    Can you check Rev of board by confirming the value at address 0x5D00C? 

    Thanks,
    Susmitha

  • Hi Susmitha,

    The REV of the board is 1, shown at  address 0x5D00C. Is the version normal?

    BR,

    Fengyu

  • Hi Zhang,

    (+) TMS320F28P559SJ-Q1: P55x external voltage reference for ADC setting - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums

    Please refer to this thread on how to configure ADC when using external reference in above conditions.

    Thanks,

    Susmitha

  • Hi Susmitha,

    They are not the same question. We have already configured 2.5V reference. You can refer to the code Zhang shared before. Do you have other suggestions?

    BR,

    Fengyu

  • Hi Fengyu,

    When using external reference and REV of the board is 1.There need to be made some modifications. Can you confirm if your code has same?

    Please make below changes:

    • If the revision ID (value at address 0x5D00C) is "1" then define the REV_ID as a predefined symbol in the projectspec and (Add "--define=REV_ID=1" in the compiler flags, which correspond to REV0
    • Also,Inside sysctrl.h we defined the location of Device_cal 

               #define Device_cal ((void (void))((uintptr_t)0x003fb1e7)) . please make sure, you have same value.

    On F28P55x, when the external reference mode is selected, the ANAREFx1P65SEL bit should be set to 0 for FSR = VREFHI.

    Setting the ANAREFx1P65SEL bit to 1 will cause FSR=2xVREFHI if we are applying externally 1.65V. But since you already applied 2.5V externally, the bit should be set to 0. 

     Can you incorporate these changes and try running the same?

    Thanks,
    Susmitha