Hi @troelsoesteraa
Thank You for your response.
Actually in our old designs we have used the external comparator using opamp and things were just fine, but to save few more cents, we thought to use the internal comparator of MKE15Z, as technically they both looks same.
Regarding the second suggestion of using two comparator, maybe in future I will try this, but as of now this not possible. (Reason is that we have two variants and another variant of this product uses the MKE15Z64, which only has one comparator, plus hardware change is also not possible at this moment)
So I understand that it is not possible to increase the hysteresis. In the past I tried to follow the following approach.
- At initialization configure the Comparator module for interrupt on rising edge when input voltage is greater than 1.0 V (from DAC)
- When I received the rising interrupt, reconfigure the module to generate falling edge interrupt, when voltage is greater than 0.5V (from DAC)
- When I received the falling edge interrupt, reconfigure the module to generate rising edge interrupt when DAC input voltage is greater than 1.0 (from DAC)
- And Repeat these steps
More information is available in the below post.
https://community.nxp.com/t5/Kinetis-Microcontrollers/Setting-Different-DAC-Voltage-Level-for-Rising...
This method works really well in noisy environment, but in normal environment there is some problem at some point of time, maybe due to re-configuring, but I couldn't figure out what exactly it is.
If you have any other suggestions, please let me know.
I will also try to create a separate project, and try to share here. Thanks in advance.