Give up now. I started out to map the ADC inputs and got totally unexpected results. The code looks like:
Code:
; Mapping ADC inputs because of forum question from Pete Rowe (Wizard1)
ADCVal var word
ADCNum var byte
CLEAR
PAUSE 500
TRISA = $FF
TRISB = $FF
TRISC = $FF
TRISD = $FF
TRISE = $FF
MAIN
ADIN A4, ADCVal
GOSUB ReportADC
ADCNum = ADCNum + 1 ;1
ADIN E1, ADCVal
GOSUB ReportADC
ADCNum = ADCNum + 1 ;2
ADIN A0, ADCVal
GOSUB ReportADC
ADCNum = ADCNum + 1 ;3
ADIN A1, ADCVal
GOSUB ReportADC
ADCNum = 0
ADCVal = 111
GOTO MAIN
ReportADC
SEROUT C7, i9600, ["#",dec ADCNum, ": ", dec ADCVal, 13]
PAUSE 200
RETURN
i started with A0, A1, A2 and A3. The printout reports the #, followed by the resulting ADC reading. You just match up the # (0-3) with the specified pin number to do the map. The early results showed some pins, like A0 and B0, reported to the other three pins! I don't have a connection from the headers to pins A6 and A7, so can't say where they go.
The results were strange:
Code:
Used Was
A0 - A0
A1 - A2
A2 - A5
A3 - E1
A4 - A1
A5 - A1
A6 - NC
A7 - NC
B0 - E1
B1 - E0
Somewhere in the pin definitions for this chip, the ADC pins got totally messed with.
Feel free to finish the map.
At least you know how to specify E0 and E1 for ADC: use B1 and B0! I think. E1 also appears on A3. I haven't checked the data sheet for the 16F887, these may have no connection to the real world?!
Later.