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.

TM4C123x ADC software oversample

Hi Support,

referring to ADC sampling with TIVA parts, one instance of g_pui8OversampleFactorhas been defined, and a user can define different oversample factors for ADC0 and ADC1 for the corresponding sequencers.
It seems that the last configuration overwrites the previous providing undesired result

The sequencers could be accessed by ADCSoftwareOversampleDataGet using inconsistent data set in g_pui8OversampleFactor.

An idea for me is that g_pui8OversampleFactor should be implemented separately for ADC0 and ADC1 as (for instance)

staticuint8_tg_pui8OversampleFactor[2][3];

and select the first array index based on the base address of the ADC module involved.

Please let me know if this is feasible.

Thanks,

Alberto




void
ADCSoftwareOversampleConfigure(uint32_tui32Base, uint32_tui32SequenceNum,
                               uint32_tui32Factor)
{
    uint32_tui32Value;

    //
    // Check the arguments.
    //
    ASSERT((ui32Base == ADC0_BASE) || (ui32Base == ADC1_BASE));
    ASSERT(ui32SequenceNum < 3);
    ASSERT(((ui32Factor == 2) || (ui32Factor == 4) || (ui32Factor == 8)) &&
           ((ui32SequenceNum == 0) || (ui32Factor != 8)));

    //
    // Convert the oversampling factor to a shift factor.
    //
    for(ui32Value = 0, ui32Factor >>= 1; ui32Factor;
        ui32Value++, ui32Factor >>= 1)
    {
    }

    //
    // Save the shift factor.
    //
    g_pui8OversampleFactor[ui32SequenceNum] = ui32Value;
}