• Aucun résultat trouvé

ADC Characteristics

Dans le document with 1K Byte Flash (Page 50-54)

Symbol Parameter Condition Min Typ Max Units

Resolution

Single-ended Conversion 10.0 Bits

Differential Conversion

Gain = 1x or 20x 8.0 Bits

Absolute Accuracy

Single-ended Conversion VREF = 4V

ADC Clock = 200 kHz

1.0 2.0 LSB

Single-ended Conversion VREF = 4V

ADC Clock = 1 MHz

4.0 LSB

Single-ended Conversion VREF = 4V

ADC Clock = 2 MHz

16.0 LSB

Integral Non-linearity VREF > 2V 0.5 LSB

Differential Non-linearity VREF > 2V 0.5 LSB

Zero Error (Offset) VREF > 2V 1.0 LSB

Conversion Time Free Running Conversion 65.0 260.0 µs

Clock Frequency 50.0 200.0 kHz

VREF Reference Voltage

Single-ended Conversion 2.0 VCC V

Differential Conversion 2.0 VCC - 0.2 V

VINT Internal Voltage Reference 2.4 2.56 2.7 V

RREF Reference Input Resistance 6.0 10.0 13.0 kΩ

RAIN Analog Input Resistance 100.0 MΩ

I/O Port B

All AVR ports have true read-modify-write functionality when used as general digital I/O ports. This means that the direction of one port pin can be changed without unintention-ally changing the direction of any other pin with the SBI and CBI instructions. The same applies for changing drive value (if configured as output) or enabling/disabling of pull-up resistors (if configured as input).

Port B is a 6-bit bi-directional I/O port.

Three data memory address locations are allocated for Port B, one each for the Data Register – PORTB, $18, Data Direction Register – DDRB, $17, and the Port B Input Pins – PINB, $16. The Port B Input Pins address is read-only, while the Data Register and the Data Direction Register are read/write.

Ports PB5..0 have special functions as described in the section “Pin Descriptions” on page 4. If PB5 is not configured as External Reset, it is input with no pull-up or as an open-drain output. All I/O pins have individually selectable pull-ups, which can be over-ridden with pull-up disable.

The Port B output buffers on PB0 to PB4 can sink 20 mA and thus drive LED displays directly. PB5 can sink 12 mA. When pins PB0 to PB4 are used as inputs and are exter-nally pulled low, they will source current (IIL) if the internal pull-ups are activated.

Alternative Functions of Port B

In ATtiny15L four Port B pins – PB2, PB3, PB4, and PB5 – have alternative functions as inputs for the ADC. If some Port B pins are configured as outputs, it is essential that these do not switch when a conversion is in progress. This might corrupt the result of the conversion. During Power-down mode and ADC Noise Reduction mode, the Schmitt triggers of the digital inputs are disconnected on these pins. This allows an analog input voltage close to VCC/2 to be present during Power-down without causing excessive power consumption. The Port B pins with alternate functions are shown in Table 1 on page 4.

When the pins PB4..0 are used for the alternate function, the DDRB and PORTB Regis-ters have to be set according to the alternate function description. When PB5 is used as External Reset pin, the values in the corresponding DDRB and PORTB bit are ignored.

The Port B Data Register – PORTB

The Port B Data Direction Register – DDRB

The Port B Input Pins Address – PINB

The Port B Input Pins address (PINB) is not a register, and this address enables access to the physical value on each Port B pin. When reading PORTB, the PORTB Data Latch is read, and when reading PINB, the logical values present on the pins are read.

Bit 7 6 5 4 3 2 1 0

$18 PORTB4 PORTB3 PORTB2 PORTB1 PORTB0 PORTB

Read/Write R R R R/W R/WS R/W R/W R/W

$16 PINB5 PINB4 PINB3 PINB2 PINB1 PINB0 PINB

Read/Write R R R R R R R R

Initial Value 0 0 N/A N/A N/A N/A N/A N/A

PORT B as General Digital I/O The lower five pins in Port B are equal when used as digital I/O pins.

PBn, general I/O pin: The DDBn bit in the DDRB Register selects the direction of this pin. If DDBn is set (one), PBn is configured as an output pin. If DDBn is cleared (zero), PBn is configured as an input pin. If PORTBn is set (one) when the pin is configured as an input pin, the MOS pull-up resistor is activated. To switch the pull-up resistor off, the PORTBn has to be cleared (zero) or the pin has to be configured as an output pin. Pull-ups for all ports can be disabled also by setting PUD-bit in the MCUCR Register.

Note: 1. n: 4, 3…0, pin number.

On ATtiny15L, PB5 is input or open-drain output. Because this pin is used for 12V pro-gramming, there is no ESD protection diode limiting the voltage on the pin to VCC+ 0.5V. Thus, special care should be taken to ensure that the voltage on this pin does not rise above VCC + 1V during normal operation. This may cause the MCU to reset or enter Programming mode unintentionally.

All Port B pins are connected to a pin change detector that can trigger the pin change interrupt. See “Pin Change Interrupt” on page 22 for details.

Alternate Functions of Port B The alternate pin functions of Port B are:

• RESET – PORT B, Bit 5

When the RSTDISBL Fuse is unprogrammed, this pin serves as External Reset. When the RSTDISBL Fuse is programmed, this pin is a general input pin or a open-drain out-put pin. If DDB5 is cleared (zero), PB5 is configured as an inout-put pin. If DDB5 is set (one), the pin is a open-drain output.

• SCK/INT0/T0 – PORT B, Bit 2

In Serial Programming mode, this pin serves as the serial clock input, SCK.

In Normal mode, this pin can serve as the external interrupt0 input. See the interrupt description for details on how to enable this interrupt. Note that activity on this pin will trigger the interrupt even if the pin is configured as an output.

In Normal mode, this pin can serve as the external counter clock input. See the Timer/Counter0 description for further details. If external Timer/Counter clocking is selected, activity on this pin will clock the counter even if it is configured as an output.

Table 22. DDBn Effects on Port B Pins(1)

DDBn PORTBn I/O Pull-up Comment

0 0 Input No Tri-state (High-Z)

0 1 Input No PUD bit in the MCUCR Register is set.

0 1 Input Yes PBn will source current if ext. pulled low.

PUD bit in the MCUCR Register is cleared.

1 0 Output No Push-pull Zero Output

1 1 Output No Push-pull One Output

• MISO/OC1A/AIN1 – PORT B, Bit 1

In Serial Programming mode, this pin serves as the serial data output, MISO.

In Normal mode, this pin can serve as Timer/Counter1 output compare match output (OC1A). See the Timer/Counter1 description for further details, and how to enable the output. The OC1A pin is also the output pin for PWM mode timer function.

This pin also serves as the negative input of the On-chip Analog Comparator.

• MOSI/AIN0/AREF – PORT B, Bit 0

In Serial Programming mode, this pin serves as the serial data input, MOSI.

In Normal mode, this pin also serves as the positive input of the On-chip Analog Comparator.

In ATtiny15L, this pin can be chosen to be the reference voltage for the ADC. Refer to the section “The Analog-to-Digital Converter, Analog Multiplexer, and Gain Stages” for details.

Memory

Dans le document with 1K Byte Flash (Page 50-54)

Documents relatifs