PDA

View Full Version : PIC18F252 and AD configuration



Samoele
- 17th February 2011, 13:50
Hello,

I have PIC18F252 and use first 3 analog input with 10 bit resolution. On each input have trimmer 10K resistor between VCC and GND.
If set one or two trimmer to min.(gnd) then couldn't set third trimmer to over 800? Wheen set two
trimmer to max (VCC) then can set value on third trimmer to max 1023. Where i have made mistake?

my configuration are:

DEFINE ADC_BITS 10 ' ADCIN resolution (Bits)
DEFINE ADC_CLOCK 2 ' ADC clock source (Fosc/32)
DEFINE ADC_SAMPLEUS 11 ' ADC sampling time (uSec)

ADCON1=%10010010
ADCON0=%11000111

Samo

mackrackit
- 18th February 2011, 09:10
The ADCON0 register, shown in Register 17-1, con-
trols the operation of the A/D module. The ADCON1
register, shown in Register 17-2, configures the
functions of the port pins.


Try not setting ADCON0, let PBP take care of that.

Samoele
- 18th February 2011, 13:36
I solve this problem.

I was leaved ADCON1 and ADCON0 to unchanged. I changed sampling time to 50us and ADC clock to 3. Now working each channel independed from other.

I use Mister E PIC multi-calc and A/D calc menu. I don't understand how calculate input impedance?
I have 3 trimmer resistor 10K on each channel. How is then 30k input impedance or 10K in my case?

have someone the solution?

Thanks,
Samo