Hello
I have been understanding ADC, but the PBP manual only shows the option 3 (RC)
when defining its clock letting in the nothing the explanation of the options 0 to 2 (that is an omission in the manual). Is this (3) the best option to use de ADC? Or maybe the only one reasonable?
I'm using the 4550 with a 20 Mhz crystal. Do the 0 - 2 options would use this clock? Would it have any advantage respect using the AD RC? (I understood it is internal so I have to do nothing for it to work)
I saw in the 4550 manual about the tad and fosc selections but I suppose that PBP makes that I can ignore them. Am I right?
I have been understanding ADC, but the PBP manual only shows the option 3 (RC)
not really it says
DEFINE ADC_CLOCK 3 ' Set clock source (rc =3) The ADC_CLOCK value corresponds to a value set with 2-5 bits in a register within
the PIC MCU. In most cases, the default value of 3 (binary %11) selects an
independent RC clock that returns an accurate conversion result without regard for
the system clock frequency. Conversion execution time may be enhanced in some
cases by changing this setting.
when defining its clock letting in the nothing the explanation of the options 0 to 2 (that is an omission in the manual). Is this (3) the best option to use de ADC? Or maybe the only one reasonable?
you need to read the data sheet to see what your options are , not all pics are the same ,and osc speed matters
for a pic18f4550 @20mHz the rc clock [3] is a poor choice (see data sheet) , fastest conversion time needs DEFINE ADC_CLOCK 5 ' Set clock source (fosc/16), (2 and 6 would probably also be ok)
I saw in the 4550 manual about the tad and fosc selections but I suppose that PBP makes that I can ignore them. Am I right?
no acquisition time varies with source impedence and the conversion clk needs to be appropriate .
Last edited by richard; - 19th June 2016 at 05:59.
Richard: Thank you very much for your answer. I have studied the manual and it doesn't have the text you showed, surely I have an older version. (if you would have a link) Anyway, thank you. With this information I'm not quite sure about what to do except letting the define_clock at 3. The application doesn't require very fast readings but accurate. I'll read PT100 sensors and I'm now busy making the propper signal conditioner with some op amps. Indeed is a microchip circuit proposal (AN687c document) with little modifications, using the AD of the 4550 instead of an independent AD, and testing with stereo audio cable to connect the three cables between the pic circuit and the PT100 sensors. Yes it is more entertaining than TV, maybe not more than, for instance, "Obsession" movie, with Juliette Binoche (my girlfriend) and Jeremy Irons. Have a good day.
With this information I'm not quite sure about what to do except letting the define_clock at 3.
for a pic18f4550 @20mHz the rc clock [3] is a poor choice (see data sheet) if you are using the adcin command . for accuracy the device needs to sleep during the conversion according to the data sheet and adcin will not do that
Thank you again.
Then ADCIN is an instruction nobody should use in order to have precision?
Excuse me but I have another question, If I use the pins dedicated for AN2 and AN3 in another matters, will the ADC have the 5 volts of Vdd as reference as default? (I hope so because I have any pins left) Or I have to use necesarily AN2 and AN3 to specify that reference?
Have a good day or night.
Luis
Then ADCIN is an instruction nobody should use in order to have precision?
why would you say that ?
adcin is only an issue if you use that chip [pic18f4550] with the adc clock option 3 [rc] and fosc > 1mHz
with fosc=20mHz adcin is fine with adc clock option 5
If I use the pins dedicated for AN2 and AN3 in another matters, will the ADC have the 5 volts of Vdd as reference as default? (I hope so because I have any pins left) Or I have to use necesarily AN2 and AN3 to specify that reference?
the default powerup state for vcfg is 00, which defaults to vss/vdd for reference
Bookmarks