Anda di halaman 1dari 23

Attiny2313 periferie

X=1-4KB
Y=64B – 126B
Z=64B – 128B
N=6 - 18

V. Kushpil (ÚJF AVCR)


Attiny2313 periferie (I/O schematy)
General Digital I/O

I/O Pin Equivalent Schematic


.

Port Pin Configurations

V. Kushpil (ÚJF AVCR)


Attiny2313 periferie (I/O registry)

V. Kushpil (ÚJF AVCR)


Attiny2313 periferie (I/O registry 2)

V. Kushpil (ÚJF AVCR)


Attiny2313 periferie (I/O registry 3)

Alternate Port Functions

Note: 1.
WRx, WPx, WDx,
RRx, RPx, and RDx
are common to all pins
within the same port.
clkI/O, SLEEP, and PUD
are common to all ports.
All other signals are
unique for each pin.

V. Kushpil (ÚJF AVCR)


Attiny2313 periferie (I/O registry 4)
Generic Description
of Overriding
Signals for Alternate
Functions

V. Kushpil (ÚJF AVCR)


Attiny2313 periferie (I/O registry 5)
MCU Control Register –
MCUCR

V. Kushpil (ÚJF AVCR)


Attiny2313 periferie (I/O registry 6)
• USCK/SCL/PCINT7 - Port B, Bit 7
USCK: Three-wire mode Universal Serial Interface Clock. SCL: Two-wire mode Serial Clock for USI Two-wire mode.PCINT7: Pin Change
Interrupt source 7. The PB7 pin can serve as an external interrupt source.
• DO/PCINT6 - Port B, Bit 6
DO: Three-wire mode Universal Serial Interface Data output. Three-wire mode Data output overrides PORTB6 value and it is driven to the port
when data direction bit DDB6 is set (one). However the PORTB6 bit still controls the pull-up enabling pull-up, if direction is input and PORTB6
is set (one). PCINT6: Pin Change Interrupt Source 6. The PB6 pin can serve as an external interrupt source.
• DI/SDA/PCINT5 - Port B, Bit 5
DI: Three-wire mode Universal Serial Interface Data input. Three-wire mode does not override normal port functions, so pin must be configured
as an input. SDA: Two-wire
mode Serial Interface Data. PCINT5: Pin Change Interrupt Source 5. The PB5 pin can serve as an external interrupt source.
• OC1B/PCINT4 – Port B, Bit 4
OC1B: Output Compare Match B output: The PB4 pin can serve as an external output for the Timer/Counter1 Output Compare B. The pin has
to be configured as an output
(DDB4 set (one)) to serve this function. The OC1B pin is also the output pin for the PWM mode timer function.
PCINT4: Pin Change Interrupt Source 4. The PB4 pin can serve as an external interrupt source.
• OC1A/PCINT3 – Port B, Bit 3
OC1A: Output Compare Match A output: The PB3 pin can serve as an external output for the Timer/Counter1 Output Compare A. The pin has
to be configured as an output .
(DDB3 set (one)) to serve this function. The OC1A pin is also the output pin for the PWM mode timer function. PCINT3: Pin Change Interrupt
Source 3: The PB3 pin can serve as an external interrupt source.
• OC0A/PCINT2 – Port B, Bit 2
OC0A: Output Compare Match A output. The PB2 pin can serve as an external output for the Timer/Counter0 Output Compare A. The pin has
to be configured as an output
(DDB2 set (one)) to serve this function. The OC0A pin is also the output pin for the PWM mode timer function. PCINT2: Pin Change Interrupt
Source 2. The PB2 pin can serve as an external interrupt source.
• AIN1/PCINT1 – Port B, Bit 1
AIN1: Analog Comparator Negative input. Configure the port pin as input with the internal pull-up switched off to avoid the digital port function
from interfering with the function
of the analog comparator. PCINT1: Pin Change Interrupt Source 1. The PB1 pin can serve as an external interrupt source.
• AIN0/PCINT0 – Port B, Bit 0
AIN0: Analog Comparator Positive input. Configure the port pin as input with the internal pull-up switched off to avoid the digital port function
from interfering with the function of the Analog Comparator. PCINT0: Pin Change Interrupt Source 0. The PB0 pin can serve as an external
interrupt source. Table 26 and Table 27 relate the alternate functions of Port B to the overriding signals shown in Figure 25 on page 54. SPI
MSTR INPUT and SPI SLAVE OUTPUT constitute the MISO signal, while MOSI is divided into SPI MSTR OUTPUT and SPI SLAVEINPUT.

V. Kushpil (ÚJF AVCR)


Attiny2313 periferie (I/O registry 7)

V. Kushpil (ÚJF AVCR)


Attiny2313 periferie (I/O registry 8)
• ICP – Port D, Bit 6
ICP: Timer/Counter1 Input Capture Pin. The PD6 pin can act as an Input Capture pin for
Timer/Counter1
• OC0B/T1 – Port D, Bit 5
OC0B: Output Compare Match B output: The PD5 pin can serve as an external output for the
Timer/Counter0 Output Compare B. The pin has to be configured as an output (DDD5 set (one)) to
serve this function. The OC0B pin is also the output pin for the PWM mode timer function. T1:
Timer/Counter1 External Counter Clock input is enabled by setting (one) the bits CS02 and CS01 in
the Timer/Counter1 Control Register (TCCR1).
• T0 – Port D, Bit 4
T0: Timer/Counter0 External Counter Clock input is enabled by setting (one) the bits CS02 and CS01
in the Timer/Counter0 Control Register (TCCR0). .
• INT1 – Port D, Bit 3
INT1: External Interrupt Source 1. The PD3 pin can serve as an external interrupt source to the MCU.
• INT0/XCK/CKOUT – Port D, Bit 2
INT0: External Interrupt Source 0. The PD2 pin can serve as en external interrupt source to the MCU.
XCK: USART Transfer Clock used only by Synchronous Transfer mode. CKOUT: System Clock
Output
• TXD – Port D, Bit 1
TXD: UART Data Transmitter.
• RXD – Port D, Bit 0
RXD: UART Data Receiver.

V. Kushpil (ÚJF AVCR)


Attiny2313 periferie
8-bit Timer/Counter0 with PWM

• Two Independent
Output
Compare Units
• Double Buffered
Output
Compare Registers
• Clear Timer on
Compare
. Match (Auto Reload)
• Glitch Free, Phase
Correct
Pulse Width Modulator
(PWM)
• Variable PWM Period
• Frequency Generator
• Three Independent
Interrupt Sources
(TOV0, OCF0A, and
OCF0B)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM (1)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM (2)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM (3)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM (4)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM (5)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM
( Timer/Counter ControlRegister A – TCCR0A)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM
( Timer/Counter ControlRegister A – TCCR0A)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM
( Timer/Counter ControlRegister A – TCCR0A)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM
( Timer/Counter ControlRegister A – TCCR0B)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM
( Timer/Counter ControlRegister A – TCNT0,OCROA,OCROB)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM
( Timer/Counter ControlRegister A – TIMSK)

V. Kushpil (ÚJF AVCR)


8-bit Timer/Counter0 with PWM
( Timer/Counter ControlRegister A – TIFR)

V. Kushpil (ÚJF AVCR)

Anda mungkin juga menyukai