EasyManua.ls Logo

Atmel ATtiny25 User Manual

Atmel ATtiny25
196 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #90 background image
90
7598H–AVR–07/09
ATtiny25/45/85
14.1.11 Timer/Counter1 in PWM Mode
When the PWM mode is selected, Timer/Counter1 and the Output Compare Register C -
OCR1C form a dual 8-bit, free-running and glitch-free PWM generator with outputs on the
PB1(OC1A) and PB3(OC1B) pins and inverted outputs on pins PB0(OC1A
) and PB2(OC1B). As
default non-overlapping times for complementary output pairs are zero, but they can be inserted
using a Dead Time Generator (see description on page 100).
Figure 14-4. The PWM Output Pair
When the counter value match the contents of OCR1A or OCR1B, the OC1A and OC1B outputs
are set or cleared according to the COM1A1/COM1A0 or COM1B1/COM1B0 bits in the
Timer/Counter1 Control Register A - TCCR1, as shown in Table 14-4.
Timer/Counter1 acts as an up-counter, counting from $00 up to the value specified in the output
compare register OCR1C, and starting from $00 up again. A compare match with OC1C will set
an overflow interrupt flag (TOV1) after a synchronization delay following the compare event.
Note that in PWM mode, writing to the Output Compare Registers OCR1A or OCR1B, the data
value is first transferred to a temporary location. The value is latched into OCR1A or OCR1B
when the Timer/Counter reaches OCR1C. This prevents the occurrence of odd-length PWM
pulses (glitches) in the event of an unsynchronized OCR1A or OCR1B. See Figure 14-5 for an
example.
Table 14-4. Compare Mode Select in PWM Mode
COM11 COM10 Effect on Output Compare Pins
00
OC1x not connected.
OC1x
not connected.
01
OC1x cleared on compare match. Set whenTCNT1 = $01.
OC1x
set on compare match. Cleared when TCNT1 = $00.
10
OC1x cleared on compare match. Set when TCNT1 = $01.
OC1x
not connected.
11
OC1x Set on compare match. Cleared when TCNT1= $01.
OC1x
not connected.
PWM1x
PWM1x
x = A or B
t
non-overlap
=0
t
non-overlap
=0

Table of Contents

Question and Answer IconNeed help?

Do you have a question about the Atmel ATtiny25 and is the answer not in the manual?

Atmel ATtiny25 Specifications

General IconGeneral
ArchitectureAVR
Flash Memory2 KB
SRAM128 B
EEPROM128 B
Clock Speed20 MHz
I/O Pins6
PWM Channels2
Operating Voltage1.8V - 5.5V
ADC4 channels, 10-bit
Communication InterfacesSPI, I2C, USART
Operating Temperature Range-40°C to 85°C
Timers8-bit Timer/Counter with PWM, 16-bit Timer/Counter with PWM
Package8-pin PDIP, SOIC-8

Summary

Features

Overview and Pin Configurations

Pinout

Pin configuration details for ATtiny25/45/85, showing pin functions for SOIC and QFN packages.

Overview

Introduces the ATtiny25/45/85 as a low-power AVR microcontroller with RISC architecture.

AVR CPU Core

Architecture & Registers

Covers CPU core, architectural overview, ALU, status, and general purpose registers.

Instruction Execution & Reset/Interrupts

Details instruction timing, reset, and interrupt handling mechanisms.

ATtiny25/45/85 Memories

Flash, SRAM, EEPROM, and I/O Memory

Describes Flash, SRAM, EEPROM, and I/O memory spaces and their characteristics.

System Clock and Clock Options

Clock Sources and Prescalers

Details clock sources (RC, Crystal, PLL) and the system clock prescaler.

Power Management and Sleep Modes

MCU Control Register

Details the MCU Control Register for power management and sleep mode selection.

Sleep Modes (Idle, ADC Noise Reduction, Power-down)

Explains the different sleep modes and their features for power saving.

Power Reduction Register

Describes the PRR for stopping clocks to peripherals to reduce power consumption.

System Control and Reset

Reset Sources

Lists and describes the various reset sources like Power-on, External, Watchdog, and Brown-out.

Brown-out Detection

Details the On-chip Brown-out Detection (BOD) circuit and its configuration.

Interrupts

Interrupt Vectors in ATtiny25/45/85

Lists the interrupt vectors and their definitions for ATtiny25/45/85.

I/O Ports

Ports as General Digital I/O

Covers port configuration, general I/O, and switching between input/output.

Alternate Port Functions

Explains alternate functions of port pins and overriding signals.

Register Description for I/O-Ports

Details the PORTB, DDRB, and PINB registers for I/O port control.

External Interrupts

MCU Control Register – MCUCR

Details the External Interrupt Control Register for interrupt sense control.

General Interrupt Mask Register – GIMSK

Covers the GIMSK for enabling external and pin change interrupts.

8-bit Timer/Counter0 with PWM

Modes of Operation and Registers

Explains operational modes and register descriptions for Timer/Counter0.

Counter and Compare Units

Timer/Counter1 and Dead Time Generator

Details Timer/Counter1 operation and the Dead Time Generator for PWM.

Universal Serial Interface – USI

Functional Descriptions and Registers

Covers USI modes (3-wire, SPI, 2-wire) and register descriptions.

Analog Comparator

ACSR and ADCSRB Registers

Details Analog Comparator Control and Status Registers for configuration and interrupts.

Analog Comparator Multiplexed Input

Explains selecting ADC pins as the negative input to the Analog Comparator.

Analog to Digital Converter

ADC Features and Operation

Lists ADC features and describes its operation, including channel and reference selection.

Starting a Conversion

Explains manual and auto-triggered ADC conversion start methods.

ADC Conversion Result

Details how to read and interpret ADC conversion results in different modes.

debugWIRE On-chip Debug System

Features, Interface, and Registers

Covers debugwire features, physical interface, limitations, and registers.

Memory Programming

Lock Bits and Fuse Bytes

Explains memory lock bits and the functionality of fuse bytes.

Serial Downloading

Details serial programming methods including SPI and HVSP.

High-voltage Serial Programming

Covers programming Flash, EEPROM, Lock bits, and Fuse bits using HVSP.

Electrical Characteristics

Absolute Maximum Ratings*

Lists the stress ratings that may cause permanent damage to the device.

DC Characteristics

Provides DC characteristics across temperature and voltage ranges.

Typical Characteristics

Supply Current (Active, Idle, Power-down)

Shows supply current graphs for different modes versus frequency and VCC.

Pin Characteristics (Pull-up, Driver Strength, Thresholds)

Details pin pull-up, driver strength, and threshold characteristics.

Oscillator and BOD Characteristics

Covers BOD thresholds and internal oscillator frequency characteristics.

Register Summary

Instruction Set Summary

Ordering Information

Package Types

Lists available package types like T5 and PC with their specifications.

Document Revision History

Errata

Related product manuals