F29P329SM-Q1: How to output the CMPSS output to GPIO

Part Number: F29P329SM-Q1

Hi team,

I ask this for my customer. My customer has one requirment: they want to use CMPSS to compare the input signal to a voltage, when the input signal greater than a fixed voltage, it needs to output a low voltage in a IO; and if the input voltage less than a fixed voltage, it needs to output a high voltage in a IO.

I think it should be realized use output xbar

image.png

But at the same time, this IO volatge should can be changed through software, i don't know in above use case, can customer use software to wirte the gpio data register to change the output signal?

If can't, what's our suggestion to realize customer's requirement: the IO output voltage can change becasue of the CMPSS output change and software.

I think CMPSS can't generate the interrupt, so I don't have idea for it, could you give your suggestion for this?

BRs

Shuqing

  • Hi Shuqing,

    You can use a CMPSS to compare the input voltage with a software‑adjustable reference set by the CMPSS DAC; route the comparator output (optionally inverted) to a GPIO via the XBAR so the pin goes low when Vin > Vref and high when Vin < Vref. The DAC register can be written at any time to change the threshold, and the comparator can generate interrupts on crossing events. If the firmware needs to force the pin regardless of the comparator, simply disable the CMPSS output and write the desired level to the GPIO data register, then re‑enable the comparator when automatic control should resume. This provides both hardware‑level comparison and full software control of the output voltage level.

    Thanks,

    Ira