ata6616 ATMEL Corporation, ata6616 Datasheet - Page 59

no-image

ata6616

Manufacturer Part Number
ata6616
Description
Microcontroller With Lin Transceiver, 5v Regulator And Watchdog
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ata6616-P3QW
Manufacturer:
ATMEL
Quantity:
950
Part Number:
ata6616-P3QW
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ata6616C
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ata6616C-P3QW
Manufacturer:
ATMEL
Quantity:
887
9132A–AUTO–10/08
DRAFT
The clock switching is performed by a sequence of commands. First, the user (code) must make
sure that the new clock source is operating. Then the ‘Clock Source Switching’ command can be
issued. Once this command has been successfully completed using the ‘Recover System Clock
Source’ command, the user (code) may stop the previous clock source. It is strongly recom-
mended 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 ATtiny167, 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.
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
ATA6616/ATA6617 [Preliminary]
_
clk;
_
number & 0x0F)) break;
_
number, unsigned char sut) {
_
number & 0x0F);
59

Related parts for ata6616