How can I cause interrupt from ADC compare?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How can I cause interrupt from ADC compare?

跳至解决方案
1,505 次查看
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

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
1,084 次查看
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 项奖励
回复
1 回复
1,085 次查看
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 项奖励
回复