Top Banner
By/Ramadan Ahmed
28
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Intro to micro controller (Atmega16)

By/Ramadan Ahmed

Page 2: Intro to micro controller (Atmega16)

What’s Embedded System ?

Examples on Embedded System

What’s Microcontroller?

MicroProcessor Vs. MicroController

Components of Microcontroller

Vendors of Microcontrollers

AVR History

AVR Categories

Why AVR ?

Atmega 16 and it’s Flavour

Page 3: Intro to micro controller (Atmega16)

Embedded System : it’s a special system with dedicated functionality.

Word “Embedded” come from the fact these system are hidden or a part of large system, also multiple embedded system can co-exist in one embedded system.

We can use microcontroller Or microprocessor to implement this system.

Page 4: Intro to micro controller (Atmega16)
Page 5: Intro to micro controller (Atmega16)

It’s a full computer on one chip but it’s resources are far from limited than of a desktop personal computer.

This single chip contain CPU, Non-volatile memory (ROM) , volatile memory (RAM), Timer & I/O port , so we can call it computer on chip.

Briefly, Micro-controller is Many IC into one IC.

Note:

There is NO micro-controller work alone in circuit it must interface with other peripherals like sensors, motors, LCD…….. etc.

Page 6: Intro to micro controller (Atmega16)
Page 7: Intro to micro controller (Atmega16)

Microprocessor

Central Processing Unit (CPU), is the brain of all computers and many household and electronic devices.

Just a CPU has to add externally memory, clock, input/output interfaces, timer and all other needed peripheral. This is the reason a microprocessor has so many pins.

Page 8: Intro to micro controller (Atmega16)

Micro-controller

Microcontroller is a computer dedicated to one or just a few tasks & no need to other peripherals.

Contain Memory ,timer and many, but can’t add peripherals to chip

Can do one task or few task

Microprocessor

Microprocessor is a general purpose computer which need other peripherals to operate.

No Memory , Timer & clock, but you can add this peripherals to it.

Can do many task.

Page 9: Intro to micro controller (Atmega16)

Microprocessor :It refers to central processing unit (CPU) of the

microcontroller.

It contain ALU (arithmetic logic unit),Control unit ,instruction Decoder ,some special register (Stack pointer , status register , program counter , etc.)

Volatile data memory (RAM) From it’s name, data is volatile.

used by the microcontroller for temporary data storage and erased if the device power went off

Microprocessor take long time to access it

Page 10: Intro to micro controller (Atmega16)

Non-Volatile data memory (ROM):

Opposite to RAM

Used to save the code and temporary data and doesn’t be erased if power went off.

It takes much longer than RAM to be accessed by CPU.

Timer Module:

Most microcontrollers have at least one timer/counter peripheral.

Timer/Counter modules are used to perform timing or counting operations in the controller.

Page 11: Intro to micro controller (Atmega16)

Interrupt Module:Interrupts enable the microcontroller to

monitor certain events in the background while executing and application program and react to the event if necessary pausing the original program.

This is all coordinated by the interrupt module.

Digital I/O Module:This mode allow to microcontroller to deal

with external world.

It can be used to drive actuators or sense signal from sensor.

Page 12: Intro to micro controller (Atmega16)

Serial Module:

This module deal with serial communication with external world.

Examples : ISP,USART,I2C(two wire interface).

Analog I/O Module:

This module responsible for reading or writing analog signals.

This module contain analog comparator and analog to digital converter.

Page 13: Intro to micro controller (Atmega16)

Vendor Families Derivatives

AVR Atmega16

8051 AT83EB5114

PIC PIC16F877A

HC12 MC9S12XEP100

V850 V850ES

TM4C TM4C123GH6PM

Page 14: Intro to micro controller (Atmega16)

AVR was developed in 1996 by Atmel cooperation.

The two person who developed AVR was Alf-egil & vegard wollan.

The name AVR came after the name of its developer Alf-egil bogen Vegard Wollan Riscmicrocontroller.

Also known by Advanced Virtual Risc.

First microcontroller to hit the market was AT90S1200 in the year 1997

Page 15: Intro to micro controller (Atmega16)

Tiny AVR

Less memory.

small size.

suitable only for simpler applications.

Mega AVR

These are the most popular ones.

having good amount of memory (up to 256 KB) higher number of inbuilt peripherals.

suitable for moderate to complex applications.

Xmega AVR

Used commercially for complex applications, which require large program memory and high speed.

Page 16: Intro to micro controller (Atmega16)

AVR micro-controllers are fast executes most of the instructions in single execution cycle.

AVRs are about 4 times faster than PICs.

They consume less power and can be operated in different power saving modes.

Free IDE.

Available in Egyptian market.

Page 17: Intro to micro controller (Atmega16)

8051 AVR PIC

Speed Slow Fast Moderate

Memory Small Large Large

Architecture CISC RISC RISC

ADC Not present Inbuilt Inbuilt

Timers Inbuilt Inbuilt Inbuilt

PWMs Not present Inbuilt Inbuilt

Page 18: Intro to micro controller (Atmega16)
Page 19: Intro to micro controller (Atmega16)
Page 20: Intro to micro controller (Atmega16)

ATmega16: Operating frequency range is 0 – 16 MHz .

ATmega16L: Operating frequency range is 0 – 8 MHz .

If we are using a crystal of 8 MHz = 8 x 106 Hertz = 8 Million cycles, then AVR can execute 8 million add

instructions per second.

Page 21: Intro to micro controller (Atmega16)

What’s Register ?

It’s an electronic circuit that can memorize the state of one byte or more.

Page 22: Intro to micro controller (Atmega16)

Register can be used to control µc also it make µc faster and can do many task in few milliseconds.

µc consists of many register like :

DDRx,PORTx,PINx.

SREG (Status I/O register).

MCUCR (MCU Control Register).

TCCR0 (Timer/Counter Control Register).

Page 23: Intro to micro controller (Atmega16)

I/O Ports

ATmega16 has four (PORTA, PORTB, PORTC and PORTD) 8-bit input-output ports.

Timers/Counters

ATmega16 consists of two 8-bit and one 16-bit timer/counter.

Watchdog Timer

Present with internal oscillator. Watchdog timer continuously monitors and resets the controller if the code gets stuck at any execution action for more than a defined time interval.

ADC Interface

ATmega16 is equipped with an 8 channel ADC with a resolution of 10-bits.

Page 24: Intro to micro controller (Atmega16)

Analog Comparator

The Analog Comparator compares the input values of two analog signals.

Interrupt Unit

Consists of 21 interrupt sources out of which four are external. The remaining are internal interrupts which support the peripherals like USART, ADC, Timers etc.

USART

Universal Synchronous and Asynchronous Receiver and Transmitter interface is available for interfacing with external device capable of communicating serially (data transmission bit by bit).

Page 25: Intro to micro controller (Atmega16)

TWI(Two Wire Interface )

Also called Inter-integrated Circuits can be used to set up a network of devices, many devices can be connected over TWI interface forming a network, the devices can simultaneously transmit and receive and have their own unique address.

SPI (Serial Peripheral Interface)

Used for serial communication between two devices on a common clock source.

ISP(In System Programmable )

Flash Memory which can be programmed without removing the IC from the circuit.

Page 26: Intro to micro controller (Atmega16)
Page 27: Intro to micro controller (Atmega16)

http://maxembedded.com/

http://extremeelectronics.co.in/

http://www.embedds.com/avr-tutorials/

http://avr-tutorials.com/

http://www.instructables.com/

Page 28: Intro to micro controller (Atmega16)