hx716
Joined: 20 Nov 2004 Posts: 1
|
ADC problems PIC16F873A |
Posted: Sat Nov 20, 2004 2:15 pm |
|
|
Hello. I am new at it. I am trying to use PIC16F873A 10 bit ADC. The Vdd is 3.3 V at 8.0 MHz.
I use the following code:
#include <16F873A.h>
#fuses HS, NOWDT, NOPROTECT, NOLVP, NOBROWNOUT, PUT
#use delay(clock=8000000)
unsigned int16 value = 0;
setup_adc_ports(ALL_ANALOG);
setup_adc(ADC_CLOCK_DIV_32);
set_adc_channel(0);
delay_us(10);
value = read_adc();
The maximum value I get with Vdd applied to AN0 is 256. It looks like it workes like 8 bit ADC not 10bit. Any Idia?
Thank you in advance. |
|