ADCSetup error in manual?

thunderace7

New Member
Hi. I believe I have found an error in the ADCSetup command description in Manual2. Or it might be that I have misunderstood what it means.
In the section for the 28x2 it says:

Example: let adcsetup = %0000000000001111 ; set ADC0,1,2,3

But in the section for 28x2 -5v it says:

Example: let adcsetup = 4 ; set ADC0,1,2,3 as analogue

From this I assume that the mask is just a number and can be represented in any base that the picaxe understands (decimal, binary, hex or octal). If this is so, surely the second example sets only ADC2 as analogue?

Or have I misunderstood it?
 

hippy

Technical Support
Staff member
The way ADCSETUP works differs depending on the chip; some chips use a bit mask (28x2, 28X2-3V) and others use a range value 'sequential masking' (28X2-5V).

Using 'LET ADCSETUP = 4' will set only ADC2 as analogue on a 28X2 or 28X2-3V, but will set ADC3, ADC2, ADC1 and ADC0 as analogue on the 28X2-5V.

It can be a little confusing because it all depends on the silicon used within the particular chip model which is outside our control.

 

thunderace7

New Member
Hi, Hippy, thank you for the explanation. As I suspected, I had misunderstood the manual.
I don't have a 28x2 -5v so I hadn't fully read the detail, just saw the example at the end.
I never remember that the command descriptions are available from the home page. I always use the manual but there are sometimes small differences in the descriptions that might aid understanding. I will try to remember to read all that is available, ALL of the Manual description and also that from the website. That way I might understand things better.
 
Top