Sensorless BLDC Control Source Code ATMEGA16
Sensorless BLDC Control Source Code ATMEGA16
ful microcontrollers.
Typical Applications
Powertrain
Security
n Turbo Charger
n Electrical Mirror
n Car Access
n Fuel Pump
n Window Lock
n Exhaust System
n Power Window
- Immobilizer
n Fan Control
- Passive Entry/Go
n Battery Monitoring
n Intelligent Watchdog System
Infotainment
Keypads
n Power Seat
Dashboard
n Ambient Light
n Console Indicator
n Roof Panel
n Radio Panel
Climate Control
n Front Panels
n Blower
n Flap Control
n CAN/LIN Gateway
n CAN/MOST Gateway
+150C Qualified
Several AVR microcontrollers are qualified for
various applications:
and control functions directly into or near gearboxes, transfer cases, engine sensors actuators, turbo
AEC-Q100 Grade3
T: -40C to +85C
AEC-Q100 Grade2
AEC-Q100 Grade1
Z: -40C to +125C
AEC-Q100 Grade0
ATmega32M1,
ATmega64M1, ATmega64C1.
ATmega32C1,
www.atmel.com
n Self-programming Memory
Features
n Complete and Low-cost Tool Set
n Brown-out Detection and Flash Corruption
Security
C-language Optimization
CAN Microcontrollers
Two families of automotive 8-bit AVR micro
AVR microcontrollers.
LIN Microcontrollers
All automotive ATmega AVR products feature a
ware LIN.
includes
automotive
comfort
applications,
www.atmel.com
System-in-Package
(SiP)
solutions
Motor-control Applications
Brushless DC Motor (BLDC) are more and more
ATAxx33/34
V motor
ATmega16/
32/64M1
ECU
Electronic
Control
Unit
Motor
PSC
Hall
LIN/CAN
PSC
PWM
AVR
ADC
ATtiny261/
461/861
Comparator
Hall Signals
Capacitive
Sensing
Automotive Offering
Buttons
Wheels
Sliders
Peripherals
Brown-out
out Detection
ADC with
th Differential
nd Gain
and
peed Timers
High-speed
Software
Library
Libra
Brushless DC
D Motor
DSPlib (AVR
32)
(A
QTou
QTouch
3rd-party
Software
Customer
Application
Networking
LIN2.1
CAN
FlexRay
TWI/I2S
AVR 8-bit
System-inem-inckage
Package
Highly Integrated,
d
AVR-based
LIN2.1 Vector
OSCAN Vector
CAN Boot Loader
OSEK OS
AVR32
60 MIPS
DMA & Event
Controller
Up to 512 kB Flash
150C AEC-Q100,G0
AEC
Control
Motor C
Flash & EEPROM
Description
Package
LIN Transceivers
ATA6622
QFN20
ATA6623
LIN System Basis Chip with LIN Transceiver and Integrated 3.3V/50 mA Voltage Regulator
SO8
ATA6624
QFN20
ATA6625
LIN System Basis Chip with LIN Transceiver and Integrated 5V/50 mA Voltage Regulator
SO8
ATA6626
Low-speed CAN Transceiver for High Transmission Levels, Two-wire Bus Interface,
Point-to-Point Interface Between Trucks and Trailers, Interface Between Dashboard
and Engine, etc.; High Reliability, 27V Operation, Hardware Fault Recognition
QFN20
QFN20
SO8
QFN20
SO8
SO8
SO8
SO8
SO16
LIN Transceiver
Microcontroller
Package
ATA6612
ATA6624
ATmega88
QFN48
ATA6613
ATA6624
ATmega168
QFN48
ATA6616
ATA6624
ATtiny87
QFN38
ATA6617
ATA6624
ATtiny167
QFN38
EEPROM (Bytes)
SRAM (Bytes)
Flash (kB)
16
16
16
16
32
32
32
32
64
64
64
ATmega88
ATmega88V
ATmega16M1
ATmega164P
ATmega168
ATmega169P
ATmega32C1
ATmega32M1
ATmega324P
ATmega328P
ATmega644P
ATmega64C1
ATmega64M1
16
512
512
512
512
512
512
512
512
512
512
256
256
256
256
256
128
16
16
28
16
12
16
12
12
16
12
27
27
32
23
32
27
27
54
23
32
27
23
23
23
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
1.8 - 3.6
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
1.8 - 3.6
2.7 - 5.5
1.8 - 3.6
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
1.8 - 3.6
2.7 - 5.5
2.7 - 5.5
11
11
11
11
11
11
11
11
11
11
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
--
--
--
--
--
12
27
27
32
26
32
27
27
17
26
32
27
26
26
26
12
12
28
16
12
16
1 (10bit) 16
1 (10bit) 16
1 (10bit) 16
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
10
10
10
Yes
--
--
Yes
--
--
--
--
--
--
--
--
--
--
--
--
--
Yes
Yes
Yes
--
--
Yes
Yes
Yes
--
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
1 (6)
1 (6)
1 (6)
1 (6)
1 (6)
1 (15)
1 (15)
1 (15)
USI
No
1+USI
Yes
No
USI
USI
USI
USI
USI
USI
USI
USI
USI
USI
USI
Yes
Yes
Yes
Yes
Yes
Yes
Yes
USI
Yes
Yes
Yes
Yes
Yes
Yes
--
--
--
Yes
Yes
1+USI
USI
USI
USI
Yes
USI
USI
USI
USI
Yes
USI
USI
Yes
Yes
1+USART
1+USART
1+USART
Yes
Yes
Yes
1+USART
1+USART
Yes
1+USART
1+USART
1+USART
Yes
Yes
Yes
All devices have a programmable brown-out controller, on-chip 8-MHz RC oscillator and a watchdog. The maximum frequency is 16 MHz.
ATtiny167
64
ATtiny88
ATtiny861
512
ATtiny85V
ATtiny87
512
512
ATtiny84
256
256
256
ATtiny85
ATtiny45V
ATtiny461
ATtiny45
256
256
128
128
128
ATtiny261
128
128
2048 4096
ATtiny24
ATtiny44
2048
2048
2048
2048
1024
1024
1024
1024
1024
2048 4096
ATtiny25
ATtiny44V
512
1024
2048 4096
1024
1024
1024
1024
512
512
512
512
512
512
256
Yes
Yes
tinyAVR
ATmega48
Analog Comparator
Yes
16-bit Timer
8-bit Timer
2.7 - 5.5
Ext. Interrupts
2.7 - 5.5
Hardware Multiplier
53
Vcc (V)
2.7 - 5.5
PWM Channels
53
RTC
megaAVR
I/O Pins
53
2048
AT90CAN128
1024
SPI
2048 4096
TWI
32
1 (Y)
--
1 (Y)
--
--
--
--
--
--
--
--
--
--
--
1 (Y)
1 (Y)
1 (Y)
1 (Y)
1 (Y)
64
VQFN32,SOIC20,TSSOP20
VQFN32,VQFN20, SOIC20,TSSOP20
TQFP32,VQFN32
VQFN32,SOIC20,TSSOP20
VQFN20,SOIC8
VQFN20,SOIC8
VQFN20
VQFN32,VQFN20, SOIC20,TSSOP20
VQFN20,SOIC8
VQFN20,SOIC8
VQFN20,SOIC14
VQFN20,SOIC14
VQFN32,VQFN20, SOIC20,TSSOP20
VQFN20,SOIC8
VQFN20,SOIC14
TQFP32,VQFN32
TQFP32,VQFN32
VQFN32,TQFP44
TQFP32,VQFN32
VQFN44,TQFP44
TQFP32,VQFN32
TQFP32,VQFN32
VQFN64, TQFP64
TQFP32,VQFN32
VQFN44,TQFP44
TQFP32,VQFN32
TQFP32,VQFN32
TQFP32,VQFN32
TQFP32,VQFN32
VQFN64,LQFP64
VQFN64,LQFP64
VQFN64,LQFP64
Packages
AT90CAN64
125
125
125
125
85
125
125
125
85
125
85
125
125
125
125
125
125
125
125
125
125
125
85
125
125
125
85
125
125
125
125
125
AT90CAN32
CAN
Part Number
www.atmel.com
7
32
64
64
ATmega32M1
ATmega64C1
ATmega64M1
16
ATtiny45
ATtiny461
ATtiny87
ATtiny861
ATtiny167
512
512
512
256
256
128
2048
2048
1024
1024
512
512
512
256
256
128
4096
4096
2048
2048
16
16
16
16
16
27
27
27
27
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
2.7 - 5.5
11
11
11
11
11
11
11
11
11
Yes
Yes
Yes
Yes
Yes
Yes
Yes
--
1 (10bit)
1 (10bit)
1 (10bit)
16
16
16
16
16
27
27
27
27
26
27
26
--
--
--
--
--
--
Yes
Yes
Yes
Yes
Yes
Yes
Yes
10
10
10
Yes
--
Yes
--
--
--
--
--
--
--
Yes
--
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
1 (6)
1 (6)
1 (6)
1 (6)
1 (6)
All devices have a programmable brown-out controller, on-chip 8-MHz RC oscillator and a watchdog. The maximum frequency is 16 MHz.
ATtiny261
tinyAVR
32
ATmega32C1
Flash (KB)
2.7 - 5.5
Analog Comparator
Yes
23
16-bit Timers
11
8-bit Timer
2.7 - 5.5
Ext. Interrupts
1024
Vcc (V)
2.7 - 5.5
Hardware Multiplier
27
PWM Channels
512
I/O Pins
23
RTC
1024
16
SRAM (Bytes)
1024
512
1+USI
Yes
1+USI
Yes
USI
Yes
Yes
Yes
Yes
Yes
1+USART
Yes
1+USART
SPI
ATmega168
EEPROM (Bytes)
512
No
USI
No
USI
USI
USI
Yes
Yes
Yes
Yes
Yes
Yes
Yes
TWI
1 (Y)
--
1 (Y)
--
--
--
1 (Y)
1 (Y)
1 (Y)
1 (Y)
1 (Y)
16
VQFN32, TSSOP20
VQFN32, TSSOP20
VQFN32, TSSOP20
VQFN32, TSSOP20
VQFN20
VQFN32, TSSOP20
TQFP32,VQFN32
TQFP32,VQFN32
TQFP32,VQFN32
TQFP32,VQFN32
TQFP32,VQFN32
TQFP32,VQFN32
TQFP32,VQFN32
Packages
ATmega16M1
150
150
150
150
150
150
150
150
150
150
150
150
150
ATmega88
megaAVR
Part Number
8
AVr Microcontrollers for automotive
Everywhere You Are
Part Number
68
68
68
68
68
68
68
91
UC3C2128
UC3C0256
UC3C1256
UC3C2256
UC3C0512
UC3C1512
UC3C2512
UC3A0512
512
512
512
512
256
256
256
128
128
16
64
64
64
64
64
64
64
32
32
36
109
47
83
125
47
83
125
47
83
125
1.6 - 3.6
1.8 - 3.6
4.5 - 5.5
4.5 - 5.5
4.5 - 5.5
4.5 - 5.5
4.5 - 5.5
4.5 - 5.5
4.5 - 5.5
4.5 - 5.5
4.5 - 5.5
12b 9c
10b 8c
12b 11c
12b 16c
12b 16c
12b 11c
12b 16c
12b 16c
12b 11c
12b 16c
12b 16c
--
--
1 12bit
2 12bit
2 12bit
1 12bit
2 12bit
2 12bit
1 12bit
2 12bit
2 12bit
DAC
32
20bit 7c
20bit 4c
20bit 4c
20bit 4c
20bit 4c
20bit 4c
20bit 4c
20bit 4c
20bit 4c
20bit 4c
32-bit Timers
6
1(3c)
12
12
12
12
12
12
12
12
12
12
12
12
--
--
--
--
--
--
--
--
--
--
--
--
--
FS-OTG
FS-OTG
FS-OTG
FS-OTG
FS-OTG
FS-OTG
FS-OTG
FS-OTG
FS-OTG
FS-OTG
--
--
--
2 (16)
2 (16)
2 (16)
2 (16)
2 (16)
2 (16)
2 (16)
2 (16)
2 (16)
--
--
--
--
--
TQFP48, QFN48
LQFP144
TQFP64
TQFP100
VQFP144
TQFP64
TQFP100
VQFP144
TQFP64
TQFP100
VQFP144
TQFP48, QFN48
TQFP48, QFN48
All devices have a programmable brown-out controller, on-chip 8-MHz RC oscillator and a watchdog. The maximum frequency is 66 MHz (UC3A0512) and 50 MHz (all others).
68
UC3C1128
MIPS
64
Analog Comparator
8
16-bit Timer
128
DMA Channels
12b 9c
On-chip Oscillator
68
Vcc (V)
1.6 - 3.6
1.6 - 3.6
Ethernnet
64
I/O Pins
36
USB
36
UC3C0128
SRAM (KB)
SSC (I2S)
16
SPI
UC3L064
Flash (KB)
16
TWI
32
Packages
64
64
--
--
--
--
--
--
--
--
--
--
Touch Hardware
UC3L032
85
125
125
125
125
125
125
125
125
125
125
125
125
UC3L016
megaAVR
www.atmel.com
10
Contents
Description
Compilers
On-chip Debugger
JTAGICE mkII
In-system Programmers
Starter Kits
STK500, STK600
tions.
Description
EK2-PA Board
Power Adapter
EK2-MC Board
EK2-SS Board
EK2-LA Board
EK2-CT Board
The ATAVRAUTO-EK2 evaluation kit is delivered with a BLDC motor and Vector LIN stack demo for BLDC
motor control using a potentiometer.
www.atmel.com
EK2-PA
Power
Adapter
EK2-MC
EK2-SS
EK2-CT
EK2-LA
BDLC
Motor
Control
Sensor
LEDs
Capacitive
Touch
AVR32
LIN
Analyzer
with LCD
Thirdparty
Tools
LIN Network
Power Supply
To PC
Development Kits
Contents
Description
MC310
Motor
BLDC Motor
CAN
LIN
MC310
MC300
Hotline
Website
www.atmel.com/products/avr/auto
11
12
QTouch Library
Atmels QTouch library is a set of pre-compiled
n ATtiny44/84
n ATtiny45/85
n ATtiny461/861
n ATtiny88
n ATtiny87/167
Vector LIN2.1
protocol stack
Atmel QTouch
QMatrix library
Customer
application
n ATmega64M1/C1
n CAN32/64/128
n Starter Kits
n C/C++ Compiler
n Debuggers
Starter Kit
Part Number
Description
STK600
Evaluation Kits
Part Number
Description
EVK1100UC3A
EVK1103UC3C
www.atmel.com
Continuous Improvement
To meet the zero-defect challenge Atmel has
in-class reliability.
13
Headquarters
Atmel Corporation
2325 Orchard Parkway
San Jose, CA 95131
USA
Tel: (1) 408 441-0311
Fax: (1) 408 487-2600
International
Atmel Asia
Unit 01-05 & 16, 19F
BEA Tower, Millenium City 5
418 Kwun Tong Road
Kwun Tong, Kowloon
Hong Kong
Tel: (852) 2245-6100
Fax: (852) 2722-1369
Atmel Europe
Le Krebs
8, Rue Jean-Pierre Timbaud
BP 309
78180 Montigny-le-Bretonneux
France
Tel: (33) 1-30-60-70-00
Fax: (33) 1-30-60-71-11
Atmel Japan
9F, Tonetsu Shinkawa Bldg.
1-24-8 Shinkawa
Chuo-ku, Tokyo 104-0033
Japan
Tel: (81) 3-3523-3551
Fax: (81) 3-3523-7581
Product Contact
Product Line
[email protected]
Literature Requests
www.atmel.com/literature
Web Site
www.atmel.com
Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or
otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET
FORTH IN ATMELS TERMS AND CONDITIONS OF SALES LOCATED ON ATMELS WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN
NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES
(INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION)
ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this
document and reserves the right to make changes to specifications and product descriptions at any time without notice. Atmel does not
make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable
for, and shall not be used in, automotive applications. Atmels products are not intended, authorized, or warranted for use as components
in applications intended to support or sustain life.