View previous topic :: View next topic |
Author |
Message |
SeeCwriter
Joined: 18 Nov 2013 Posts: 160
|
Analogs on 18F67J60 |
Posted: Tue Feb 18, 2014 11:18 am |
|
|
I was hoping to use Ethernet and a couple of analog inputs on the 18F67J60.
Going through the data sheet and CCS libs, it appears that the analog inputs cannot be selectively enabled. I can't use pins AN4, AN6, and AN7
as analog inputs and pins AN0 and AN1 as digital I/O. It seems that if I want to use AN4, AN6, and AN7 as analog, I also have to set all AN0-3 as analog.
Am I understanding that correctly? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19550
|
|
Posted: Tue Feb 18, 2014 12:47 pm |
|
|
A lot of the slightly 'older' PIC's are like this. Instead of having individual analog enables for each pin, they have a number (normally perhaps 16) of specific patterns of pins that can be selected. The key becomes realising this when you lay out the board, and routing the analog signals to the lines that can be enabled together.
As a comment though in many cases there are newer replacement chips that do have individual enables, and are pin compatible or can be setup to be pin compatible (many of the newer chips have relocatable peripherals).
I can't think of a PIC18 offering Ethernet with this, but it'd be worth a search.
Note that on your chip AN0 and AN1, can still function as LED outputs for the Ethernet, when set as analog. If you look at table 11-13, you will see that these two signals take priority over the analog. Generally pins can still act as digital _outputs_ when selected for AD use, but not as digital inputs. So it depends what you want to do with the chip.
Best Wishes |
|
|
SeeCwriter
Joined: 18 Nov 2013 Posts: 160
|
|
Posted: Tue Feb 18, 2014 1:06 pm |
|
|
That was very helpful information. I did not read the data sheet close enough.
Thank you. |
|
|
|