Config - is a constant/variable specifying the adc configuration.
Configure the ADC reference voltages.
The default Vref+signal for the ADC is the power supply (V+) and the default Vref- signal is 0V, so the analogue voltage range is the same as the power supply to the PICAXE chip. However, if desired, the Vref signals can be altered to external pins instead by using the adcconfig command.
PICAXE X2 Parts
Bit3-2 = 11 do not use = 10 VRef+ is FVR (see FVRsetup command) = 01 VRef+ is external pin = 00 VRef+ is V+ (power supply) Bit1-0 = 11 do not use = 10 do not use = 01 VRef- is external pin = 00 VRef- is 0V
PICAXE M2 Parts
Bit2 = 1 VRef- is external pin (if available) = 0 VRef- is 0V Bit1-0 = 11 VRef+ is FVR (see FVRsetup command) = 10 VRef+ is external pin (if available) = 01 do not use = 00 VRef+ is V+ (power supply)
The external Vref+/Vref- pins are as follows:
PICAXE External Vref+ pin External Vref- Pin 08M2 C.1 n/a 14M2 B.1 n/a 18M2 n/a C.2 20M2 B.0 n/a 28X2 A.3 A.2 40X2 A.3 A.2
Submit Your Own Code!
You must be logged in to submit code examples. Login now.