ATtiny4 registers
All 36 registers by peripheral, at their data-space address (the I/O address IN and OUT use is shown beside it), with their reset value and every bit.
PORTB I/O Port
PINBPort B Data register
- Address
0x00
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3PINB3
- 2PINB2
- 1PINB1
- 0PINB0
DDRBData Direction Register, Port B
- Address
0x01
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3DDB3
- 2DDB2
- 1DDB1
- 0DDB0
PORTBInput Pins, Port B
- Address
0x02
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3PORTB3
- 2PORTB2
- 1PORTB1
- 0PORTB0
PUEBPull-up Enable Control Register
- Address
0x03
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3PUEB3
- 2PUEB2
- 1PUEB1
- 0PUEB0
PORTCRPort Control Register
- Address
0x0C
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1BBMB
- 0–
1 field
| Field | Bits | What it does |
|---|
| BBMB | 1 | Break-Before-Make Mode Enable |
EXINT External Interrupts
PCMSKPin Change Mask Register
- Address
0x10
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3PCINT3
- 2PCINT2
- 1PCINT1
- 0PCINT0
1 field
| Field | Bits | What it does |
|---|
| PCINT | 3:0 | Pin Change Enable Masks |
PCIFRPin Change Interrupt Flag Register
- Address
0x11
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1–
- 0PCIF0
1 field
| Field | Bits | What it does |
|---|
| PCIF0 | 0 | Pin Change Interrupt Flag 0 |
PCICRPin Change Interrupt Control Register
- Address
0x12
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1–
- 0PCIE0
1 field
| Field | Bits | What it does |
|---|
| PCIE0 | 0 | Pin Change Interrupt Enable 0 |
EIMSKExternal Interrupt Mask register
- Address
0x13
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1–
- 0INT0
1 field
| Field | Bits | What it does |
|---|
| INT0 | 0 | External Interrupt Request 0 Enable |
EIFRExternal Interrupt Flag register
- Address
0x14
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1–
- 0INTF0
1 field
| Field | Bits | What it does |
|---|
| INTF0 | 0 | External Interrupt Flag 0 |
EICRAExternal Interrupt Control Register A
- Address
0x15
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1ISC01
- 0ISC00
2 fields
| Field | Bits | What it does |
|---|
| ISC01 | 1 | Interrupt Sense Control 0 Bit 1 |
| ISC00 | 0 | Interrupt Sense Control 0 Bit 0 |
AC Analog Comparator
DIDR0
- Address
0x17
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1AIN1D
- 0AIN0D
2 fields
| Field | Bits | What it does |
|---|
| AIN1D | 1 | AIN1 Digital Input Disable |
| AIN0D | 0 | AIN0 Digital Input Disable |
ACSRAnalog Comparator Control And Status Register
- Address
0x1F
- Reset
0x00
- Access
- read/write
- 7ACD
- 6–
- 5ACO
- 4ACI
- 3ACIE
- 2ACIC
- 1ACIS1
- 0ACIS0
6 fields
| Field | Bits | What it does |
|---|
| ACD | 7 | Analog Comparator Disable |
| ACO | 5 | Analog Compare Output |
| ACI | 4 | Analog Comparator Interrupt Flag |
| ACIE | 3 | Analog Comparator Interrupt Enable |
| ACIC | 2 | Analog Comparator Input Capture Enable |
| ACIS | 1:0 | Analog Comparator Interrupt Mode Select bits0 Interrupt on Toggle1 Reserved2 Interrupt on Falling Edge3 Interrupt on Rising Edge
|
TC0 Timer/Counter, 16-bit
ICR0Input Capture Register Bytes
- Address
0x22 I/O 0x02
- Reset
0x0000
- Access
- read/write
- Size
- 16-bit
OCR0BTimer/Counter0 Output Compare Register B
- Address
0x24 I/O 0x04
- Reset
0x0000
- Access
- read/write
- Size
- 16-bit
OCR0ATimer/Counter 0 Output Compare Register A
- Address
0x26 I/O 0x06
- Reset
0x0000
- Access
- read/write
- Size
- 16-bit
TCNT0Timer/Counter0
- Address
0x28 I/O 0x08
- Reset
0x0000
- Access
- read/write
- Size
- 16-bit
TIFR0Overflow Interrupt Enable
- Address
0x2A I/O 0x0A
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5ICF0
- 4–
- 3–
- 2OCF0B
- 1OCF0A
- 0TOV0
4 fields
| Field | Bits | What it does |
|---|
| ICF0 | 5 | Input Capture Flag |
| OCF0B | 2 | Timer Output Compare Flag 0B |
| OCF0A | 1 | Timer Output Compare Flag 0A |
| TOV0 | 0 | Timer Overflow Flag |
TIMSK0Timer Interrupt Mask Register 0
- Address
0x2B I/O 0x0B
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5ICIE0
- 4–
- 3–
- 2OCIE0B
- 1OCIE0A
- 0TOIE0
4 fields
| Field | Bits | What it does |
|---|
| ICIE0 | 5 | Input Capture Interrupt Enable |
| OCIE0B | 2 | Output Compare B Match Interrupt Enable |
| OCIE0A | 1 | Output Compare A Match Interrupt Enable |
| TOIE0 | 0 | Overflow Interrupt Enable |
TCCR0CTimer/Counter 0 Control Register C
- Address
0x2C I/O 0x0C
- Reset
0x00
- Access
- read/write
- 7FOC0A
- 6FOC0B
- 5–
- 4–
- 3–
- 2–
- 1–
- 0–
2 fields
| Field | Bits | What it does |
|---|
| FOC0A | 7 | Force Output Compare for Channel A |
| FOC0B | 6 | Force Output Compare for Channel B |
TCCR0BTimer/Counter 0 Control Register B
- Address
0x2D I/O 0x0D
- Reset
0x00
- Access
- read/write
- 7ICNC0
- 6ICES0
- 5–
- 4WGM01
- 3WGM00
- 2CS02
- 1CS01
- 0CS00
4 fields
| Field | Bits | What it does |
|---|
| ICNC0 | 7 | Input Capture Noise Canceler |
| ICES0 | 6 | Input Capture Edge Select |
| WGM0 | 4:3 | Waveform Generation Mode |
| CS0 | 2:0 | Clock Select0 No Clock Source (Stopped)1 Running, No Prescaling2 Running, CLK/83 Running, CLK/644 Running, CLK/2565 Running, CLK/10246 Running, ExtClk Tn Falling Edge7 Running, ExtClk Tn Rising Edge
|
TCCR0ATimer/Counter 0 Control Register A
- Address
0x2E I/O 0x0E
- Reset
0x00
- Access
- read/write
- 7COM0A1
- 6COM0A0
- 5COM0B1
- 4COM0B0
- 3–
- 2–
- 1WGM01
- 0WGM00
3 fields
| Field | Bits | What it does |
|---|
| COM0A | 7:6 | Compare Output Mode for Channel A bits |
| COM0B | 5:4 | Compare Output Mode for Channel B bits |
| WGM0 | 1:0 | Waveform Generation Mode |
GTCCRGeneral Timer/Counter Control Register
- Address
0x2F I/O 0x0F
- Reset
0x00
- Access
- read/write
- 7TSM
- 6–
- 5–
- 4–
- 3–
- 2–
- 1–
- 0PSR
2 fields
| Field | Bits | What it does |
|---|
| TSM | 7 | Timer Synchronization Mode |
| PSR | 0 | Prescaler Reset |
WDT Watchdog Timer
WDTCSRWatchdog Timer Control and Status Register
- Address
0x31 I/O 0x11
- Reset
0x00
- Access
- read/write
- 7WDIF
- 6WDIE
- 5WDP5
- 4–
- 3WDE
- 2WDP2
- 1WDP1
- 0WDP0
4 fields
| Field | Bits | What it does |
|---|
| WDIF | 7 | Watchdog Timer Interrupt Flag |
| WDIE | 6 | Watchdog Timer Interrupt Enable |
| WDP | 5,2,1,0 | Watchdog Timer Prescaler Bits0 Oscillator Cycles 2K1 Oscillator Cycles 4K2 Oscillator Cycles 8K3 Oscillator Cycles 16K4 Oscillator Cycles 32K5 Oscillator Cycles 64K6 Oscillator Cycles 128K7 Oscillator Cycles 256K8 Oscillator Cycles 512K9 Oscillator Cycles 1024K
|
| WDE | 3 | Watch Dog Enable |
CPU CPU Registers
NVMCSRNon-Volatile Memory Control and Status Register
- Address
0x32 I/O 0x12
- Reset
0x00
- Access
- read/write
- 7NVMBSY
- 6–
- 5–
- 4–
- 3–
- 2–
- 1–
- 0–
1 field
| Field | Bits | What it does |
|---|
| NVMBSY | 7 | Non-Volatile Memory Busy |
NVMCMDNon-Volatile Memory Command
- Address
0x33 I/O 0x13
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1–
- 0–
VLMCSRVcc Level Monitoring Control and Status Register
- Address
0x34 I/O 0x14
- Reset
0x00
- Access
- read/write
- 7VLMF
- 6VLMIE
- 5–
- 4–
- 3–
- 2VLM2
- 1VLM1
- 0VLM0
3 fields
| Field | Bits | What it does |
|---|
| VLMF | 7 | VLM Flag |
| VLMIE | 6 | VLM Interrupt Enable |
| VLM | 2:0 | Trigger Level of Voltage Level Monitor bits |
PRRPower Reduction Register
- Address
0x35 I/O 0x15
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1PRADC
- 0PRTIM0
2 fields
| Field | Bits | What it does |
|---|
| PRADC | 1 | Power Reduction ADC |
| PRTIM0 | 0 | Power Reduction Timer/Counter0 |
CLKPSRClock Prescale Register
- Address
0x36 I/O 0x16
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3CLKPS3
- 2CLKPS2
- 1CLKPS1
- 0CLKPS0
1 field
| Field | Bits | What it does |
|---|
| CLKPS | 3:0 | Clock Prescaler Select Bits0 11 22 43 84 165 326 647 1288 256
|
CLKMSRClock Main Settings Register
- Address
0x37 I/O 0x17
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1CLKMS1
- 0CLKMS0
1 field
| Field | Bits | What it does |
|---|
| CLKMS | 1:0 | Clock Main Select Bits |
OSCCALOscillator Calibration Value
- Address
0x39 I/O 0x19
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1–
- 0–
SMCRSleep Mode Control Register
- Address
0x3A I/O 0x1A
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3SM2
- 2SM1
- 1SM0
- 0SE
2 fields
| Field | Bits | What it does |
|---|
| SM | 3:1 | Sleep Mode Select Bits0 Idle1 ADC Noise Reduction2 Power Down3 Reserved4 Standby5 Reserved6 Reserved7 Reserved
|
| SE | 0 | Sleep Enable |
RSTFLRReset Flag Register
- Address
0x3B I/O 0x1B
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3WDRF
- 2–
- 1EXTRF
- 0PORF
3 fields
| Field | Bits | What it does |
|---|
| WDRF | 3 | Watchdog Reset Flag |
| EXTRF | 1 | External Reset Flag |
| PORF | 0 | Power-on Reset Flag |
CCPConfiguration Change Protection
- Address
0x3C I/O 0x1C
- Reset
0x00
- Access
- read/write
- 7–
- 6–
- 5–
- 4–
- 3–
- 2–
- 1–
- 0–
SPStack Pointer
- Address
0x3D I/O 0x1D
- Reset
0x005F
- Access
- read/write
- Size
- 16-bit
SREGStatus Register
- Address
0x3F I/O 0x1F
- Reset
0x00
- Access
- read/write
- 7I
- 6T
- 5H
- 4S
- 3V
- 2N
- 1Z
- 0C
8 fields
| Field | Bits | What it does |
|---|
| I | 7 | Global Interrupt Enable |
| T | 6 | Bit Copy Storage |
| H | 5 | Half Carry Flag |
| S | 4 | Sign Bit |
| V | 3 | Two's Complement Overflow Flag |
| N | 2 | Negative Flag |
| Z | 1 | Zero Flag |
| C | 0 | Carry Flag |