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

How do I do an atod on channel AN5 on a PIC18F4520 40 PIN

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







How do I do an atod on channel AN5 on a PIC18F4520 40 PIN
PostPosted: Wed Aug 29, 2007 8:22 pm     Reply with quote

The Microchip data sheet indicates that you can use RA4 as a analog input for 10 bit conversions, but I see NO reference to this in the CCS device file for the PIC18F4520. I have hardware pcb's in, but since the CCS device has no way of doing an ATOD on RA4 - Am I royally screwed... or is there some other way to read RA4 as an analog input in the setup_adc_ports?

Desparate for an answer before having to spend major bucks on a pcb change. Shocked Shocked Shocked

Thanks!!!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 29, 2007 9:00 pm     Reply with quote

Download the 18F4520 data sheet.
http://ww1.microchip.com/downloads/en/DeviceDoc/39631D.pdf
Look at the pin diagram for the 40-pin DIP package, near the start
of the data sheet.

What capabilities does it list for the RA4 pin ?


Now go to this table in the Device Overview section:
Quote:
TABLE 1-2: PIC18F2420/2520 PINOUT I/O DESCRIPTIONS (CONTINUED)

Find the RA4 pin in the table, and look over in the right column at
the descriptions. See the 3 things that pin RA4 can do. Compare it
to other nearby pins.
Ttelmah
Guest







PostPosted: Thu Aug 30, 2007 3:26 am     Reply with quote

I'd suspect, that the original problem, is confusing RA4, with AN4. This is a source of common confusion with the pin names that MicroChip use.
If anything in the data sheet, says that RA4, can be used as an analog input, then I'm afraid is wrong. The CCS header (in this case), is right...

Best Wishes
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