Name:
adcconfig
Syntax:

ADCCONFIG config

Config - is a constant/variable specifying the adc configuration.

Description:

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
Applies To:
08M2, 14M2, 18M2, 20M2, 28X2, 40X2
See Also:
Related Create:
Share:
Print:

Example for 18M2

This example sets the Vref+ to 2.048V on a PICAXE-18M2.

Code Example:
	fvrsetup FVR2048	; set FVR as 2.048V
	adcconfig %011		; set FVR as ADC Vref+, 0V Vref-
Copy Code Submit an Example

Submit Your Own Code!

You must be logged in to submit code examples. Login now.

Comments

  • Login to leave a comment.