View previous topic :: View next topic |
Author |
Message |
cerr
Joined: 10 Feb 2011 Posts: 241 Location: Vancouver, BC
|
ADC question (18F86K22) |
Posted: Mon Nov 14, 2011 12:58 pm |
|
|
Hi There,
I am in the process of redoing my adc readings cause we wanna use the interrupt for getting this done. Looking in the datasheet what TAD i need to use, i found this: For device frequencies above 1 MHz, the
device must be in Sleep mode for the
entire conversion or the A/D accuracy may
be out of specification. In our design, the mcu is clocked with 20MHz now, is this referring to the device as the mcu or the device as the adc? If later, can I set ADC_CLOCK_DIV_32 and i'll be fine or how do i understand this?
Thanks!
Ron |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Nov 14, 2011 1:07 pm |
|
|
The "device" refers to the PIC (not the A/D module). |
|
|
cerr
Joined: 10 Feb 2011 Posts: 241 Location: Vancouver, BC
|
|
Posted: Mon Nov 14, 2011 2:04 pm |
|
|
Hm really? So how would I best go about this then? Also does the controller keep running its timers? I think as it says any enabled interrupts
Quote: | While in sleep, the microcontroller will
continue running peripherals from their respective internal
clocks (if enabled) |
This is from EX_ADMM_SLEEP.C.
But how do i enable this? Otherwise I can't afford to send my mcu to sleep... and miss a timer event!
Any hints?
Thanks! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Nov 14, 2011 2:23 pm |
|
|
Quote: |
Looking in the datasheet what TAD i need to use, i found this: For device frequencies above 1 MHz, the device must be in Sleep mode for the
entire conversion or the A/D accuracy may be out of specification.
|
That quote from the PIC data sheet only applies if you use the internal
RC oscillator for the A/D. You don't have to use it. Use a clock divisor
mode.
Quote: |
In our design, the mcu is clocked with 20MHz now, is this referring to the device as the mcu or the device as the adc? If later, can I set ADC_CLOCK_DIV_32 and i'll be fine or how do i understand this?
|
The PIC data sheet sure doesn't say to use that divisor for 20 MHz.
It says the correct one right here in this table:
Quote: | TABLE 23-1: TAD vs. DEVICE OPERATING FREQUENCIES
|
http://ww1.microchip.com/downloads/en/DeviceDoc/39960d.pdf
As I recall now from previous threads, you don't much like reading data
sheets. I'm going to bail while I'm ahead. |
|
|
cerr
Joined: 10 Feb 2011 Posts: 241 Location: Vancouver, BC
|
|
Posted: Mon Nov 14, 2011 2:37 pm |
|
|
PCM,
Thanks for that and regarding your note
Quote: | As I recall now from previous threads, you don't much like reading data
sheets. I'm going to bail while I'm ahead. |
I don't quite agree. I don't mind reading datasheets but I sometimes don't seem to be finding what I'm looking for and always appreciate your or someone else's assistance!
Thanks! |
|
|
|