Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
I am trying to configure the comparator to trigger when the positive terminal goes higher than the negative terminal. I want this to generate an interrupt.
I have configured the comparator as follows (using SysConfig):
| Operating Mode | Fast mode |
| Enable Channel Inputs | Positive |
| Enable Output | False |
| Positive Terminal Channel Input | COMPx_IN0+ |
| Output Polarity | Non-inverted |
| Hysteresis | No hysteresis |
| Reference Source | VDDA |
| Reference operating mode | Static |
| Terminal | Ref applied to negative |
| DAC Control | SW-bit controls selection |
| DAC input | DAC 0 |
| DAC code | various |
I have also enabled the interrupt with level 0 priority.
The issue I am experiencing is the following:
- If I select the DAC code as 0 the output of the COMP is LOW
- If I select the DAC code as > 0 the output is always HIGH and I get constant IRQs.
- From what I can see the input voltage on the positive terminal has no effect on the output of the comparator.
I have tried various different DAC code values but the behavior is always the same.