Hi,
I suggest you do a little reading on Darrels DT_Analog page, I think it answers both questions.
/Henrik.
Hi,
I suggest you do a little reading on Darrels DT_Analog page, I think it answers both questions.
/Henrik.
Thanks Henrik,
that link seems to support what my gray matter was trying to wrap around
I had been to Darrels web site but couldn't figure out how to get past the home page.
My hat is off to those who can take all these intricate details of these PIC's and put it into practical application for the rest of us.
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
Darrel,
More questions...
In your sample code above why is the A/D conversion clock set to FRC??
Does that mean some sort of external hardware RC oscillator?
Can you please shed some light on choosing the A/D conversion clock?
From your website example... it would seem that one should only choose FRC is if the PIC clock is running at 48MHz
or does this table not apply to the 16F1822?
Thanks
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
So after doing some searching I found this... here... http://www.microcontrollerboard.com/...converter.html
so now my question is...
Is FRC just another way of saying Fosc/1 ?
Is it not the case that Fosc/2 or Fosc/8 also come from the internal RC oscillator??
Or is it the case that if one is using an external clock source for the PIC that you can either choose to divide the external clock source by 2, 8 or 32 (in the above example) or use the internal RC clock (FRC) for AD even though the PIC is clocked form an external source??
Finally so far I have not had a need to run my projects faster than 4MHz and I just use the internal clock. So what is the best/correct AD clock source to use?
Is it correct to read from the table on Darrel's AD page... if the OSC is running at 4MHz the best/correct choice is to use Fosc/8 ?
Sorry for dragging this out so much... just trying to understand a little better.
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
I don't think the enhanced cores were available yet when I wrote that page.
The older chips had a minimum TAD of 1.6uS, but the newer ones have a minimum TAD of 1.0uS.
So you could use the values in that table, but they will be off by 1 division from "Optimal" settings.
If you look in the A/D section of the 1822 datasheet, you should see this table ...
I've marked the best setting at each oscillator freq. in red.
Put the matching ADCS bits into the ADCON1 register bits 4-6. DEFINE ADC_CLOCK does not have any effect on the enhanced core devices.
The FRC clock is an internal RC oscillator that is separate from the main internal oscillator (FOSC).
It continues running even when the PIC is put to SLEEP.
It can be used at any OSC. But the actual TAD period can be anywhere from 1.0 - 6.0uS.
Last edited by Darrel Taylor; - 11th February 2014 at 17:31.
DT
Bookmarks