3.3 Example for ATtiny817

The selected ATtiny817 uses the latest technology from Microchip with a flexible and low-power architecture including Event System and SleepWalking, accurate analog features, and advanced peripherals. Capacitive touch interfaces with driven shields are supported with the integrated QTouch peripheral touch controller.

The Analog-to-Digital Converter (ADC) peripheral in ATtiny817 features a 10-bit successive approximation ADC, and is capable of a sampling rate of up to 150ksps. The ADC is connected to a 12-channel Analog Multiplexer, which allows twelve single-ended voltage inputs. The single-ended voltage inputs refer to 0V (GND). The input values can be either internal (e.g., a voltage reference) or external (connected I/O pins).

The ADC block diagram from the latest data sheet of the ATtiny817 is shown in the figure below.

Figure 3-2. ADC Block Diagram of the ATtiny817

The ADC contains a sample-and-hold circuit, which ensures that the input voltage to the ADC is held at a constant level during conversion.

Any of the ADC input pins, as well as GND and an internal voltage reference (programmable) can be selected as single ended inputs to the ADC. The ADC generates a 10-bit result, which is presented in the Result Register (ADC.RES). The result is presented right adjusted. The minimum value represents GND and the maximum value represents the reference voltage.