East west university


Download 0.73 Mb.
bet8/13
Sana20.06.2023
Hajmi0.73 Mb.
#1628509
1   ...   5   6   7   8   9   10   11   12   13
Bog'liq
Md. Tanvir Nur

ATmega328P pin mapping

OOArduino function










Arduino function OQ

reset




PC 6




РС5

analog input 5

digital pin 0 liTB

PDO

J 2 /

РС4

analog input 4

digital pin 1




PD1

1 • i

РСЗ

analog input 3

digital pin 2




PD2

•: 25

РС2

analog input 2

digital pin 3

ISTO1

PD3

S 24

PCI

analog input 1

digital pin 4




PD4

Ь 23

РСО

analog input 0

vcc




Vcc

КзаИ^Я ?

GND

GND

GND




GND

'' '1

AREF analog reference

crystal




PB6

9 КЕ^И 20

AVCC AVCC

crystal




PB7

: j

PB5

33 : digital pin 13

digital pin 5




PD5

11 1 в

PB4

liirifr' digital pin 12
1

digital pin 6




PD6

- ■■ : ■■'

PBS

(JJJEi digital pin 11
















e a :

digital pin 7




PD7




P02

sj ® : (ЗЖ1 digital pin 10

digital pin 8




PBO

11 15

PB1

| о : (ЗШ© digital pin 9
Й t


Figure 2.5: Pin Configuration of ATmega328p [24]

      1. Pin Description

  • VCC: Digital supply voltage

  • GND: Ground.

  • Port B (PB [7:0]) XTAL1/XTAL2/TOSC1/TOSC2: Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running. Depending on the clock selection fuse settings, PB6 can be used as input to the inverting Oscillator amplifier and input to the internal clock operating circuit. Depending on the clock selection fuse settings,

PB7 can be used as output from the inverting Oscillator amplifier. If the Internal Calibrated RC Oscillator is used as chip clock source, PB [7:6] is used as TOSC [2:1] input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.

  • Port C (PC [5:0]): Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The PC [5:0] output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running.

  • PC6/RESET: If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical characteristics of PC6 differ from those of the other pins of Port C. If the RSTDISBL Fuse is not programmed, PC6 is used as a Reset input. A low level on this pin for longer than the minimum pulse length will generate a Reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a Reset. The various special features of Port Care elaborated in the Alternate Functions of Port C section.

  • Port D (PD [7:0]): Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running.

  • AVCC: AVCC is the supply voltage pin for the A/D Converter, PC [3:0], and PE [3:2]. It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter. Note that PC[6:4] use digital supply voltage, VCC

  • AREF: AREF is the analog reference pin for the A/D Converter.

  • ADC [7:6] (TQFP and VFQFN Package Only): In the TQFP and VFQFN package, ADC [7:6] serve as analog inputs to the A/D converter. These pins are powered from the analog supply and serve as 10-bit ADC channels. [16]


Figure 2.6: Block diagram of AVR Microcontroller [26]
2.5 Arduino
The Arduino Uno is a microcontroller board based on the ATmega328. It has 14 digital Input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial converter [17]


Figure 2.7: Arduino Uno Board [18]
The Arduino Uno can be powered via the USB connection or with an external power supply. The power source is selected automatically. External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the Ground and Vin pin headers of the POWER connector. The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.

      1. Power pins of Arduino

VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
5V. the regulated power supply used to power the microcontroller and other components on the board. This can come either from VIN via an on-board regulator, or be supplied by USB or another regulated 5V supply.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.












Reset Bytton

LED-Load & Pin 13

14x Digital IN/OUT
(6x PWM~ OUT)
(5V, 40mA)


USB
(Power 5V)


LED - Power ON
(Green or Orange)


Atmel ATmega328P
Microcontroller
(8-bit,
16 MHz,
32 KB Flash,
1 KB EEPROM,
2
KB SRAM)


DC Power Jack

Power OUT Power IN 6x Analog IN

(AC-to-DC adapter)
(7-12V)


(5V, 3.3V) (9V battery) (0-5V 10-bit ADC)

Figure 2.8: Arduino Uno Specification [27]
GND. Ground pins. [19]
Specification table:

Microcontroller

ATmega328

Operating Voltage

5V

Input Voltage

7-12V

Input Voltage (limits)

6-20V

Digital I/O Pins

14 (of which 6 provide PWM output)

Analog Input Pins

6

DC Current per I/O Pin

40mA

DC Current for 3.3 V Pin

50Ma



      1. Arduino Pin Mapping

In standard Orangutan and 3pi documentation, it uses the same convention that Atmel uses in its ATmega328 datasheet, referring to pins by their associated ports. For example, pin PD7 is pin 7 of port D. This convention is used because each port is controlled by its own AVR registers, and the bits of these registers correspond to individual pins.
The Arduino insulates the user from this level of detail, referring to the I/O pins as digital pins 0 to 13 and analog inputs 0 to 7. Note that this terminology can be a bit misleading since analog inputs 0 to 5 can also be used as general purpose digital I/O pins (referred to as digital pins 14 to 19). To see exactly how the mega168/328 pins are mapped to Arduino pins we have to visit their website. This page shows a 28-pin DIP package chip while the Orangutans carry smaller 32-pin MLF packages that contain two additional dedicated analog inputs: ADC6 and ADC7. In the Arduino environment, these pins become Arduino analog inputs 6 and 7, respectively [20].

Download 0.73 Mb.

Do'stlaringiz bilan baham:
1   ...   5   6   7   8   9   10   11   12   13




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling