View previous topic :: View next topic |
Author |
Message |
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
#INT_AD sample code |
Posted: Wed Jan 07, 2004 10:34 am |
|
|
Does anyone have any sample code for using AD interrupts?
I'm trying to get it working and it's like I have to read_adc() to gen the interrupt when I want the interrupt to tell me to read_adc()
What am I doing wrong? (I can post the code if anyone would like to see it.) |
|
|
Ttelmah Guest
|
Re: #INT_AD sample code |
Posted: Wed Jan 07, 2004 10:39 am |
|
|
bkamen wrote: | Does anyone have any sample code for using AD interrupts?
I'm trying to get it working and it's like I have to read_adc() to gen the interrupt when I want the interrupt to tell me to read_adc()
What am I doing wrong? (I can post the code if anyone would like to see it.) |
There are some extra options for the adc function.
Basically, if you call 'read_adc(ADC_START_ONLY)', the compiler will trigger the ADC, and an interrupt will then be generated when the conversion is complete. Inside the interrupt handler, you can use 'read_adc(ADC_READ_ONLY)', to read the value, without triggering another conversion.
These variables are defined in the processor 'include' file. There is a third one 'ADC_START_AND_READ', with the comment that this is the 'default'.
Best Wishes |
|
|
Guest
|
|
Posted: Wed Jan 07, 2004 2:39 pm |
|
|
I'd like the interrupt to be self-stimulating. Hmmm... Let me play with those and see what I get. |
|
|
|