ATtiny167 Automotive Atmel Corporation, ATtiny167 Automotive Datasheet - Page 34

no-image

ATtiny167 Automotive

Manufacturer Part Number
ATtiny167 Automotive
Description
Manufacturer
Atmel Corporation

Specifications of ATtiny167 Automotive

Flash (kbytes)
16 Kbytes
Pin Count
20
Max. Operating Frequency
16 MHz
Cpu
8-bit AVR
# Of Touch Channels
8
Hardware Qtouch Acquisition
No
Max I/o Pins
16
Ext Interrupts
16
Usb Speed
No
Usb Interface
No
Spi
2
Twi (i2c)
1
Uart
1
Lin
1
Graphic Lcd
No
Video Decoder
No
Camera Interface
No
Adc Channels
11
Adc Resolution (bits)
10
Adc Speed (ksps)
15
Analog Comparators
1
Resistive Touch Screen
No
Temp. Sensor
Yes
Crypto Engine
No
Sram (kbytes)
0.5
Eeprom (bytes)
512
Self Program Memory
YES
Dram Memory
No
Nand Interface
No
Picopower
No
Temp. Range (deg C)
-40 to 150
I/o Supply Class
2.7 to 5.5
Operating Voltage (vcc)
2.7 to 5.5
Fpu
No
Mpu / Mmu
no / no
Timers
2
Output Compare Channels
3
Input Capture Channels
1
Pwm Channels
9
32khz Rtc
Yes
Calibrated Rc Oscillator
Yes
4.3.8
34
ATtiny87/ATtiny167
Clock Monitoring
It is strongly recommended to run this sequence only once the interrupts have been disabled.
The user (code) is responsible for the correct implementation of the clock switching sequence.
Here is a “light” C-code that describes such a sequence of commands.
Warning:
In the ATtiny87/167, only one among the three external clock sources can be enabled at a
given time. Moreover, the enables of the external clock and of the external low-frequency
oscillator are shared with the asynchronous timer.
A safe system needs to monitor its clock sources. Two domains need to be monitored:
- Clock sources for peripherals,
- Clocks sources for system clock generation.
C Code Example
void ClockSwiching (unsigned char clk
#define CLOCK
#define CLOCK
#define CLOCK
#define CLOCK
unsigned char previous
}
// Disable interrupts
// Save the current system clock source
// Enable the new clock source
// Wait for clock validity
// Switch clock source
// Wait for effective switching
// Shut down unneeded clock source
// Re-enable interrupts
temp = SREG; asm ("cli");
CLKCSR = 1 << CLKCCE;
CLKCSR = CLOCK
previous
CLKSELR = ((sut << 4 ) & 0x30) | (clk
CLKCSR = 1 << CLKCCE;
CLKCSR = CLOCK
while ((CLKCSR & (1 << CLKRDY)) == 0);
CLKCSR = 1 << CLKCCE;
CLKCSR = CLOCK
while (1){
}
if (previous_clk != (clk_number & 0x0F)) {
}
SREG = temp;
CLKCSR = 1 << CLKCCE;
CLKCSR = CLOCK
if ((CLKSELR & 0x0F) == (clk
CLKSELR = previous
CLKCSR = 1 << CLKCCE;
CLKCSR = CLOCK
_
clk = CLKSELR & 0x0F;
_
_
_
_
RECOVER
ENABLE
SWITCH
DISABLE
_
_
_
RECOVER;
ENABLE;
SWITCH;
_
_
RECOVER;
DISABLE;
_
clk, temp;
0x05
0x02
0x04
0x01
_
clk;
_
number & 0x0F)) break;
_
number, unsigned char sut) {
_
number & 0x0F);
7728G–AVR–06/10

Related parts for ATtiny167 Automotive