CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

problem with using ADC channel 1-8

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
pandu.ranganadh



Joined: 28 Apr 2008
Posts: 12
Location: hyd

View user's profile Send private message Visit poster's website AIM Address

problem with using ADC channel 1-8
PostPosted: Mon May 12, 2008 12:46 am     Reply with quote

Hi

I am using pic16f877 and microchip old version board.
My problem is i am unable to get ADC output through channels 1-8.

#include <16F877.H>
#device adc=10
//#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=16000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

#include "flex_lcd.c"

//============================
void main()
{
int16 adc_value;
float volts,a=10.25;

lcd_init();


setup_adc_ports(RA0_ANALOG);

//setup_adc_ports(ALL_ANALOG);

setup_adc(ADC_CLOCK_INTERNAL);

set_adc_channel(5);
//set_adc_channel(1);

delay_us(20);


while(1)
{
adc_value = read_adc();



volts = (float)(adc_value * 5)/1023.0; // This is the fixed formula

//lcd_putc("\f Output \n");

printf(lcd_putc,"\f %3.4f Volts\n",volts);


delay_ms(500);

}


}


My ccs c compiler version is 4.
Please help me to read ADC channels 1-8.

Bye
Thanking you,
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon May 12, 2008 1:03 am     Reply with quote

Please don't start another new topic on the same problem.
You already have four previous topics on it. Just add a new
question to one of the existing topics. Here are all your
previous threads -- all of them on the same topic !

Problem with Multiple ADC channels
http://www.ccsinfo.com/forum/viewtopic.php?t=34748

Problem with Multiple ADC channels
http://www.ccsinfo.com/forum/viewtopic.php?t=34718

Problem with Multiple ADC channels
http://www.ccsinfo.com/forum/viewtopic.php?t=34690

Problem with multiple ADC channels
http://www.ccsinfo.com/forum/viewtopic.php?t=34641

Quote:
My problem is i am unable to get ADC output through channels 1-8.

You have been told in previous answers that your version of the Picdem2
Plus board doesn't support A/D input on all those channels. Some of
the channels are hard-wired for use as normal i/o pins to drive the LCD
or are connected to a trimpot.

Quote:

Please help me to read ADC channels 1-8.

You can't ever use Channels 0, 1, 2, or 3 for general purpose A/D.
There is no channel 8 on the board. You can only use channels 4-7.

Please don't keep asking this question over and over again.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group