Specifications

Built-in function readAdc():
The ADCs on a STM32W108xB return signed 16-bit values, but the data sheets state that only 12 bits
are significant. So, SNAPpy returns signed 12-bit values in the range -4096 to 4095.
Note that this is different than many versions of SNAP to date – usually the values returned by
the SNAPpy readAdc() built-in are unsigned numbers.
There are also optional “divide by 4” (gain = 0.25) “buffers” that can be switched in.
A bigger difference compared to other SNAP ports is that the ADCs on the STM32W108 chips are
always differential – ADC readings are always relative to another signal, even if that signal happens to
be GND (analog ground). The possible voltage references are:
GND
VREF / 2 (0.6 volts)
VREF (1.2 volts)
VREG / 2 (0.9 volts)
(VREG on this chip is 1.8 volts, but is not directly selectable as an analog reference).
Between the 6 different ADC pins, the optional “buffers”, and the 4 voltage references, there are many
possible sampling combinations. The desired combination is specified by choosing two nibbles from
the following table, and combining them together in high nibble/low nibble format.
Hexadecimal Value Normal Meaning (there are exceptions)
0x0 ADC 0 pin, NOT using the divide by 4
0x1 ADC 1 pin, NOT using the divide by 4
0x2 ADC 2 pin, NOT using the divide by 4
0x3 ADC 3 pin, NOT using the divide by 4
0x4 ADC 4 pin, NOT using the divide by 4
0x5 ADC 5 pin, NOT using the divide by 4
0x6 ADC 0 pin, USING the divide by 4
0x7 ADC 1 pin, USING the divide by 4
0x8 GND as a reference
0x9 VREF / 2 (0.6 volts) as a reference
0xA VREF (1.2 volts) as a reference
0xB VREG / 2 (0.9 volts) as a reference
0xC ADC 2 pin, USING the divide by 4
0xD ADC 3 pin, USING the divide by 4
0xE ADC 4 pin, USING the divide by 4
0xF ADC 5 pin, USING the divide by 4
Page 194 of 202 SNAP Reference Manual Document Number 600-0007K