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 #76 background imageLoading...
Page #76 background image
76
7598H–AVR–07/09
ATtiny25/45/85
A FOC0B strobe will not generate any interrupt, nor will it clear the timer in CTC mode using
OCR0B as TOP.
The FOC0B bit is always read as zero.
Bits 5:4 – Res: Reserved Bits
These bits are reserved bits in the ATtiny25/45/85 and will always read as zero.
Bit 3 – WGM02: Waveform Generation Mode
See the description in the “Timer/Counter Control Register A – TCCR0A” on page 72.
Bits 2:0 – CS02:0: Clock Select
The three Clock Select bits select the clock source to be used by the Timer/Counter.
If external pin modes are used for the Timer/Counter0, transitions on the T0 pin will clock the
counter even if the pin is configured as an output. This feature allows software control of the
counting.
12.8.3 Timer/Counter Register – TCNT0
The Timer/Counter Register gives direct access, both for read and write operations, to the
Timer/Counter unit 8-bit counter. Writing to the TCNT0 Register blocks (removes) the Compare
Match on the following timer clock. Modifying the counter (TCNT0) while the counter is running,
introduces a risk of missing a Compare Match between TCNT0 and the OCR0x Registers.
12.8.4 Output Compare Register A – OCR0A
The Output Compare Register A contains an 8-bit value that is continuously compared with the
counter value (TCNT0). A match can be used to generate an Output Compare interrupt, or to
generate a waveform output on the OC0A pin.
Table 12-8. Clock Select Bit Description
CS02 CS01 CS00 Description
0 0 0 No clock source (Timer/Counter stopped)
001clk
I/O
/(No prescaling)
010clk
I/O
/8 (From prescaler)
011clk
I/O
/64 (From prescaler)
100clk
I/O
/256 (From prescaler)
101clk
I/O
/1024 (From prescaler)
1 1 0 External clock source on T0 pin. Clock on falling edge.
1 1 1 External clock source on T0 pin. Clock on rising edge.
Bit 76543210
TCNT0[7:0] TCNT0
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value 0 0 0 0 0 0 0 0
Bit 76543210
OCR0A[7:0] OCR0A
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value 0 0 0 0 0 0 0 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