How can I cause interrupt from ADC compare?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I cause interrupt from ADC compare?

Jump to solution
887 Views
melvinblades
Contributor I

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.

PE_capture.JPG.jpg

Labels (1)
Tags (3)
0 Kudos
1 Solution
466 Views
melvinblades
Contributor I

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)

View solution in original post

0 Kudos
1 Reply
467 Views
melvinblades
Contributor I

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)

0 Kudos