ATMEga64L ATMEL Corporation, ATMEga64L Datasheet - Page 68

no-image

ATMEga64L

Manufacturer Part Number
ATMEga64L
Description
8-bit AVR Microcontroller with 64K Bytes In-System Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATMEga64L-16AU
Manufacturer:
ROHM
Quantity:
40 000
Part Number:
ATMEga64L-8AC
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEga64L-8AI
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEga64L-8AI
Manufacturer:
ALTERA
0
Part Number:
ATMEga64L-8AI
Manufacturer:
AT
Quantity:
20 000
Part Number:
ATMEga64L-8AJ
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEga64L-8AQ
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEga64L-8AQ
Manufacturer:
AT
Quantity:
20 000
Part Number:
ATMEga64L-8AU
Manufacturer:
ATMEL
Quantity:
4 000
Part Number:
ATMEga64L-8AU
Manufacturer:
ATMEL
Quantity:
451
Part Number:
ATMEga64L-8AU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATMEga64L-8MI
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATMEga64L-8MU
Quantity:
113
Part Number:
ATMEga64L-8MUR
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATMEga64L8AJ
Manufacturer:
ATMEL
Quantity:
6 973
Digital Input Enable and Sleep
Modes
68
ATmega64(L)
The following code example show how to set Port B pins 0 and 1 high, 2 and 3 low, and
define the port pins from 4 to 7 as input with pull-ups assigned to port pins 6 and 7. The
resulting pin values are read back again, but as previously discussed, a nop instruction
is included to be able to read back the value recently assigned to some of the pins.
Note:
As shown in Figure 30, the digital input signal can be clamped to ground at the input of
the Schmitt Trigger. The signal denoted SLEEP in the figure, is set by the MCU Sleep
Controller in Power-down mode, Power-save mode, Standby mode, and Extended
Standby mode to avoid high power consumption if some input signals are left floating, or
have an analog signal level close to V
SLEEP is overridden for port pins enabled as External Interrupt pins. If the External
Interrupt request is not enabled, SLEEP is active also for these pins. SLEEP is also
overridden by various other alternate functions as described in “Alternate Port Func-
tions” on page 69.
If a logic high level (“one”) is present on an asynchronous External Interrupt pin config-
ured as “Interrupt on Any Logic Change on Pin” while the External Interrupt is not
enabled, the corresponding External Interrupt Flag will be set when resuming from the
above mentioned sleep modes, as the clamping in these sleep modes produces the
requested logic change.
Assembly Code Example
C Code Example
unsigned char i;
...
; Define pull-ups and set outputs high
; Define directions for port pins
ldi
ldi
out
out
; Insert nop for synchronization
nop
; Read port pins
in
...
...
/* Define pull-ups and set outputs high */
/* Define directions for port pins */
PORTB = (1<<PB7)|(1<<PB6)|(1<<PB1)|(1<<PB0);
DDRB = (1<<DDB3)|(1<<DDB2)|(1<<DDB1)|(1<<DDB0);
/* Insert nop for synchronization*/
_NOP();
/* Read port pins */
i = PINB;
...
1. For the assembly program, two temporary registers are used to minimize the time
from pull-ups are set on pins 0, 1, 6, and 7, until the direction bits are correctly set,
defining bit 2 and 3 as low and redefining bits 0 and 1 as strong high drivers.
r16,(1<<PB7)|(1<<PB6)|(1<<PB1)|(1<<PB0)
r17,(1<<DDB3)|(1<<DDB2)|(1<<DDB1)|(1<<DDB0)
PORTB,r16
DDRB,r17
r16,PINB
(1)
CC
/2.
2490G–AVR–03/04

Related parts for ATMEga64L