ADCIN must use the ADC channel number, not it's pin name
ADCIN 5, Accel ' Read channel 5 to Accel
ADCIN 6, Gain ' Read channel 6 to Gain
ADCIN must use the ADC channel number, not it's pin name
ADCIN 5, Accel ' Read channel 5 to Accel
ADCIN 6, Gain ' Read channel 6 to Gain
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks Steve, but how does the ADC know which port to read in? For example, we could read in PortA.1 or PortB.1
cheers
Mark.
It's all about it's associated Channel number.
PortB.0.= AN0 = Channel 0 = ADCIN 0, bVar
PortB.7 = AN6 = Channel 6 = ADCIN 6, bVar
PBP manual:
ADCIN
ADCIN Channel,Var
Read the on-chip analog to digital converter Channel and store the result in Var. While the ADC registers can be accessed directly, ADCIN makes the process a little easierManual Really said Channel... not pin name.
Further details, open the datasheet, and see how you manually implement it... you also select/assign a channel number to the PIC register, not a pin name.
hth
Last edited by mister_e; - 15th June 2011 at 02:15.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks