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

port A as data pins and ANO as analague input pins 16F877A

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



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 27, 2007 12:51 pm     Reply with quote

Quote:

If i use (for 16F877A) pin 2 as analogue input and pin 3,4,5 and 6
as input triggers will it be fine .. i mean it is allowed

Look at the 16F877A.H file, near the end of the file, in the section called:
"Constants used in setup_adc_ports()".

That section lists all the available combinations of Analog and Digital pins.
Look on the right side in the comments, and it gives a list of all the pins
used and their purpose (for example, some pins are assigned to Vref
in some modes).
Guest








PostPosted: Tue Mar 27, 2007 2:09 pm     Reply with quote

this section just gives the combination of analogue ports only


// Constants used in SETUP_ADC_PORTS() are:
#define NO_ANALOGS 7 // None
#define ALL_ANALOG 0 // A0 A1 A2 A3 A5 E0 E1 E2
#define AN0_AN1_AN2_AN4_AN5_AN6_AN7_VSS_VREF 1 // A0 A1 A2 A5 E0 E1 E2 VRefh=A3
#define AN0_AN1_AN2_AN3_AN4 2 // A0 A1 A2 A3 A5
#define AN0_AN1_AN2_AN4_VSS_VREF 3 // A0 A1 A2 A5 VRefh=A3
#define AN0_AN1_AN3 4 // A0 A1 A3
#define AN0_AN1_VSS_VREF 5 // A0 A1 VRefh=A3
#define AN0_AN1_AN4_AN5_AN6_AN7_VREF_VREF 0x08 // A0 A1 A5 E0 E1 E2 VRefh=A3 VRefl=A2
#define AN0_AN1_AN2_AN3_AN4_AN5 0x09 // A0 A1 A2 A3 A5 E0
#define AN0_AN1_AN2_AN4_AN5_VSS_VREF 0x0A // A0 A1 A2 A5 E0 VRefh=A3
#define AN0_AN1_AN4_AN5_VREF_VREF 0x0B // A0 A1 A5 E0 VRefh=A3 VRefl=A2
#define AN0_AN1_AN4_VREF_VREF 0x0C // A0 A1 A5 VRefh=A3 VRefl=A2
#define AN0_AN1_VREF_VREF 0x0D // A0 A1 VRefh=A3 VRefl=A2
#define AN0 0x0E // A0
#define AN0_VREF_VREF 0x0F // A0 VRefh=A3 VRefl=A2


i will consider that for
#define AN0 0x0E // A0

only pin 2 is used as analogue port rest are digital ... i hope am right

thanx for the help
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 27, 2007 2:24 pm     Reply with quote

Quote:
Only pin 2 is used as analogue port rest are digital

That's right. That's a list of the combinations of pins that
can be configured as analog pins. In each #define statement,
any pins that are not list will be configured as digital pins.

Also, when we talk about the analog pins, we normally refer to
them by their name: AN0, AN1, AN2, etc. That's because the
actual pin number may vary, depending upon the package used,
or the PIC that you're using.
ali6094



Joined: 31 Jan 2007
Posts: 18

View user's profile Send private message

PostPosted: Tue Mar 27, 2007 3:44 pm     Reply with quote

thanx my friend that was a real help
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