0% found this document useful (0 votes)
335 views10 pages

Atmega 328

The Atmel ATmega328/P is a low-power 8-bit microcontroller based on the AVR architecture that can achieve high throughput close to 1MIPS per MHz. It has 32 KB of flash memory, 2 KB of SRAM, 1 KB of EEPROM, and 23 general purpose I/O lines. Programming is done through an SPI serial interface and the microcontroller has various operating modes for low power usage.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
335 views10 pages

Atmega 328

The Atmel ATmega328/P is a low-power 8-bit microcontroller based on the AVR architecture that can achieve high throughput close to 1MIPS per MHz. It has 32 KB of flash memory, 2 KB of SRAM, 1 KB of EEPROM, and 23 general purpose I/O lines. Programming is done through an SPI serial interface and the microcontroller has various operating modes for low power usage.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

ATMEGA328 Introduction

The Atmel ATmega328/P is a low-power CMOS 8-bit microcontroller based on the AVR
enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the
ATmega328/P achieves throughputs close to 1MIPS per MHz. This empowers system
designer to optimize the device for power consumption versus processing speed.

Description:

The Atmel AVR core combines a rich instruction set with 32 general purpose working
registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
allowing two independent registers to be accessed in a single instruction executed in one
clock cycle. The resulting architecture is more code efficient while achieving throughputs up
to ten times faster than conventional CISC microcontrollers. The ATmega328/P provides the
following features: 32Kbytes of In-System Programmable Flash with Read-While-Write
capabilities, 1Kbytes EEPROM, 2Kbytes SRAM, 23 general purpose I/O lines, 32 general
purpose working registers, Real Time Counter (RTC), three flexible Timer/Counters with
compare modes and PWM, 1 serial programmable USARTs , 1 byte-oriented 2-wire Serial
Interface (I2C), a 6- channel 10-bit ADC (8 channels in TQFP and QFN/MLF packages) , a
programmable Watchdog Timer with internal Oscillator, an SPI serial port, and six software
selectable power saving modes. The Idle mode stops the CPU while allowing the SRAM,
Timer/Counters, SPI port, and interrupt system to continue functioning. The Power-down
mode saves the register contents but freezes the Oscillator, disabling all other chip functions
until the next interrupt or hardware reset. In Power-save mode, the asynchronous timer
continues to run, allowing the user to maintain a timer base while the rest of the device is
sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except
asynchronous timer and ADC to minimize switching noise during ADC conversions. In
Standby mode, the crystal/resonator oscillator is running while the rest of the device is
sleeping. This allows very fast start-up combined with low power consumption. In Extended
Standby mode, both the main oscillator and the asynchronous timer continue to run.

Atmel offers the Q Touch library for embedding capacitive touch buttons, sliders and wheels
functionality into AVR microcontrollers. The patented charge-transfer signal acquisition
offers robust sensing and includes fully de bounced reporting of touch keys and includes
Adjacent Key Suppression technology for unambiguous detection of key events. The easy-to-
use Q Touch Suite toolchain allows you to explore, develop and debug your own touch
applications.

The device is manufactured using Atmel’s high density non-volatile memory technology. The
On-chip ISP Flash allows the program memory to be reprogrammed In-System through an
SPI serial interface, by a conventional nonvolatile memory programmer, or by an On-chip
Boot program running on the AVR core. The Boot program can use any interface to
download the application program in the Application Flash memory. Software in the Boot
Flash section will continue to run while the Application Flash section is updated, providing
true Read-While-Write operation. By combining an 8-bit RISC CPU with In-System Self-
Programmable Flash on a monolithic chip, the Atmel ATmega328/P is a powerful
microcontroller that provides a highly flexible and cost effective solution to many embedded
control applications. The ATmega328/P is supported with a full suite of program and system
development tools including: C Compilers, Macro Assemblers, Program
Debugger/Simulators, In-Circuit Emulators, and Evaluation kits.

Configuration summary

Features Atmega328/p
Pin count 28/32
Flash (bytes) 32k
SRAM(bytes) 2k
EEPROM(bytes) 1k
General purpose I/O lines 23
SPI 2
TWI(i2c) 1
USART 1
ADC 10 bit 15Ksps
ADC Channels 8
8-bite Timer counter 2
16 bite Timer counter 1
Atmega 328 architecture:
Basically, the processor of the Arduino board uses the Harvard architecture where the
program code and program data have separate memory. It consists of two memories such as
program memory and data memory. Wherein the data is stored in data memory and the code
is stored in the flash program memory. The Atmega328 microcontroller has 32kb of flash
memory, 2kb of SRAM 1kb of EPROM and operates with a 16MHz clock speed.

