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
Posted: Sun Jun 22, 2014 3:28 am
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 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
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