Lec_03 Introduction to AVR
Lec_03 Introduction to AVR
Course
ME4162: Microprocessor AVR Microcontrollers
Semester 1, 2023 Overview
Lecturer: Dr. Duong Van Lac Dr. Duong Van Lac
Department of Mechatronics, HUST
Email: [email protected]
• Microcontrollers
Microcontroller
I/O Serial
RAM ROM Timer
Port Port
CPU
Buses
3 4
1
10/2/2023
– 8051 Memory
ROM, SRAM, FLA
SH
SRAM, FLASH Flash, SRAM, EEPROM Flash, SDRAM, EEPROM
RISC (Reduced Instructions Set
ISA CLSC Some feature of RISC RISC
Computer)
Memory Harvard Von Neumann
Modified Harvard Architecture Modified Harvard architecture
• 32-bit microcontrollers Architecture
Power
architecture
Average
architecture
Low Low Low
Consumption
– ARM Families 8051 variants
PIC16,PIC17, PIC18,
PIC24, PIC32
Tiny, Atmega, Xmega, special
purpose AVR
ARMv4,5,6,7 and series
– PIC32 Manufacturer
Silicon Labs,
Dallas, Cyprus,
Microchip Average Atmel
Apple, Nvidia, Qualcomm, Samsung
Electronics, and TI etc.
Infineon, etc.
Cost Very Low Average Average Low
• RISC (Reduced Instructions Set Computer – Máy tính với tập lệnh đơn giản hóa)
• CISC (Complex Instructions Set Computer – Máy tính với tập lệnh phức tạp)
5 6
Prepared by Duong Van Lac. Email: [email protected]
https://en.wikipedia.org/wiki/Atmel
The PIC and AVR MCU brands represent the two dominant
architectures in the embedded design universe
2
10/2/2023
28 pin
(PCINT14/RESET) PC6 1 2KBytes 28 1KBytes
PC5 (ADC5/SCL/PCINT13) Register file Program
R31 (ZH) R30 (ZL) counter
(PCINT16/RXD) PD0 2 27 PC4 (ADC4/SDA/PCINT12)
32KBytes RAM EEPROM Timers
R29 (YH)
R27 (XH)
R28 (YL)
R26 (XL)
Status
register ALU
I/O
PINS
EXTINT INT[1:0]
AIN0
AIN1 AC
Boot Flash Section 0x0FFF/0x1FFF/0x3FFF
ADCMUX
TC 0 T0
(8-bit)
RxD
TxD USART OC1A/B
ATmega88PA, ATmega168PA and ATmega328P
XCK TC 1 T1
(16-bit)
9/17/2023 SDA ME4162:
TWI
Microprocessor ICP1
11 9/17/2023 ME4162: Microprocessor 12
SCL
TC 2
11 12
3
10/2/2023
◼ Registers R0
R1
$0000
$0001
• Classic AVR
◼ I/O Memory
R2
...
$0002
... – e.g. AT90S2313, AT90S4433
◼ Extended I/O Memory R29
R30
R31
$001D
$001E
$001F
• Mega
◼ Internal SRAM I/O Registers
– e.g. ATmega328, ATmega32, ATmega128
$00 $0020
8 bits
• Tiny
$01 $0021
$02 $0022
... ...
$0x0000 - $0x001F
32 Registers $3D
$3E
$005D
$005E
– e.g. ATtiny13, ATtiny25
64 I/O Registers $0x0020 - $0x005F
• Special Purpose AVR
$3F $005F
Optim
TFBGA-324 CTBGA-256 CTBGA-196 CBGA-100 VFBGA-49 LGA-32
15x15 mm 17x17 mm 12x12 mm 9x9 mm 5x5 mm 3.5x6.5 mm
PDIP-40 PDIP-28 PDIP-20 PDIP-14 PDIP-8 TSSOP-44 SOIC-32 SOIC-24 SOIC-20 SOIC-14 SOIC-8
13.72x52.32 mm 7.3x34.69 mm 6.6x25.74 mm 6.6x19.17 mm 6.35x9.3 mm 4.5x11.1 mm 7.51x20.73 mm 7.5x15.4 mm 7.52x12.83 mm 4x8.7 mm 4x5 mm
QFN-64 DRQFN-64 QFN-48 QFN-44 DRQFN-44 QFN-32 QFN-28 QFN-20 QFN-20 DRDFN-18 DFN-10
9x9 mm 7x7 mm 7x7 mm 7x7 mm 5x5 mm 5x5 mm 4x4 mm 4x4 mm 3x3 mm 3.5x6.5 mm 3x3 mm
4
10/2/2023
Let’s get familiar with the AVR part numbers Application Oriented
ATmega128
Atmel group
Flash =128K Remote Access Control LCD Control USB Connectivity
ATtiny44 AT90S4433
Atmel
Flash =4K Atmel Classic
Tiny Flash =4K
group group
Chapter 2 Topics
◼ AVR Pins
◼ AVR simplest connections
◼ What is inside a hex file?
◼ Loading a hex file into flash
AVR Microcontrollers
Hardware Connections
Dr. Duong Van Lac
Department of Mechatronics, HUST
5
10/2/2023
◼ Parallel programming
◼ ISP
◼ SPI
◼ JTAG
◼ Boot loader
6
10/2/2023
AVR ONE