0% found this document useful (0 votes)
10 views25 pages

Microcompuer Chapter 1

The document provides an overview of the Atmel AVR (Arduino Uno) microcontroller, detailing its role in electronics, key features, and various applications. It describes the hardware components, including digital and analog pins, power supply options, and communication interfaces. Additionally, it outlines the specifications of the ATmega328P microcontroller, which serves as the core of the Arduino Uno, highlighting its architecture, memory, and input/output capabilities.

Uploaded by

Pepis Kgaugelo
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views25 pages

Microcompuer Chapter 1

The document provides an overview of the Atmel AVR (Arduino Uno) microcontroller, detailing its role in electronics, key features, and various applications. It describes the hardware components, including digital and analog pins, power supply options, and communication interfaces. Additionally, it outlines the specifications of the ATmega328P microcontroller, which serves as the core of the Arduino Uno, highlighting its architecture, memory, and input/output capabilities.

Uploaded by

Pepis Kgaugelo
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

The Atmel AVR (Arduino

Uno) Microcontroller:
The discussion of the role of microcontrollers in everyday
life, criteria for choosing microcontroller and various
members of the Atmel (Arduino Uno) microcontroller
family.
INTRODUCTION TO ARDUINO UNO
MICROCONTROLLER
The Arduino platform is an open-source electronics platform based on
easy-to-use hardware and software. It's designed to make building digital
devices and interactive objects simple for beginners, hobbyists, and
engineers.
Arduino is made up of both hardware and software. The Arduino board is a printed
circuit board (PCB) designed to use a microcontroller chip as well as other input
and outputs. The board has many other electronic components that are needed for
the microcontroller to function or to extend its capabilities.

A microcontroller is a small computer contained in a single, integrated circuit or


computer chip.
Microcontrollers are an excellent way to program and control electronics.
Microcontroller boards have a microcontroller chip and other useful connectors and
components that allow a user to attach inputs and outputs. Some examples of
devices with microcontroller boards are the Wiring board, the PIC, and the Basic
Stamp
ARDUINO BOARD
• ARDUINO UNO

• Figure 1: ARDUINO UNO BOARD


• Digital pins
• You use digital pins (refer to Figure 2-4) to send and receive digital signals. Digital
• implies that the pins have two states: off or on. In electrical terms, these states
• translate to a value of 0 or 5 volts, but no values in between.
• Analog in pins
• You use analog in pins (refer to Figure 2-4) to receive an analog value. An analog
• value is taken from a range of values. In this case, the range is the same 0V to 5V
• as with the digital pins, but the value can be at any point — 0.1, 0.2, 0.3, and so on.
WHAT CAN MICROCONTROLLER
DOES
• Arduino Boards (Hardware):
• • Microcontroller-based boards (e.g., Arduino UNO, Mega, Nano, Leonardo)
• • Used to read inputs (like sensors, buttons) and control outputs (like LEDs,
motors)

You write code in the Arduino software to tell the microcontroller what to to-do.

For example, by writing a line of code, you can tell an light-emitting diode (LED) to blink on and off. If
you connect a pushbutton and add another line of code, you can tell the LED to turn on only when the
button is pressed.

Next, you may want to tell the LED to blink only when the pushbutton is held down. In this way, you
can quickly build a behavior for a system that would be difficult to achieve without
a microcontroller.

Similar to a conventional computer, an Arduino can perform a multitude of functions, but it’s not much
use on its own. It requires inputs or outputs to make it useful. These inputs and outputs allow a
computer — and an Arduino — to sense objects in the world and to affect the world.
• Τψπιχαλ Αππλιχατιονσ:
• Arduino-based projects
• • IoT devices
• • Consumer electronics
• • Robotics
• • Industrial automation
• • Embedded control systems
ARDUINO BOARD
• The Arduino I/O Board has traditionally been based on the Atmel AVR ATmega8 and later
derivatives. The I/O Board also contains a serial port, power supply circuitry, expansion connectors,
and miscellaneous support components.
• It’s just an AVR development board. An AVR is a programmable microcontroller chip.

• Figure 2: Block layout of Arduino I/O board


CRITERIA FOR CHOOSEN A
MICROPROCESSOR
• Processor
• The main brain of the Arduino Uno is the Atmel AVR ATmega328, the black, rectangular plastic block with
two rows of pins protruding from its sides. On the SMD version, the processor is one of the two miniscule
black squares soldered directly to the PCB.
• This device is essentially a computer on a chip, containing a central processing unit (CPU), memory
arrays, clocks, and peripherals in a single package.

Figure 3: Simplified block diagram of the ATmega328


