Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
mikrocont / ATtiny26.pdf
Источник:
Скачиваний:
59
Добавлен:
06.01.2022
Размер:
1.98 Mб
Скачать

ATtiny26(L)

• Bits 2..0 – ADPS2..0: ADC Prescaler Select Bits

These bits determine the division factor between the CK frequency and the input clock to the ADC.

Table 38. ADC Prescaler Selections

ADPS2

ADPS1

ADPS0

Division Factor

 

 

 

 

0

0

0

2

 

 

 

 

0

0

1

2

 

 

 

 

0

1

0

4

 

 

 

 

0

1

1

8

 

 

 

 

1

0

0

16

 

 

 

 

1

0

1

32

 

 

 

 

1

1

0

64

 

 

 

 

1

1

1

128

 

 

 

 

ADC Data Register – ADCL

and ADCH

ADLAR = 0

Bit

15

14

13

12

11

10

9

8

 

$05 ($25)

ADC9

ADC8

ADCH

 

 

 

 

 

 

 

 

 

 

$04 ($24)

ADC7

ADC6

ADC5

ADC4

ADC3

ADC2

ADC1

ADC0

ADCL

 

 

 

 

 

 

 

 

 

 

 

7

6

5

4

3

2

1

0

 

Read/Write

R

R

R

R

R

R

R

R

 

 

R

R

R

R

R

R

R

R

 

Initial Value

0

0

0

0

0

0

0

0

 

 

0

0

0

0

0

0

0

0

 

ADLAR = 1

Bit

15

14

13

 

12

11

10

9

8

 

$05 ($25)

ADC9

ADC8

ADC7

 

ADC6

ADC5

ADC4

ADC3

ADC2

ADCH

 

 

 

 

 

 

 

 

 

ADCL

$04 ($24)

ADC1

ADC0

 

 

 

 

 

 

 

 

 

 

 

 

7

6

5

 

4

3

2

1

0

 

Read/Write

R

R

R

R

R

R

R

R

 

 

R

R

R

R

R

R

R

R

 

Initial Value

0

0

0

 

0

0

0

0

0

 

 

0

0

0

 

0

0

0

0

0

 

When an ADC conversion is complete, the result is found in these two registers. The ADLAR bit in ADMUX affect the way the result is read from the registers. If ADLAR is set, the result is left adjusted. If ADLAR is cleared (default), the result is right adjusted. If the result is left adjusted and no more than 8-bit precision is required, it is sufficient to read ADCH. Otherwise, ADCL must be read first, then ADCH.

• ADC9..0: ADC Conversion Result

These bits represent the result from the conversion. For differential channels, this is the absolute value after gain adjustment, as indicated in Table 37 on page 85. For single ended channels, $000 represents analog ground, and $3FF represents the selected reference voltage minus one LSB.

87

1477B–AVR–04/02

Scanning Multiple

Channels

ADC Noise Canceling

Techniques

Offset Compensation

Schemes

Since change of analog channel always is delayed until a conversion is finished, the Free Running mode can be used to scan multiple channels without interrupting the converter. Typically, the ADC Conversion Complete interrupt will be used to perform the channel shift. However, the user should take the following fact into consideration:

The interrupt triggers once the result is ready to be read. In Free Running mode, the next conversioin will start immediately when the interrupt triggers. If ADMUX is changed after the interrupt triggers, the next conversion has already started, and the old setting is used.

Digital circuitry inside and outside the ATtiny26/L generates EMI which might affect the accuracy of analog measurements. If conversion accuracy is critical, the noise level can be reduced by applying the following techniques:

1.The analog part of the ATtiny26/L and all analog components in the application should have a separate analog ground plane on the PCB. This ground plane is connected to the digital ground plane via a single point on the PCB.

2.Keep analog signal paths as short as possible. Make sure analog tracks run over the analog ground plane, and keep them well away from high-speed switching digital tracks.

3.The AVCC pin on the ATtiny26/L should be connected to the digital VCC supply voltage via an LC network as shown in Figure 52.

4.Use the ADC noise canceler function to reduce induced noise from the CPU.

5.If some pins are used as digital outputs, it is essential that these do not switch while a conversion is in progress in that port.

All active gain stages and differential-to-single-ended stages in front of the ADC have a built-in offset cancellation circuitry that nulls the offset of these stages as much as possible.

In the case of unity gain differential measurements, the remaining worst case offset in the differential to single-ended stage is less than 5 mV offset (typically 3 mV), or two LSBs.

In the case of 20x gain differential measurements, the remaining worst case offset error is in the range of 10 mV in the ADC conversion result. If the internal voltage reference (2.56V) is used during conversion of differential channels, one LSB of the 10-bit ADC is 2.56 mV, i.e., the worst case error is approximately four LSBs. This error is fairly stable over short term, as temperature which is the main contributor to offset drift, varies slowly. Offset variation over the temperature range is in the order of 5 mV, i.e., approximately two LSBs.

If better offset cancellation is desired, it is possible to select the same channel for both differential input references and actually measure the offset from the complete analog path. This offset residue can then be subtracted in software from the measurement results. Using this kind of software based offset correction, offset on any channel can be reduced below one LSB.

88 ATtiny26(L)

1477B–AVR–04/02

Figure 52. ADC Power Connections

 

 

 

 

 

 

 

 

(MOSI/DI/SDA/OC1A) PB0

1

 

 

 

 

 

 

(MISO/DO/OC1A) PB1

2

 

 

 

 

 

 

 

 

 

(SCK/SCL/OC1B) PB2

3

 

 

 

 

 

 

 

 

(OC1B) PB3

4

 

 

 

 

VCC

 

 

 

 

5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ATtiny26/L

 

 

 

GND

 

 

 

 

 

6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(ADC7/XTAL1) PB4

7

 

 

 

 

 

 

 

 

 

 

 

(ADC8/XTAL2) PB5

8

 

 

 

 

 

 

 

 

 

(ADC9/INT0/T0) PB6

9

 

 

 

 

 

 

(ADC10/RESET) PB7

10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1477B–AVR–04/02

ATtiny26(L)

 

 

 

 

 

 

 

 

Plane

20

 

PA0 (ADC0)

 

 

Ground

 

 

 

 

 

19

 

PA1 (ADC1)

 

 

Analog

 

 

 

 

 

18

 

PA2 (ADC2)

 

 

 

 

 

 

 

17

 

PA3 (AREF)

 

 

 

 

 

 

 

16

 

GND

 

µΗ

 

 

 

 

 

 

10

 

 

 

 

 

 

15

 

AVCC

 

 

100nF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

14 PA4 (ADC3)

13 PA5 (ADC4)

12 PA6 (ADC5/AIN0)

11 PA7 (ADC6/AIN1)

89

Соседние файлы в папке mikrocont