CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

#INT_AD sample code

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

#INT_AD sample code
PostPosted: Wed Jan 07, 2004 10:34 am     Reply with quote

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
PostPosted: Wed Jan 07, 2004 10:39 am     Reply with quote

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








PostPosted: Wed Jan 07, 2004 2:39 pm     Reply with quote

I'd like the interrupt to be self-stimulating. Hmmm... Let me play with those and see what I get.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group