13 register description, 1 admux – adc multiplexer selection register, Attiny43u – Rainbow Electronics ATtiny43U User Manual

Page 126

Advertising
background image

126

8048B–AVR–03/09

ATtiny43U

perature sensor is enabled, the ADC converter can be used in single conversion mode to
measure the voltage over the temperature sensor.

The measured voltage has a linear relationship to the temperature as described in

Table 16-2

The sensitivity is approximately 1 LSB /

°

C and the accuracy depends on the method of user cal-

ibration. Typically, the measurement accuracy after a single temperature calibration is ±

10

°

C,

assuming calibration at room temperature. Better accuracies are achieved by using two
temperature points for calibration.

The values described in

Table 16-2

are typical values. However, due to process variation the

temperature sensor output voltage varies from one chip to another. To be capable of achieving
more accurate results the temperature measurement can be calibrated in the application soft-
ware. The sofware calibration can be done using the formula:

T = k * [(ADCH << 8) | ADCL] + T

OS

where ADCH and ADCL are the ADC data registers, k is the fixed slope coefficient and T

OS

is the

temperature sensor offset. Typically, k is very close to 1.0 and in single-point calibration the
coefficient may be omitted. Where higher accuracy is required the slope coefficient should be
evaluated based on measurements at two temperatures.

16.13 Register Description

16.13.1

ADMUX – ADC Multiplexer Selection Register

• Bit 7 – Res: Reserved Bit

This bit is reserved and must always be written zero.

• Bit 6 – REFS: Reference Selection Bit

This bit selects the voltage reference for the ADC, as shown in

Table 16-3 on page 126

. If this bit

is changed during a conversion, the change will not go in effect until this conversion is complete
(ADIF in ADCSR is set).

• Bits 5:3 – Res: Reserved Bits

These bits are reserved and will always read zero.

Table 16-2.

Temperature vs. Sensor Output Voltage (Typical Case)

Temperature

-40

°

C

+25

°

C

+85

°

C

ADC

230 LSB

300 LSB

370 LSB

Bit

7

6

5

4

3

2

1

0

0x07 (0x27)

REFS

MUX2

MUX1

MUX0

ADMUX

Read/Write

R/W

R/W

R

R

R

R/W

R/W

R/W

Initial Value

0

0

0

0

0

0

0

0

Table 16-3.

Voltage Reference Selections for ADC

REFS

Voltage Reference Selection

0

V

CC

used as analog reference.

1

Internal 1.1V Voltage Reference.

Advertising