I want to create an interrupt that occurs when an ADC channel input crosses a voltage threshold.
I'm using processor expert, on a K40 (but would be happy to have non-processor expert help!)
In processor expert, I have created an AnalogComp_LDD component
This component has
1 positive input : CMP0_IN4
I want the 2nd input to be from the internal DAC and be able to select the output of the DAC.
So within the AnalogComp_LDD component, I set the negative input to Dac6 output , sourced internally from component DA2
[I'm not sure why one is positive and one is negative. They are both positive voltages.]
Component DA2 is configured to to an initial value of 32 which should be 1/2 of the refrerence voltage since there is 6 bits of resolution and the full range is 0-64.
My "code" does get an initial interrupt on startup. But does not get another interrupt. regardless of the signal I put on the input.
Any suggesteions on what to try or alternate methods is appreciated.
Solved! Go to Solution.
I solved my own problem.
I wanted the 2nd input on the comparator to come internally from the DAC
I had set the reference voltage up to "internal" -- but what I I wanted
was the DAC output to be generated internally,
The reference voltage for the DAC is actually external (VDD)
I solved my own problem.
I wanted the 2nd input on the comparator to come internally from the DAC
I had set the reference voltage up to "internal" -- but what I I wanted
was the DAC output to be generated internally,
The reference voltage for the DAC is actually external (VDD)