- •Pin Configuration
- •Features
- •Description
- •Pin Descriptions
- •Port B (PB5..PB0)
- •Analog Pins
- •Internal Oscillators
- •ATtiny15L Architectural Overview
- •The General-purpose Register File
- •The ALU – Arithmetic Logic Unit
- •The Flash Program Memory
- •The Program and Data Addressing Modes
- •Register Direct, Single-register Rd
- •Register Indirect
- •Register Direct, Two Registers Rd and Rr
- •I/O Direct
- •Relative Program Addressing, RJMP and RCALL
- •Constant Addressing Using the LPM Instruction
- •Subroutine and Interrupt Hardware Stack
- •The EEPROM Data Memory
- •Memory Access and Instruction Execution Timing
- •I/O Memory
- •The Status Register – SREG
- •Reset and Interrupt Handling
- •ATtiny15L Reset Sources
- •Power-on Reset
- •External Reset
- •Brown-out Detection
- •Watchdog Reset
- •MCU Status Register – MCUSR
- •Internal Voltage Reference
- •Voltage Reference Enable Signals and Start-up Time
- •Interrupt Handling
- •Interrupt Response Time
- •The General Interrupt Mask Register – GIMSK
- •The General Interrupt Flag Register – GIFR
- •The Timer/Counter Interrupt Mask Register – TIMSK
- •The Timer/Counter Interrupt Flag Register – TIFR
- •External Interrupt
- •Pin Change Interrupt
- •The MCU Control Register – MCUCR
- •Sleep Modes
- •Idle Mode
- •ADC Noise Reduction Mode
- •Power-down Mode
- •Tunable Internal RC Oscillator
- •The System Clock Oscillator Calibration Register – OSCCAL
- •Internal PLL for Fast Peripheral Clock Generation
- •Timer/Counters
- •The Timer/Counter0 Prescaler
- •The Timer/Counter1 Prescaler
- •The Special Function IO Register – SFIOR
- •The 8-bit Timer/Counter0
- •The Timer/Counter0 Control Register – TCCR0
- •The Timer Counter 0 – TCNT0
- •The 8-bit Timer/Counter1
- •The Timer/Counter1 Control Register – TCCR1
- •The Timer/Counter1 – TCNT1
- •Timer/Counter1 Output Compare RegisterA – OCR1A
- •Timer/Counter1 in PWM Mode
- •Timer/Counter1 Output Compare RegisterB – OCR1B
- •The Watchdog Timer
- •The Watchdog Timer Control Register – WDTCR
- •EEPROM Read/Write Access
- •The EEPROM Address Register – EEAR
- •The EEPROM Data Register – EEDR
- •The EEPROM Control Register – EECR
- •Preventing EEPROM Corruption
- •The Analog Comparator
- •The Analog Comparator Control and Status Register – ACSR
- •The Analog-to-digital Converter, Analog Multiplexer and Gain Stages
- •Feature List:
- •Operation
- •Prescaling and Conversion Timing
- •ADC Noise Canceler Function
- •The ADC Multiplexer Selection Register – ADMUX
- •The ADC Control and Status Register – ADCSR
- •The ADC Data Register – ADCL and ADCH
- •ADLAR = 0:
- •Scanning Multiple Channels
- •ADC Noise-canceling Techniques
- •ADC Characteristics
- •I/O Port B
- •Alternative Functions of Port B
- •The Port B Data Register – PORTB
- •The Port B Data Direction Register – DDRB
- •The Port B Input Pins Address – PINB
- •PORT B as General Digital I/O
- •Alternate Functions of Port B
- •Memory Programming
- •Program and Data Memory Lock Bits
- •Fuse Bits
- •Signature Bytes
- •Calibration Byte
- •Programming the Flash
- •High-voltage Serial Programming
- •High-voltage Serial Programming Algorithm
- •High-voltage Serial Programming Characteristics
- •Low-voltage Serial Downloading
- •Low-voltage Serial Programming Algorithm
- •Data Polling
- •Low-voltage Serial Programming Characteristics
- •Electrical Characteristics
- •Absolute Maximum Ratings
- •DC Characteristics – Preliminary Data
- •Typical Characteristics – PRELIMINARY DATA
- •ATtiny15L Register Summary
- •Ordering Information
ATtiny15L
Timer/Counter1 Output Compare RegisterB – OCR1B
Bit |
|
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
$2D |
MSB |
|
|
|
|
|
|
LSB |
OCR1B |
|
|
|
|
|
|
|
|
|
|
|
|
Read/Write |
R/W |
R/W |
R/W |
R/W |
R/W |
R/W |
R/W |
R/W |
|
|
Initial value |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
|
|
The Output Compare Register1 (OCR1B) is an 8-bit read/write register. This register is used in the PWM mode only, and it limits the top value to which the Timer/Counter1 keeps counting. After reaching OCR1B in PWM mode, the counter starts from $00.
Table 13. PWM Outputs when OCR1A = $00 or OCR1B
COM1A1 |
COM1A0 |
OCR1B |
Output PWMn |
|
|
|
|
1 |
0 |
$00 |
L |
|
|
|
|
1 |
0 |
OCR1B |
H |
|
|
|
|
1 |
1 |
$00 |
H |
|
|
|
|
1 |
1 |
OCR1B |
L |
|
|
|
|
In PWM mode, the Timer Overflow Flag (TOV1) is set as in normal Timer/Counter mode. Timer Overflow Interrupt1 operates exactly as in normal Timer/Counter mode, i.e., it is executed when TOV1 is set provided that Timer Overflow Interrupt and global interrupts are enabled. This also applies to the Timer Output Compare A flag and interrupt.
The frequency of the PWM will be Timer Clock Frequency divided by OCR1B value + 1.
Table 14. Timer/Counter1 Clock Prescale Select
Clock Selection |
OCR1B |
PWM Frequency |
|
|
|
CK |
159 |
10 kHz |
|
|
|
PCK/8 |
159 |
20 kHz |
|
|
|
PCK/4 |
213 |
30 kHz |
|
|
|
PCK/4 |
159 |
40 kHz |
|
|
|
PCK/2 |
255 |
50 kHz |
|
|
|
PCK/2 |
213 |
60 kHz |
|
|
|
PCK/2 |
181 |
70 kHz |
|
|
|
PCK/2 |
159 |
80 kHz |
|
|
|
PCK/2 |
141 |
90 kHz |
|
|
|
PCK |
255 |
100 kHz |
|
|
|
PCK |
231 |
110 kHz |
|
|
|
PCK |
213 |
120 kHz |
|
|
|
PCK |
195 |
130 kHz |
|
|
|
PCK |
181 |
140 kHz |
|
|
|
PCK |
169 |
150 kHz |
|
|
|
31
