ata6616 ATMEL Corporation, ata6616 Datasheet - Page 61

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
Notes:
Here is a “light” C-code of a clock switching function using automatic clock monitoring.
C Code Example
void ClockSwiching (unsigned char clk
#define CLOCK
#define CLOCK
#define CLOCK
#define CLOCK
#define WD
#define WD
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
// Enable the watchdog in automatic reload mode
1. ONLY the reset (watchdog reset included) disables this function. The Watchdog System Reset
2. ONLY clock frequencies
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)) {
CLKSELR = previous
CLKCSR = 1 << CLKCCE;
CLKCSR = CLOCK
SREG = temp;
WDTCSR = (1 << WDCE) | (1 << WDE);
WDTCSR = (1 << WDE ) | WD
CLKCSR = 1 << CLKCCE;
CLKCSR = WD
Flag (WDRF bit of MCUSR register) can be used to monitor the reset cause.
CLKCSR = 1 << CLKCCE;
CLKCSR = CLOCK
if ((CLKSELR & 0x0F) == (clk
_
_
ARL
2048CYCLES
_
clk = CLKSELR & 0x0F;
_
_
_
_
RECOVER
ENABLE
SWITCH
DISABLE
_
ENABLE
_
ARL
_
_
_
_
RECOVER;
ENABLE;
SWITCH;
DISABLE;
_
ENABLE;
_
_
RECOVER;
_
clk;
clk, temp;
0x05
0x02
0x04
0x01
0x06
0x07
ATA6616/ATA6617 [Preliminary]
(4 * WatchDog Clock frequency) can be monitored.
_
2048CYCLES;
_
number & 0x0F)) break;
_
number, unsigned char sut) {
_
number & 0x0F);
61

Related parts for ata6616