Bandgap Reference Connected to Analog Comparator

The Analog Comparator module in ATtiny102/104 has one Internal reference (1.1V – Bandgap) connected to the positive input. For using Bandgap reference voltage as positive input to AC, it is advisable that Bandgap reference is first enabled by writing '1' to ACSRA.ACBG and then selected by writing '1' to ACSRB.ACPMUX. Refer to the Register Description section under the AC module in the ATtiny102/104 device datasheet for detailed description of these registers.