ATMEGA16M1-MU Atmel, ATMEGA16M1-MU Datasheet - Page 26

no-image

ATMEGA16M1-MU

Manufacturer Part Number
ATMEGA16M1-MU
Description
IC MCU AVR 16K FLASH 32VQFN
Manufacturer
Atmel
Series
AVR® ATmegar
Datasheets

Specifications of ATMEGA16M1-MU

Core Processor
AVR
Core Size
8-Bit
Speed
16MHz
Connectivity
CAN, LIN, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, POR, PWM, Temp Sensor, WDT
Program Memory Size
16KB (8K x 16)
Program Memory Type
FLASH
Eeprom Size
512 x 8
Ram Size
1K x 8
Voltage - Supply (vcc/vdd)
2.7 V ~ 5.5 V
Data Converters
A/D 11x10b; D/A 1x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
32-VQFN Exposed Pad, 32-HVQFN, 32-SQFN, 32-DHVQFN
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Number Of I /o
-
7.7.4
7.7.5
7.7.6
26
ATmega16M1/32M1/64M1
GPIOR0 – General Purpose I/O Register 0
GPIOR1 – General Purpose I/O Register 1
GPIOR2 – General Purpose I/O Register 2
The next code examples show assembly and C functions for reading the EEPROM. The exam-
ples assume that interrupts are controlled so that no interrupts will occur during execution of
these functions.
Bit
Read/Write
Initial Value
Bit
Read/Write
Initial Value
Bit
Read/Write
Initial Value
Assembly Code Example
C Code Example
EEPROM_read:
unsigned char EEPROM_read(unsigned int uiAddress)
{
}
; Wait for completion of previous write
sbic EECR,EEWE
rjmp EEPROM_read
; Set up address (r18:r17) in address register
out EEARH, r18
out EEARL, r17
; Start eeprom read by writing EERE
sbi EECR,EERE
; Read data from data register
in
ret
/* Wait for completion of previous write */
while(EECR & (1<<EEWE))
/* Set up address register */
EEAR = uiAddress;
/* Start eeprom read by writing EERE */
EECR |= (1<<EERE);
/* Return data from data register */
return EEDR;
;
r16,EEDR
GPIOR07
GPIOR17
GPIOR27
R/W
R/W
R/W
7
0
7
0
7
0
GPIOR06
GPIOR16
GPIOR26
R/W
R/W
R/W
6
0
6
0
6
0
GPIOR05
GPIOR15
GPIOR25
R/W
R/W
R/W
5
0
5
0
5
0
GPIOR04
GPIOR14
GPIOR24
R/W
R/W
R/W
4
0
4
0
4
0
GPIOR03
GPIOR13
GPIOR23
R/W
R/W
R/W
3
0
3
0
3
0
GPIOR02
GPIOR12
GPIOR22
R/W
R/W
R/W
2
0
2
0
2
0
GPIOR01
GPIOR11
GPIOR21
R/W
R/W
R/W
1
0
1
0
1
0
GPIOR00
GPIOR10
GPIOR20
R/W
R/W
R/W
0
0
0
0
0
0
8209D–AVR–11/10
GPIOR0
GPIOR1
GPIOR2

Related parts for ATMEGA16M1-MU