ADC in interrupt

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
mazur50
Posts: 68
Joined: Thu Dec 04, 2008 5:19 am

ADC in interrupt

Post by mazur50 » Mon Dec 29, 2008 7:59 pm

how do you go about using an ADC as an interrupt. thanks for your help i am new to this.

I want to use a Case of and ADC range to start the interrupt.

mazur50
Posts: 68
Joined: Thu Dec 04, 2008 5:19 am

Post by mazur50 » Thu Jan 08, 2009 8:58 pm

anyone

User avatar
rocketbob
Registered User
Registered User
Posts: 51
Joined: Sun Apr 01, 2007 1:36 am
Location: Indiana USA

Post by rocketbob » Thu Jan 08, 2009 10:11 pm

I would think you would just want check the value of the ADC in the main loop of your program, then do something if its out of range. I don't think you need an interrupt for that.

mazur50
Posts: 68
Joined: Thu Dec 04, 2008 5:19 am

Post by mazur50 » Thu Jan 08, 2009 10:23 pm

I need to be able to interrupt the main loop on an adc value.

User avatar
madinventions
Posts: 11
Joined: Tue Jan 06, 2009 9:13 pm
Location: Suffolk, England

Post by madinventions » Fri Jan 09, 2009 9:34 am

I'm not sure how it would be possible to cause an interrupt on a specific ADC value. However, if you want to trigger an interrupt at a specific analogue voltage level then some PICs have a built in comparator that would do the job. Failing that, an external window comparator with the output fed into an interrupt pin would do the job. How accurate do you need the trigger voltage to be?

Ed.

Post Reply