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

From F870 to F873 - now adc doesn't work ???

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Darren Logan
Guest







From F870 to F873 - now adc doesn't work ???
PostPosted: Sat Feb 22, 2003 9:21 am     Reply with quote

Hello,

I've moved my code from a PIC16F870 to PIC16F873 and now it seems the AtoD inputs aren't reading correctly.

I would have thought the migration would be straight forward.

Yes i've added ADC=10 after #device in .h file.

Anything different between these two PICs i need to be aware of in terms of A/D setup ?????

Regard,
Darren
___________________________
This message was ported from CCS's old forum
Original Post ID: 12001
Darren Logan
Guest







Re: From F870 to F873 - now adc doesn't work ???
PostPosted: Sat Feb 22, 2003 9:25 am     Reply with quote

sorry, here's some code to chew on (this code works fine on F870 but not F873):

// initialisation:

setup_adc_ports(A_ANALOG);
setup_adc(ADC_CLOCK_INTERNAL);

set_tris_a(0xEF);

// to read a channel...

long ReadADC(int chnl) {

long value;

set_adc_channel(chnl);
delay_us(100);
value=read_adc();
return(value);
}

any ideas please this is driving me nuts !

Regards,
Darren
___________________________
This message was ported from CCS's old forum
Original Post ID: 12002
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