Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
AVR / datasheets / attiny_26_26L.pdf
Скачиваний:
46
Добавлен:
20.03.2015
Размер:
2.25 Mб
Скачать

• 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 47. 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

 

 

 

 

 

 

 

 

 

 

$04 ($24)

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

 

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 46 on page 104. For single ended channels, $000 represents analog ground, and $3FF represents the selected reference voltage minus one LSB.

106 ATtiny26(L)

1477J–AVR–06/07

Scanning Multiple

Channels

ADC Noise Canceling

Techniques

Offset Compensation

Schemes

1477J–AVR–06/07

ATtiny26(L)

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 57.

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.

The gain stage has a built-in offset cancellation circuitry that nulls the offset of differential measurements as much as possible. The remaining offset in the analog path can be measured directly by selecting the same channel for both differential inputs. This offset residue can be then 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.

107

Figure 57. ADC Power Connections

 

 

 

 

 

(MOSI/DI/SDA/OC1A) PB0

1

 

 

 

 

 

 

(MISO/DO/OC1A) PB1

2

 

 

 

 

 

 

(SCK/SCL/OC1B) PB2

3

 

 

 

 

 

 

(OC1B) PB3

4

 

 

 

VCC

 

 

5

 

 

 

 

 

 

 

GND

 

ATtiny26/L

 

 

6

 

 

 

 

 

 

 

 

 

 

 

(ADC7/XTAL1) PB4

7

 

 

 

 

 

 

 

 

 

 

 

(ADC8/XTAL2) PB5

8

 

 

 

 

 

 

(ADC9/INT0/T0) PB6

9

 

 

 

 

 

 

(ADC10/RESET) PB7

10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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)

108 ATtiny26(L)

1477J–AVR–06/07

Memory

Programming

Program and Data

Memory Lock Bits

1477J–AVR–06/07

ATtiny26(L)

The ATtiny26 provides two Lock bits which can be left unprogrammed (“1”) or can be programmed (“0”) to obtain the additional features listed in Table 49. The Lock bits can only be erased to “1” with the Chip Erase command.

Table 48. Lock Bit Byte(1)

Lock Bit Byte

Bit No

Description

Default Value

 

 

 

 

 

7

1 (unprogrammed)

 

 

 

 

 

6

1 (unprogrammed)

 

 

 

 

 

5

1 (unprogrammed)

 

 

 

 

 

4

1 (unprogrammed)

 

 

 

 

 

3

1 (unprogrammed)

 

 

 

 

 

2

1 (unprogrammed)

 

 

 

 

LB2

1

Lock bit

1 (unprogrammed)

 

 

 

 

LB1

0

Lock bit

1 (unprogrammed)

 

 

 

 

Note: 1. “1” means unprogrammed, “0” means programmed

Table 49. Lock Bit Protection Modes

Memory Lock Bits

 

 

 

 

 

 

 

LB Mode

LB2(2)

 

LB1(2)

Protection Type

1

1

 

1

No memory lock features enabled.

 

 

 

 

 

 

 

 

 

Further programming of the Flash and EEPROM is

2

1

 

0

disabled in parallel and serial programming mode. The

 

Fuse bits are locked in both serial and parallel

 

 

 

 

 

 

 

 

programming mode.(1)

 

 

 

 

Further programming and verification of the Flash and

3

0

 

0

EEPROM is disabled in parallel and serial programming

 

mode. The Fuse bits are locked in both serial and parallel

 

 

 

 

 

 

 

 

programming mode.(1)

Notes: 1. Program the Fuse bits before programming the Lock bits. 2. “1” means unprogrammed, “0” means programmed

109

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