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 CCS Technical Support

16F916 and setup_adc_ports

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








16F916 and setup_adc_ports
PostPosted: Wed Dec 07, 2005 3:59 am     Reply with quote

Dear,

PCWH 3.236
MPLAB 7.22
PIC16F916

Code:

setup_adc_ports(RA0_ANALOG);


results in : Undefined identifier RA0_ANALOG

using

Code:

setup_adc_ports(AN0_ANALOG);


is the same.

Any ideas what is wrong?

best regards
nilsener
Paolino



Joined: 19 Jan 2004
Posts: 42

View user's profile Send private message

PostPosted: Wed Dec 07, 2005 4:09 am     Reply with quote

I have not tested the code, but if you look at the 16F916.h file (find it in the c:\program files\picc\devices folder), you get:

Code:
// Constants used in SETUP_ADC_PORTS() are:
#define sAN0            1       //| A0
#define sAN1            2       //| A1
#define sAN2            4       //| A2
#define sAN3            8       //| A3
#define sAN4            16      //| A5
#define NO_ANALOGS      0       // None
#define ALL_ANALOG      31      // A0 A1 A2 A3 A5


Modify your code as:
Code:
setup_adc_ports(sAN0);

and test it.

Best regards.

Paolo.
Guest








PostPosted: Wed Dec 07, 2005 4:11 am     Reply with quote

Dear Paolino,

it works, thank you very much!!

Regards
nilsener
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