Hello everybody,
I'm trying to program a pic16f877 and I need to use the adc on AN0(RA0) but when I try reading the adc using read_adc(); function, the program blocks there. It seems to be in a never ending loop.
Scoppio
Joined: 08 Sep 2010 Posts: 1
Posted: Thu Sep 09, 2010 8:34 am
Post that part of the code and the settings of PORTA and ADC
Wayne_
Joined: 10 Oct 2007 Posts: 681
Posted: Thu Sep 09, 2010 8:51 am
Scoppio wrote:
Post that part of the code and the settings of PORTA and ADC
And the fuses and CCS version info.
Make sure we can compile what you post and it exhibits the fault you have stated.
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
Posted: Thu Sep 09, 2010 8:56 am
Yes.
The only time I have seen somebody manage to hang read_adc, was where it was being used without a setup_adc line, so no clock was selected....
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum