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.

TMS320F28379D: Question on using ADC calibration offset

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Per the image above, I have '6B' set in the OffCal register.  ADCRESULT0 shows '6B' as the raw value measured by the ADC.  PPB1 result also shows '6B' as its result.  My expectation is that PPB1 result would be ZERO in this case.

What am I missing?

Setup is simply

    ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM6_SOCA, ADC_CH_ADCIN5, 15); 

    ADC_setupPPB(ADCB_BASE, ADC_PPB_NUMBER1, ADC_SOC_NUMBER0);

Thanks!

  • Hi,

    Could you please take a look at the adc_ex7_ppb_offset example from C2000WARE? 

    Best Regards,

    Ben Collier

  • Hi Ben,  

    I did look at the offset example.  I am not seeing anything that I am doing differently.  I have a value set in ADCBBP1OFFCAL and the result that I see in ADCPPB1RESULT shows the raw result without subtracting the offset:

    I only posted the PPB/SOC-related configuration in the original post, but more detailed setup is here:

        ADC_setPrescaler(ADCB_BASE, ADC_CLK_DIV_4_0);

        ADC_setInterruptPulseMode(ADCB_BASE, ADC_PULSE_END_OF_CONV);

        ADC_setSOCPriority(ADCB_BASE, ADC_PRI_ALL_HIPRI);

        ADC_enableConverter(ADCB_BASE);

        SysCtl_delay(1500U);

        ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM6_SOCA, ADC_CH_ADCIN5, 15); 

        ADC_setupPPB(ADCB_BASE, ADC_PPB_NUMBER1, ADC_SOC_NUMBER0);

        ADC_setPPBCalibrationOffset(ADCB_BASE, ADC_PPB_NUMBER1, 0x6C);  // 0x6C as an example

    ADC_setInterruptSource(ADCB_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER0);
    ADC_enableInterrupt(ADCB_BASE,ADC_INT_NUMBER1);

    In the ADCB ISR:

        measurement = ADC_readPPBResult(ADCBRESULT_BASE, ADC_PPB_NUMBER1);

        ADC_clearInterruptStatus(ADCB_BASE, ADC_INT_NUMBER1);

    if(true == ADC_getInterruptOverflowStatus(ADCB_BASE, ADC_INT_NUMBER1))
    {
    ADC_clearInterruptOverflowStatus(ADCB_BASE, ADC_INT_NUMBER1);
    ADC_clearInterruptStatus(ADCB_BASE, ADC_INT_NUMBER1);
    }

        Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);

  • Okay, seeing this note in section 11.10.1 of the TRM:

    I tried using SOC1, and the application is working as expected.