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

Setting up the ADC Basic

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



Joined: 22 Jun 2014
Posts: 2

View user's profile Send private message

Setting up the ADC Basic
PostPosted: Sun Jun 22, 2014 1:45 am     Reply with quote

Hello,
I am new to PIC CCS and I am trying to make a simple basic ADC program what I cannot understand is that what basically does the setup_adc() do? When I checked out in the help it says this
"Configures the analog to digital converter."
But it has the three variations to it can anyone help me explain as to what does the three variations mean?
· ADC_OFF

· ADC_CLOCK_INTERNAL

· ADC_CLOCK_DIV_32
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sun Jun 22, 2014 3:28 am     Reply with quote

To get close to the full picture you have to read all three off:-

1) CCS Manual.
2) Microchip datasheet for your chosen PIC.
3) The CCS .h file for your PIC.

Mike
temtronic



Joined: 01 Jul 2010
Posts: 9244
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jun 22, 2014 5:04 am     Reply with quote

Mike is right you need to read those to understand the power of the PIC
but...

...OFF _should_ turn off the ADC peripheral, thus saving power and disabling it from interfering with other peripherals attached to the same I/O pins..

...INTERNAL _should_ mean to use the internal clock to run the ADC peripheral. Please note it is NEVER ever used in 99.999999999999% of real applications.

....DIV_32 _should_ mean for the ADC to be clocked at 1/32 of the main clock speed.You'll HAVE to check the books on that !Say you've got a 4MHz xtal,then PIC 'speed' is 1Mhz,ADC clock would be 1HMz/32.

Again READ the books..I'm doing this from memory.After 20 years I probably don't have all the details stuck in my head.

Also different PICs handle the ADC differently !!
cheers
Jay
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