AnalogReference Property

Public Property AnalogReference As Eth32AnalogReference

Summary

This property configures the voltage source to be used by the Analog to Digital Converter as the reference voltage for analog conversions. The reference voltage determines the voltage level that will give the highest possible analog reading value. There are three possible voltages that may be used: An externally-generated voltage supplied on the analog reference pin, internal 5V, and internally generated 2.56V.

Parameters

This property does not have any parameters.

Value

This property is a Eth32AnalogReference enumerator type, which has the following valid values:

  • REF_EXTERNAL - Selects the external, user-supplied voltage.

  • REF_INTERNAL - Selects the internal 5V source.

  • REF_256 - Selects the internal 2.56V reference.

Remarks

Note that whatever voltage source is selected will be internally connected to the external voltage reference pin. So for example, if you have a 4V source connected to the external reference pin, you should NOT configure the reference for REF_INTERNAL or REF_256 until you have disconnected the external reference pin.

Also note that if you connect a voltage to the external reference pin, it must not exceed 5V or go below 0V.

See Also

AnalogState Property, InputAnalog Method