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.

TMS320F28374D: Zero-Crossing Detection

Part Number: TMS320F28374D

In technical reference manual section 10.1.9.3 it says "Note that the PPBxZERO bit in the ADCEVTSTAT register is gated by EOC and not by the sign change in the ADCPPBxRESULT register."

what does "gate" mean?

"not by the sign change in the ADCPPBxRESULT register", so if ADCPPBxRESULT changes from -1 to 1, the PPBxZERO bit will not set? when exactly will it set?

another sentence"TRIPHI and TRIPLO do NOT perform a signed comparison. It is recommended to leave OFFREF as 0 when using limit compare functionality."

what is a singed comparison? if ADCPPBxTRIPHI.LIMITHI=-100, ADCPPBxRESULT=-99, what will happen? why it's recommended to leave OFFREF=0?

Thanks.

  • Hi Howard,

    The offset calibration is for removing electrical offsets in the signal chain. Like the HW ADC offset trim, the results will be truncated to the range of 0 to (2^N) - 1 LSBs, where N is the resolution (12-bits or 16-bits). This calculation will go directly into the ADC offset register. Only one PPB can affect the ADC result register.

    The reference offset is to help with calculation to some setpoint to trip threshold. Multiple PPBs can point to the same SOC and produce different PPB results based on different reference offsets.

    The reference offset can be used to offload some calculations from the CPU, which can help when running tight control loops with many ADC results which all need to be compared to some trip threshold. This can also be used to directly trip the ePWM without CPU intervention based on a limit compare or zero crossing event (zero crossing would be when the conversion - setpoint changes sign). In this case, the trip is much faster than if the CPU had to take an interrupt, do the comparison, and then software trip the ePWM. For safety purposes, the trip doesn't require CPU intervention, so if something happens that causes the CPU to miss an interrupt or be delayed in servicing the interrupt, the trip will still happen with predictable timing.

    There is an erratum for the PPB where the high/low limit comparisons do not correctly consider the sign. Because of this, you should either use the offset reference to generate a signed output, and then only use this signed output for zero-crossing detection OR you can leave the offset reference as 0 and use the high/low limit comparisons.