1
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities
AT
M
M
i
e
cr
g
F
o
a
Y
C
3
–
o
2
D
n
8
t
E
r
S
P
ol l e
…
r
.
3
H – VIT
.
B
1
asi cs
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities
Mechatronics & Robotics
All about Arduino and ATMega ………….
MCQ test ……!
Q) What is Arduino ?
FY - Department of Engineering, Sciences and Humanities
Vishwakarma Institute of Technology
a) It is a MuP
b) It is a MuC developed by ATMega company
c) It is a Development Board made by ATMega company
d) It is a MuC developed by AVR company along with ATMega
e) It is nothing but ATMega 328P Microcontroller only …!
Important about Arduino !
Arduino is a “Development Board” on which
FY - Department of Engineering, Sciences and Humanities
Vishwakarma Institute of Technology
ATMega 328P microcontroller (manufactured by
Atmel company) is mounted !
So, what is AVR ????
AVR is a series / family of microcontrollers developed by
Atmel in 1996.
Atmel is now taken over by Microchip Technology in 2016.
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
Lily Pad
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
Duemilanove
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
Mini Pro
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
NG 240
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
Diecimila
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
Extreme
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
Nano V3
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
BT
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
MEGA
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
Due
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
YUN
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
ESPLORA
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards :
ROBOT
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities Arduino boards : UNO
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities
USB
Reset
socket
Power Supply
Digital Output / PWM / Serial Pins
MuC - ATMega328P
Power pins Analog pins
In circuit serial programming
Some interesting facts about Arduino !
The Arduino project started in 2005 as a program for students in
FY - Department of Engineering, Sciences and Humanities
Italy to provide a low-cost and easy way for begineers to create
Vishwakarma Institute of Technology
devices which can interact with other devices and environment using
sensors and actuators.
Arduino is a open source hardware and software company
who has permitted manufacturing of Arduino boards and kits
by anyone.
Arduino boards use a variety of Micro Controllers on them.
Some interesting facts about Arduino !
Arduino boards consist of an Atmel make 8-bit AVR MuC like
FY - Department of Engineering, Sciences and Humanities
ATMega 8, ATMega168, ATMega 328, ATmega1280, ATMega 2560
Vishwakarma Institute of Technology
etc.
The software – Program for Arduino hardware may be written
in any programming language with compilers that can convert
the program to binary machine code.
Atmel provides a development environment - AVR Studio
(older) and Atmel Studio (newer)
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities
Pin diagram of ATMega328P
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities
Vishwakarma Institute of Technology
FY - Department of Engineering, Sciences and Humanities
Features of ATMega328P
1) 8 bit MuC with 32 KB flash memory
FY - Department of Engineering, Sciences and Humanities
2) 1 KB EEPROM with 2 KB internal SRAM
Vishwakarma Institute of Technology
3) Total of 28 pins
4) 14 pins are digital i/o pins. 6 of which can be used for PWM o/p
5) 6 pins are for analog input
6) Thus, 14 + 6 = 20 pins for i/o
7) Internal ADC is available. 3 pins for control of analog i/p
8) 2 pins for clock and 2 pins for power
9) 1 pin for Reset
10) Arduino UNO board uses 16MHz crystal frequency. But crystal
Features of ATMega328P
11) ATMega328P has 3 Ports – Port B, Port C and Port D.
12) Port B and Port D are digital ports – 8 pins each.
FY - Department of Engineering, Sciences and Humanities
Vishwakarma Institute of Technology
13) Port B – Pin PB0 to PB7 (including 2 XTAL pins)
(Pin 14, 15, 16, 17, 18, 19, 9, 10)
14) Port D – Pin PD0 to PD7 (including 2 RX and TX pins)
(Pin 2, 3, 4, 5, 6, 11, 12, 13)
15) Port C is an analog Port – with 7 pins.
16) Port C – Pin PC0 to PC6 (including Reset pin)
(Pin 23, 24, 25, 26, 27, 28, 1)
17) Total digital pins of B and D together – 14
Features of ATMega328P
18) AVR is series of MuCs developed by Atmel.
FY - Department of Engineering, Sciences and Humanities
Vishwakarma Institute of Technology
19) Harvard – RISC architecture is used.
20) Separate memories and buses for program and data.
21) Instructions are executed with a single level pipelining.
22) While one instruction is being executed, the next instruction is
pre-fetched from the program memory.
Features of ATMega328P
23) 16 MHz quartz crystal
FY - Department of Engineering, Sciences and Humanities
24) Operating voltage 1.8 – 5.5 V
Vishwakarma Institute of Technology
25) Max. DC current for i/o pins at 5 V = 20 mA
26) Max. DC current for i/o pins at 3.3 V = 50 mA
27) Temperature range = – 40 deg. C to +105 deg. C
28) 8 bit 32 registers.
29) 23 general purpose i/o lines.
30) Most of the instructions need single cycle for execution.
31) 6 channel, 10 bit ADC
Features of ATMega328P
32) 2 timers / counters – 8 bit.
FY - Department of Engineering, Sciences and Humanities
33) 1 timer / counter – 16 bit.
Vishwakarma Institute of Technology
34) 1 Real time counter (RTC)
35) 1 SPI – Serial Peripheral Interface
36) 1 USART - Universal Synchronous Asynchronous Receiver
Transmitter
37) Chip can be locked through s/w for security.
38) Read while Write capacity
Pin description of ATMega328P
Port D – Pin PD0 to PD7 –
FY - Department of Engineering, Sciences and Humanities
Vishwakarma Institute of Technology
Port D – Pin PD0 to PD7
– Pin 2, 3, 4, 5, 6, 11, 12, 13.
Port D is 8 bit bidirectional
digital port including RXD on
pin 2 and TXD on pin 3.
Pin description of ATMega328P
Port B – Pin PB0 to PB7 –
FY - Department of Engineering, Sciences and Humanities
Vishwakarma Institute of Technology
Port B – Pin PB0 to PB7 –
Pin 14, 15, 16, 17, 18, 19, 9, 10.
If selected through settings, PB6 and PB7
(pins 9 and 10) can be connected to the
external oscillator. If internal chip clock is
used, then two pins can be used as i/p for
the Asynchronous timer/counter – TOSC1
and TOSC2 through ASSR (Asynchronous
Status Register)
Pin description of ATMega328P
Port C – Pin PC0 to PC6 –
FY - Department of Engineering, Sciences and Humanities
Pin 23. 24, 25, 26, 27, 28, 1
Vishwakarma Institute of Technology
Port C is a 7 bit bidirectional i/o
port.
Pin 1 – PC6 (RESET) – This Pin by
default is used as RESET pin. Active low
required for longer than 1 pulse length.
Additional function - PC6 can be used as
i/o pin when RSTDISBL Fuse is
programmed.
Pin description of ATMega328P
Port C – Pin PC0 to PC5 – 6 Analog pins
Pin 28 – PC5 – Analog pin/Serial bus clock SCL / Ext. Interrupt pin
FY - Department of Engineering, Sciences and Humanities
Vishwakarma Institute of Technology
Pin 27 – PC4 – Analog pin/Serial bus data SDA / Ext. Interrupt pin
Pin 26 – PC3 – Analog pin / Ext. Interrupt pin
Pin 25 – PC2 – Analog pin / Ext. Interrupt pin
Pin 24 – PC1 – Analog pin / Ext. Interrupt pin
Pin 23 – PC0 – Analog pin / Ext. Interrupt pin
Pin PC0 to PC5 – Above 6 Analog pins can be programmed to handle
digital i/o data as well. (These are not dedicated analog pins)
Question - In all, how many pins can handle digital data ?
Pin description of ATMega328P
Pin 7 – VCC – Connected to positive voltage (1.8 V to 5.5 V)
FY - Department of Engineering, Sciences and Humanities
Vishwakarma Institute of Technology
Pin 8 – GND – This is ground (0V) for digital connections.
Pin 20 – AVCC – Supply voltage pin for ADC. This is to be
connected to Vcc even if ADC is not being used. When ADC is being
used, it should be connected to Vcc through a inductor. (low pass
filter)
Pin 21 – AREF – This is for external analog reference voltage pin
for the ADC.
Pin 22 – GND – This is ground (0V) for analog connections.
Vishwakarma Institute of Technology
35
FY - Department of Engineering, Sciences and Humanities
ATMe
Micro
g
C
a
o
a
3
FY – D
nt
2
n
r
8
ol
k
P
l er
B
3
a
s!
.
Th ESH – VIT
s
1
i cs