Anselc correctly set ?
Yes,
ANSELC = %11000 'C.3, C.4 analog
C.3 and C.4 are AN15 and AN16
I suspect that unless there is my mistake somewhere, input # may be a byte variable in PBP3
I did the reading manually:
ADCON2 = %10000000 '111 'LEFT JUSTIFIED(0),not used,...
ADCON0 = %1000001 'AN16 USED 10000, NO GO NOW,STAY ON
ADCON1 = %1000 'VOLTAGE REFFERENCES
VREFCON0 = %10010000 'ENABLED, SET FOR 1.024 VOLT
RefNotReady:
IF VREFCON0.6 = 0 THEN GOTO RefNotReady
PAUSEUS 50
ADCON0 = %1000011 'GO NOW
ADCNotComplete:
IF ADCON0.1 = 1 THEN GOTO ADCNotComplete
AMB_TEMP.BYTE1 = ADRESH
AMB_TEMP.BYTE0 = ADRESL
VREFCON0 = 0 'DISABLE REFERENCE
ADCON1 = 0
ADCON0 = 0 'CONVERTER OFF, NO CURRENT
This seems to be working well
Which version of PBP are you using? The manual does not mention any limit to the number of addresses, but it is suspicious that 0-15 work and 16 and up do not...
It is PBP3 3.0.7.4, must be the most recent. Actually I did not try higher #s than 16.
Bookmarks