SERIAL PORT
• The function of the serial port remains unchanged from the earliest days of Arduino. The connectors
have changed, but everyone pretends that everything is the same. From a functional perspective,
this is certainly true. The serial port is used to communicate. In the development stage of your
Arduino project, the communication is between the Arduino and your PC, where you’re writing,
compiling, and uploading your sketch to the I/O Board. In the application (or deployment) phase of
your project, when your
• Arduino is performing its intended purpose, the serial port may continue to communicate with your
PC, if that is part of the plan, or it may communicate with another serial device. The use of the serial
port is optional at the application stage, so it may be communicating with nothing at all. If this is the
case, the receive (RX) and transmit (TX) pins can be used as general-purpose input/output (I/O)
lines.
SERIAL PORT
• There are several types of serial communication protocols. The
Arduino’s serial port (internally referred to as the USART
peripheral, or Universal Asynchronous/Synchronous
Transmitter/Receiver) is used in an asynchronous mode,
meaning it doesn’t provide or require an independent clock
signal. This mode of operation is identical to the serial ports of
most PCs, also known as RS-232 ports. The built-in serial port
hardware on the ATmega328 chip is capable of other modes of
operation, including synchronous mode, where a separate,
dedicated signal carries the clock information. The
asynchronous method uses one signal to transmit data and
another to receive data. Depending on your application
requirements, you may need to transmit, receive, do both, or do
neither.
POWER SUPPLY
• There are several ways to get power to your Arduino. The simplest, at least initially, is to use the
power supplied with the USB cable, which comes from your PC. The USB standard allows for the
supply of up to 100mA (milliamps, or 0.1 amps) of current at 5.0V for an unenumerated USB device
(that is, a device plugged into the USB bus but not properly identifying itself to the host, such as a
USB power tap)
and as much as 500mA (0.5 amps) for a properly enumerated USB device. This is more than
enough electrical power to light up several LEDs and a few low-power sensors. It isn’t sufficient for
larger
electrical loads, such as relays, heaters, fans, motors, or solenoids.
When the Arduino isn’t connected to a PC via the USB cable, regulated 5V power can be supplied to
it through the power expansion connector pins labeled 5V and GND.
A regulated 5V supply is required when supplying power via the 5V and GND pins. An unregulated
• supply’s voltage fluctuates with line voltage and load, with the distinct possibility of exceeding the
narrow voltage range and very likely causing permanent damage to one or more components,
including the processor. The standard Arduino I/O Board provides a voltage regulator. Use it.
EXPANSION SLOT

• To make it easier to connect your Arduino to additional circuitry, four sets of expansion connectors
are
provided. The two connectors across the top edge of the PCB contain the digital pins, along with the
analog reference input and an additional ground connection. The USART TX and RX pins are among
these pins, as well.
Along the bottom edge of the PCB are the power and analog connectors. The power connector
provides connections to the main supply voltages (Vin, 5V, 3V3, and ground) along with a connection
to the microcontroller’s -RESET pin. The analog connector brings out the six analog inputs, which can
also be used as digital I/O lines if need be.
• Digital pins
• You use digital pins to send and receive digital signals. Digital
• implies that the pins have two states: off or on. In electrical terms,
these states translate to a value of 0 or 5 volts, but no values in
between.
• Analog in pins
• You use analog in pins to receive an analog value. An analog
• value is taken from a range of values. In this case, the range is the
same 0V to 5V as with the digital pins, but the value can be at any
point — 0.1, 0.2, 0.3, and so on.
VARIATIONS OF ARDUINO
• ARDUINO MEGA
• ARDUINO SERIAL
• ARDUINO USB
• ARDUINO EXTREME
• ARDUINO NOVA
• ARDUINO DIECIMILA
• ARDUINO DUEMILANOVE
• Overview of Arduino UNO Board:
• 􀀀􀀀1. Microcontroller:
• • ATmega328P
• • 8-bit AVR microcontroller
• • Clock Speed: 16 MHz
• • Flash Memory: 32 KB
• • SRAM: 2 KB
• • EEPROM: 1 KB
• 􀀀􀀀2. Digital I/O Pins:
• • 14 digital pins (numbered 0 to 13)
• 6 of these (pins 3, 5, 6, 9, 10, 11) can be used as PWM (Pulse Width Modulation) outputs.
• 􀀀􀀀3. Analog Input Pins:
• • 6 analog input pins (A0 to A5)
• • Used to read analog sensors like temperature, light, etc.
• 􀀀􀀀4. Power Supply:
• • Can be powered via: o USB port (5V from computer)
• o External adapter (7–12V recommended)
• o Vin pin (external voltage input)
• • Includes onboard voltage regulator to manage 3.3V and 5V outputs.
• 5. ΥΣΒ Ιντερφαχε:
• USB-B port for: o Uploading code from a computer
• o Serial communication (via Serial Monitor in the Arduino IDE)
• 􀀀􀀀6. Reset Button:
• • Restarts the program running on the microcontroller.

• 􀀀􀀀7. ICSP Header (In-Circuit Serial Programming):