2ATMEGA328 PIN DIAGRAM:


Pin Category Pin Name Details

Vin: Input voltage to Arduino when using an


external power source.
5V: Regulated power supply used to power
Vin, 3.3V, 5V,
Power microcontroller and other components on the board.
GND
3.3V: 3.3V supply generated by on-board voltage
regulator. Maximum current draw is 50mA.
GND: ground pins.

Reset Reset Resets the microcontroller.

Analog Pins A0 – A5 Used to provide analog input in the range of 0-5V

Input/Output Digital Pins 0 -


Can be used as input or output pins.
Pins 13

Serial 0(Rx), 1(Tx) Used to receive and transmit TTL serial data.

External
2, 3 To trigger an interrupt.
Interrupts

PWM 3, 5, 6, 9, 11 Provides 8-bit PWM output.

10 (SS), 11
(MOSI), 12
SPI Used for SPI communication.
(MISO) and 13
(SCK)

Inbuilt LED 13 To turn on the inbuilt LED.

A4 (SDA), A5
TWI Used for TWI communication.
(SCA)

AREF AREF To provide reference voltage for input voltage.


An Arduino board is a one type of microcontroller based kit. The first Arduino technology
was developed in the year 2005 by David Cuartielles and Massimo Banzi. The designers
thought to provide easy and low cost board for students, hobbyists and professionals to build
devices. Arduino board can be purchased from the seller or directly we can make at home
using various basic components. The best examples of Arduino for beginners and hobbyists
includes motor detectors and thermostats, and simple robots. In the year 2011, Adafruit
industries expected that over 3lakhs Arduino boards had been produced. But, 7lakhs boards
were in user’s hands in the year 2013. Arduino technology is used in many operating devices
like communication or controlling.

Arduino Technology

A typical example of the Arduino board is Arduino Uno.It includes an ATmega328


microcontroller and it has 28-pins
Arduino Pin Diagram

The pin configuration of the Arduino Uno board is shown in the above. It consists of
14-digital i/o pins. Wherein 6 pins are used as pulse width modulation o/ps and 6
analog i/ps, a USB connection, a power jack, a 16MHz crystal oscillator, a reset
button, and an ICSP header. Arduino board can be powered either from the personal
computer through a USB or external source like a battery or an adaptor. This board
can operate with an external supply of 7-12V by giving voltage reference through the
IORef pin or through the pin Vin.

Digital I/Ps

It comprises of 14-digital I/O pins, each pin take up and provides 40mA current.
Some of the pins have special functions like pins 0 & 1, which acts as a transmitter
and receiver respectively. For serial communication, pins-2 & 3 are external
interrupts, 3,5,6,9,11 pins delivers PWM o/p and pin-13 is used to connect LED.

How to program an Arduino?

The main advantage of the Arduino technology is, you can directly load the programs
into the device without the need of a hardware programmer to burn the program. This
is done because of the presence of the 0.5KB of boot loader, that allows the program
to be dumped into the circuit. The Arduino tool window contains a toolbar with a
various buttons like new, open, verify, upload and serial monitor. And additionally it
comprises of a text editor (employed to write the code), a message space (displays the
feedback) like showing the errors, the text console, that displays the o/p & a series of
menus just like the file, tool menu & edit.

Arduino Program
 Programming into the Arduino board is called as sketches. Each sketch contains of
three parts such as Variables Declaration, Initialization and Control code. Where,
Initialization is written in the setup function and Control code is written in the loop
function.
 The sketch is saved with .ino and any operation like opening a sketch, verifying and
saving can be done using the tool menu.
 The sketch must be stored in the sketchbook directory.
 Select the suitable board from the serial port numbers and tools menu.
 Select the tools menu and click on the upload button, then the boot loader uploads the
code on the microcontroller.

Basic Functions of Arduino Technology

Digital read pin reads the digital value of the given pin.

Digital write pin is used to write the digital value of the given pin.

Pin mode pin is used to set the pin to I/O mode.

Analog read pin reads and returns the value.

Analog write pin writes the value of the pin.

Serial. Begins pin sets the beginning of serial communication by setting the rate of bit.

Advantages of Arduino Technology

It is cheap

It comes with an open supply hardware feature that permits users to develop their own kit

The software of the Arduino is well-suited with all kinds of in operation systems like Linux,
Windows, and Macintosh, etc.

It also comes with open supply software system feature that permits tough software system
developers to use the Arduino code to merge with the prevailing programing language
libraries and may be extended and changed.

You might also like