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 CCS Technical Support

A/D conversion

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



Joined: 05 Feb 2005
Posts: 14

View user's profile Send private message

A/D conversion
PostPosted: Sat Feb 05, 2005 2:13 pm     Reply with quote

Hi, I am working on a project (with the 18F458) where I need to sample an incoming signal. I do not fully understand how the A/D implementaion works. Do I have to use the A/D ISR? I made a test program without using the A/D ISR and it seems to be working. What do you think?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Feb 05, 2005 10:52 pm     Reply with quote

No, you don't need an isr. Typically, users don't use an isr to read
the built-in ADC.

I suspect you have the demo. That's why you have no examples
to look at. Here's how to get some example code:

Go to Google http://www.google.com

Type in this search string, including the quotes:

"read_adc" "#use delay"

This will get you lots of sample code for CCS which uses the read_adc()
function. Only CCS has the "#use delay" statement. That's why it's
useful as a search key for sample code.

Look in the manual or the Help file to see which built-in CCS functions
are useful to you. Then use the method above to find sample code.

The manual is available here: http://www.ccsinfo.com/ccscmanual.zip
Unfortunately, they didn't enable the table of contents, which makes it
not very useful, but there's nothing I can do about that.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Feb 05, 2005 10:52 pm     Reply with quote

Duplicate post deleted. I didn't do it. I think the board may be glitching.

Last edited by PCM programmer on Sat Feb 05, 2005 11:29 pm; edited 1 time in total
bkamen



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

View user's profile Send private message

Re: A/D conversion
PostPosted: Sat Feb 05, 2005 11:13 pm     Reply with quote

Slick05 wrote:
Do I have to use the A/D ISR? I made a test program without using the A/D ISR and it seems to be working. What do you think?


No, you don't have to use an ISR if you don't mind the lock-step format of the resulting code.

Where the ISR buys you something is when you want to set multiple channels, wait for the settling time and then take the same. You could be doing other things in the meantime.

I wrote a monitor for 4 A/D channels that also uses RS232 and Timer0 IRQ's. The A/D information streams into memory while bytes are spewing out of the RS232 port, I2C data is being written/read and so on... Smile

Partially academic, but also very useful if timing is an issue for your application.
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