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: Sample Example for averaging using PPB block for multiple channels

Part Number: TMS320F28P550SJ
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

I require an example for getting an average of 5 samples per channel for multiple channles using the PPB for a customer. I could not find Averaging example in C2000_ware for 28P55x, where can I find such an example. Also wanted to know how many channels per ADC can we set for averaging feature.

  • Hello Rupesh,

    It looks like the oversampling example is currently missing from the F28P55x directory, and I've filed a ticket for it to be added. In the meantime, you could take adc_ex16 from f28p65x and then port it to F28P55x using SysConfig.

    However, this example does not show averaging. Two things to note about averaging:

    1. If the objective of oversampling is to increase the effective number of bits (ENOB)/gain a more accurate representation of the signal, then averaging should not be done. Averaging removes information from the accumulated conversion. Instead, the user should simply use the accumulated sum as is and change the denominator (for instance, if I do 4x oversampling, then my new denominator is 2^14=16384 instead of 2^12=4096).
    2. The hardware does not do arbitrary division. What it can do is binary shift, which divides the accumulated result by a power of 2. If you need to divide by 5, you have to do it in the CPU.

    On the second question: each ADC has two trigger repeaters that can be used to perform oversampled conversions. Any number of SOCs can be triggered by a trigger repeater, but the trigger repeater determines the origin of the SOC trigger (e.g. which EPWM) and the configuration values such as count, phase delay and spread. For the accumulation and averaging, there are four post-processing blocks (PPB) per ADC; you assign one to each SOC that needs accumulation.

    Best regards,
    Ibukun