Part Number: TMS320F280049
Please reference section 13.1.9 in the F280049 TRM.
In a certain application, the goal is to use the ADC post processing blocks to handle offsets. The use case is for both TWOSCOMPEN on and off (i.e. one case with RESULT - OFFREF and the other with OFFREF - RESULT), each with their own PPB.
The question relates to the math and how it applies to the Threshold Compare. For the TWOSCOMPEN off case, the goal is to have a TRIPHI threshold set which can be used to trigger a TZ. But in this case, it is desired to also use the OFFREF feature. Furthermore, it would ideal for a result lower than OFFREF to produce the trip (ex: ground bounce).
There is some clarification required in the documentation regarding how the compare works. It states "TRIPHI and TRIPLO do NOT perform a signed comparison. It is recommended to leave OFFREF as 0 when using limit compare functionality."
So for simple example: Say threshold 0x800 and offset is 0x100. If the result is above threshold, the TRIPHI will occur. That is clear in the docs. However, what exactly happens if the ADCRESULT is less then 0x100 in this case? The docs state that this will produce a signed result. Will this be interpreted as a large positive number (0xF00) in the compare and still produce a TRIPHI? I.e. the ADCPPBxRESULT is sign extended and should work, assuming that the offset is smaller then the ADC Max value minus the threshold value. In other words, if the twos complement math is handled correctly, in certain cases we can properly use the Threshold Compare with OFFREF non-zero.
The assumption is the same principle applies when setting TWOSCOMPEN to 1. Can you please confirm this rationale?
Thanks,
Eric