View previous topic :: View next topic |
Author |
Message |
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
How to configure RG6 for ADC input? |
Posted: Wed Sep 25, 2019 12:58 pm |
|
|
On file 24FJ1024GB606.h there's no RG6 pin in the ADC sector but in the datasheet says that is an analog pin, so how I must to do to configure RG6 and RB15 as analog channels?
Also I can't find in the datasheet a table with channel vs. port pin. _________________ Electric Blue |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19549
|
|
Posted: Wed Sep 25, 2019 1:40 pm |
|
|
You don't. It is not an ADC analog input on the 24FJ1024GB606.
If you check the pin function tables, for this chip it gives:
C1IND/RP21/ICM1/OCM1A/PMA5/RG6
So the pin gives the RG6 I/O function, PMA5, The comparator 1 input D,
the MCCP1 input capture 1, and the MCCP1 output A. No ADC input.
The only analog function is the comparator input.
On the 610 versions of the chip, it does give AN17. Not on the 606
though.
For your chip it is table3.
On the 610, instead you see:
AN17/C1IND/RP21/ICM1/OCM1A/PMA5/RG6 |
|
|
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Thu Sep 26, 2019 12:36 pm |
|
|
You are right, I think, but it's a bit tricky, on page 153 of PDF file 30010074e.pdf ANSE have a note.
"ANSE9 is not available on 64-pin devices."
There's no note for ANSG register, that's why I assumed that can be an analog pin. _________________ Electric Blue |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19549
|
|
Posted: Thu Sep 26, 2019 1:00 pm |
|
|
Yes. The reason there is no note, is the pin does still have an analog
function as the comparator input. RE9 doesn't even exist on the smaller
chips hence the bit is missing for this. |
|
|
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Thu Sep 26, 2019 1:05 pm |
|
|
As RUN DMC song says, It's tricky _________________ Electric Blue |
|
|
|