• • For programming the microcontroller directly using an external programmer.
• 􀀀􀀀Power and Status LEDs:
• • Power LED (ON): Indicates the board is powered.
• • TX/RX LEDs: Blink during USB communication.
• • Built-in LED on Pin 13: For testing and debugging.
• The ATmega328P is an 8-bit AVR RISC-based microcontroller from Microchip (formerly Atmel),
widely used in embedded systems — especially in the Arduino UNO board.
• 􀀀􀀀 Core Features:
• Feature Specification
• Architecture 8-bit AVR RISC
• Operating Voltage 1.8V – 5.5V
• Flash Memory 32 KB (with 0.5 KB used by bootloader)
• SRAM 2 KB
• EEPROM 1 KB
• CPU Clock Speed Up to 20 MHz (16 MHz on Arduino UNO)
• Instruction Set RISC (Reduced Instruction Set Computer)
• 􀀀􀀀 I/O and Peripherals:
• • Digital I/O Pins: 23 general-purpose I/O lines
• • Analog Inputs: 6 channels of 10-bit ADC (Analog to Digital Converter)
• • PWM Channels: 6 PWM outputs (via timers)
• • Timers/Counters: o 2 × 8-bit Timers (Timer0, Timer2)
• o 1 × 16-bit Timer (Timer1)
• USART: 1 (Universal Synchronous/Asynchronous Receiver/Transmitter)
• • SPI Interface: 1
• • I2C/TWI Interface: 1 (Two Wire Interface)
• • Watchdog Timer: With separate on-chip oscillator
• • External/Internal Interrupts: 2 external, multiple internal
• Special Features:
• • ADC Resolution: 10-bit, up to 76.9 kSPS (samples per second)
• • Power-Saving Modes: Idle, ADC Noise Reduction, Power-down, Power-save, Standby, and Extended
Standby
• • Brown-out Detection: Yes, programmable levels
• • In-System Programmable (ISP): Via SPI interface
• • Self-Programmable Flash: Yes (used for bootloaders)
• • Input Capture Unit (on Timer1): For frequency/pulse width measurement
• • On-Chip Oscillator: Internal 8 MHz, can use external crystal up to 20 MHz
• Block Diagram of ATmega328P Microcontroller
Here's a simplified sketch of the internal block diagram:
• 􀀀􀀀 Block Diagram Explanation:
• 1. CPU Core (AVR 8-bit)
• • Executes instructions, manages data flow between memory and peripherals.

• 2. Flash Memory (32 KB)


• • Stores program code (non-volatile).
• • In-system programmable.

• 3. SRAM (2 KB)
• • Stores temporary variables and stack during program execution.

• 4. EEPROM (1 KB)
• • Stores non-volatile user data (e.g., settings retained after power off).
• 5. I/O Ports (PORTB, PORTC, PORTD)
• • 23 general-purpose digital I/O pins.
• • Can be configured as input or output.

• 6. Timers/Counters
• • 2 × 8-bit (Timer0, Timer2)
• • 1 × 16-bit (Timer1)
• • Supports PWM, input capture, and output compare.

• 7. ADC (Analog to Digital Converter)


• • 6-channel, 10-bit resolution.
• • Converts analog input signals (e.g., from sensors) to digital values.
• Communication Interfaces
• • USART: Serial communication (used for USB via Arduino)
• • SPI: High-speed synchronous communication
• • I2C (TWI): Two-wire interface for peripherals like EEPROM, RTCs

• 9. Interrupt System
• • Handles both internal and external interrupts.
• • Improves responsiveness without polling.

• 10. Watchdog Timer


• • Resets the microcontroller if the system hangs or freezes.

• 11. Clock System


• • Internal 8 MHz RC oscillator
• • External crystal support (up to 20 MHz)
• • Controls timing and synchronization of all operations
• 12. Power Management
• • Includes various power-saving sleep modes: o Idle, Power-down, Power-save, etc.

• • Brown-out detection feature


• 6. With neat sketch, explain pin diagram of ATMega328/P Microcontroller
Pin Diagram of ATmega328P
• 􀀀􀀀 Pin Explanation by Function:
• 􀀀􀀀Power Pins:
• • VCC (Pin 7): Main power supply (typically +5V)
• • GND (Pins 8, 22): Ground
• • AVCC (Pin 20): Supply for ADC (should be connected to VCC)
• • AREF (Pin 21): Analog Reference for ADC (optional external voltage)

• 􀀀􀀀Oscillator Pins:
• • XTAL1 (Pin 9): Input to inverting oscillator amplifier
• • XTAL2 (Pin 10): Output from oscillator

• Used for connecting an external crystal/resonator (e.g., 16 MHz on Arduino UNO)


• 􀀀􀀀Digital I/O Pins (PORTB, PORTC, PORTD):
• • PORTD (Pins 2–7): Dig

You might also like