View previous topic :: View next topic |
Author |
Message |
prsguitarplayer Guest
|
How do I do an atod on channel AN5 on a PIC18F4520 40 PIN |
Posted: Wed Aug 29, 2007 8:22 pm |
|
|
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.
Thanks!!!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Aug 29, 2007 9:00 pm |
|
|
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
|
|
Posted: Thu Aug 30, 2007 3:26 am |
|
|
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 |
|
|
|