116
ATtiny25/45/85 [DATASHEET]
2586Q–AVR–08/2013
If USISIE bit in USICR and the Global Interrupt Enable Flag are set, an interrupt will be generated when this flag is
set. The flag will only be cleared by writing a logical one to the USISIF bit. Clearing this bit will release the start
detection hold of USCL in two-wire mode.
A start condition interrupt will wakeup the processor from all sleep modes.
Bit 6 – USIOIF: Counter Overflow Interrupt Flag
This flag is set (one) when the 4-bit counter overflows (i.e., at the transition from 15 to 0). If the USIOIE bit in
USICR and the Global Interrupt Enable Flag are set an interrupt will also be generated when the flag is set. The
flag will only be cleared if a one is written to the USIOIF bit. Clearing this bit will release the counter overflow hold
of SCL in two-wire mode.
A counter overflow interrupt will wakeup the processor from Idle sleep mode.
Bit 5 – USIPF: Stop Condition Flag
When two-wire mode is selected, the USIPF Flag is set (one) when a stop condition has been detected. The flag is
cleared by writing a one to this bit. Note that this is not an interrupt flag. This signal is useful when implementing
two-wire bus master arbitration.
Bit 4 – USIDC: Data Output Collision
This bit is logical one when bit 7 in the USI Data Register differs from the physical pin value. The flag is only valid
when two-wire mode is used. This signal is useful when implementing Two-wire bus master arbitration.
Bits 3:0 – USICNT[3:0]: Counter Value
These bits reflect the current 4-bit counter value. The 4-bit counter value can directly be read or written by the
CPU.
The 4-bit counter increments by one for each clock generated either by the external clock edge detector, by a
Timer/Counter0 Compare Match, or by software using USICLK or USITC strobe bits. The clock source depends on
the setting of the USICS[1:0] bits.
For external clock operation a special feature is added that allows the clock to be generated by writing to the
USITC strobe bit. This feature is enabled by choosing an external clock source (USICS1 = 1) and writing a one to
the USICLK bit.
Note that even when no wire mode is selected (USIWM[1:0] = 0) the external clock input (USCK/SCL) can still be
used by the counter.
15.5.4
USICR – USI Control Register
The USI Control Register includes bits for interrupt enable, setting the wire mode, selecting the clock and clock
strobe.
Bit 7 – USISIE: Start Condition Interrupt Enable
Setting this bit to one enables the start condition detector interrupt. If there is a pending interrupt and USISIE and
the Global Interrupt Enable Flag are set to one the interrupt will be executed immediately. Refer to the USISIF bit
description on
page 115 for further details.
Bit
7
6
5
4
3
2
1
0
USISIE
USIOIE
USIWM1
USIWM0
USICS1
USICS0
USICLK
USITC
USICR
Read/Write
R/W
W
Initial Value
0