SlideShare a Scribd company logo
1 of 20
Apeejay Stya University
Department of Electronics and Communication Engineering
Course: Embedded System and Design ETEC-210
Project REPORT
Submitted by:
BANZADIO SALAZAKU asu2013010100016
Acknowledgment
I am truly thankfulto all the faculties who imparted the lectures on various
subjects/topics and took us to the plant in a guided study visitalong with detailed
explaining about the plant and machinery. An Electronics studentmainly focuses
on practical applications of concepts learned projects like this one provideus with
an ideal opportunity to do the same.
Last but not least, a big thanks to all our family members and friends, for timely
cooperation and supportextended to us all the way.
INDEX
S. No. content
1. Overview of Embedded Systems
2. Introduction to Atmega16 microcontroller
3. Analog to Digital converter
4. Timers in Atmega16
6. LCD Interfacing
7 Program
Introduction:-
Embedded system is a scaled down computersystem which is designed to
perform a specific taskor operation. The whole system is embedded into
an appliance. This reduces human effortto a great extent. A single chip
contains both hardware and software.
Some important things to note about embedded systems:
1. Once an embedded hardware is programmed fora certain task, it is
used foreverfor the same task. Changing the firmware afterwards is not
possible.
2. Such systems are limited in computational resources like memory, CPU
processing speed,I/O facilities but are still capable of performing the task
given to them very efficiently.
3. Embeddedsystems can also be having a reduced functionality version
of operating system called RTOS (Real Time Operating System) for highly
specialized applications.
4. Interacts with physical elements in our environment, viz. controlling and
driving a motor, sensing temperature, etc.
EMBEDDED SYSTEM IN DAILY LIFE
Digital Clock Traffic Light
DVD Player Smart Phones
2. MICROCONTROLLER
A Microcontroller is a programmabledigital processor with necessary peripherals.
Both microcontrollers and microprocessors arecomplexsequential digital circuits
meant to carry outjob according to the program/ instructions.
ATMEGA16 MICROCONTROLLER:
 We will be working on Atmega16 microcontroller,which is a 40-pin IC and
belongs to the MegaAVR category of AVR family.
 Some of the features of Atmega16 are:
 16KB of Flash memory
 1KB of SRAM
 512 Bytes of EEPROM
 Available in 40-Pin DIP
 8- Channel 10-bit ADC
 Two 8-bit Timers/Counters
 One 16-bit Timer/Counter
 4 PWM Channels
 Serial USART
 Digital to Analog Comparator
PIN DIAGRAM
I/O PORTS
InputOutputfunctions are set by Three Registers for each PORT.
• DDRX ‐‐‐‐>Sets whether a pin is Inputor Outputof PORTX.
• PORTX ‐‐‐> Sets the OutputValue of PORTX.
• PINX ‐‐‐‐‐>Reads the Value of PORTX.
(WhereX= A, B, C or D)
DDRX (Data DirectionRegister)
Now to make a pin act as I/O we set its corresponding bitin its DDRregister.
• To make Inputset bit 0
• To make Outputset bit 1
PORTX(PORTXData Register)
 If a pin is set to be output, then by setting bit 1 wemake output High that
is +5V and by setting bit 0, make output Low that is 0V.
 If a pin is set to be input, then by setting its corresponding bit in PORTX
register will make it as follows, Set bit 0 ‐‐‐> Tri‐Stated Set bit 1 ‐‐‐> Pull Up.
 PORTX ‐‐‐‐> to set value of PORTX with a byte.
 PORTX.y ‐‐>to set value of yth pin of PORTX with a bit (works only with
CVAVR).
PINX (Data ReadRegister) This register is used to read the value of a PORT. If a
pin is set as input then corresponding biton PINregister is,
• 0 for Low Inputthat is V < 2.5V
• 1 for High Inputthat is V > 2.5V (Ideally, butactually 0.8 V ‐ 2.8 V is error zone!)
• PINX ‐‐‐‐>Read complete value of PORTX as a byte.
• PINX.y ‐‐>Read yth pin of PORTX as a bit (works only with CVAVR).
SOFTWARE
The softwarewhich supportthis hardwareand can communicate with micro
controller using this circuit is-
• AVRStudio 4
3. Analog to Digital Converters
 Microcontroller understands only digital language.
 To convert the analog output from the sensors to digital we
need ADC.
 In AVR family of microcontroller we have inbuilt ADC on
PORTA. Each pin in PORTA has an ADC circuit connected
behind it. Thus we have 8 channels of ADC.
 The resolution of ADC output is 10 bit i.e. the output from the
ADC is any number between 0 to 1023
ADC registers:
 The inbuilt ADC of AVR microcontroller have three register
which are used for configuring the ADC. They are:
 ADMUX: it is used for selecting the ADC pin to be used for
connecting the Analog sensors.Itis also used forsetting the
reference value of the ADC.
 ADSCRA:itis used forcontrolling the ADC e.g.when should
it start the conversion? Should it repeat the conversion?
Should interrupt be generated after the conversion is
complete? Etc.
 ADCH & ADCL: these are used for storing the ADC output
values. Both the registers are 8 bit wide and we require 10
bits for storing the ADC value. Thus the two registers are
used. The way of storing the ADC value is configured using
ADSCRA.
ADMUX
ADLAR:-This bit is setting the manner, the ADC result will be
stored in ADC data register.
ADLAR = 0
ADCH& ADCL
ADCSR
4. Timers in ATMega16
 In Atmega16, we have three timers:TIMER0 TIMER1 and
TIMER2
 Out of these, TIMER0 and TIMER2 are 8 bit timer, while
TIMER1 is a 16 bit timer.
 All the timers have three unique registers and two common
registers.
 TIMER1 has a special register, called ICR(Input Capture
Register).It has two channels(channel A and channel B).
 TIMER2 has a specialregister known as ASSR, which is used
two generate PWM using asynchronous clock.
Timer Registers
• Each timer has three registers. They are:
 TCCR(Timer Counter Control Register)
 TCNT(Timer Counter),
 OCR (Output Compare Register).
• Thus, three registers for TIMER0 are TCCR0, TCNT0 and
OCR0.
• Similarly for TIMER1 and TIMER2, we have TCCR1, TCNT1,
OCR1 and TCCR2, TCNT2 and OCR2.
• The three timers have two common registers. They are:
 TIMSK (Timer Interrupt Mask)
 TIFR (Timer Interrupt Flag Register
Register Function Description
• TCCR (Timer Counter Control Register): It is used for
configuring the timer i.e. modes and pre scale factor.
• TCNT: It stores the present value of the timer. It is used for
monitoring the status of the timer. After each incrementing in
the timer value, this register compares its value with the OCR
register value.
• OCR(Output Compare Register): It is used for setting the
required duty
Cycle
6. LCD INTERFACING
• LCD’s are all around us so liquid crystal displays are very useful in
these days.
• It is a kind of display that is made up of a special matter state formed
using liquid and crystal both , it’s a forth state of matter
• The most popular one is 16x2 LCD module.It has 2 rows & 16
columns. The intelligent displays are two types:
 Text Display
 Graphics Display
PIN DESCRIPTION
Figure 4.1: pin configuration for 16 X 2 LCD
 8 data pins D7:D0
Bi-directional data/command pins. Alphanumeric characters are sent in
ASCII format.
 RS: Register Select
RS = 0 -> Command Registeris selected
RS = 1 -> Data Registeris selected
 R/W: Read or Write
0 -> Write, 1 -> Read
 E: Enable (Latch data)
Used to latch the data present on the data pins.
A high-to-low edge is needed to latch the data.
 VEE: contrastcontrol.
 VDD & VSS: Power supply
VDD= +5V
VSS=G
Program
Program /*-***********************************************************/
//----------------------9 Project9: Stop Watch-----------------------------
///////////lcd at port b,keypaid at porta(0-3) and portd(0-3)//////////////////-
*****************************************************************************
#include<avr/io.h>
#define F_CPU8000000UL
#include<util/delay.h>
#define lcd PORTB
#define rs 0
#define rw 1
#define en 2
void lcd_init();
void lcd_command(unsigned char);
void lcd_data(unsigned char);
void lcd_string(unsigned char *str);
void lcd_number(unsigned int);
int main()
{
unsigned char d,i;
unsigned char hr,min,sec,dec_sec;
DDRB = 0XFF;
DDRA = 0X00;
DDRD = 0XFF;
PORTA = 0XFF;
PORTD = 0X00;
lcd_init();
lcd_command(0x81);
lcd_string("i3 - Stopwatch");
while(1)
{
for(hr=0;hr<60;hr++)
for(min=0;min<60;min++)
for(sec=0;sec<60;sec++)
for(dec_sec=0;dec_sec<60;)
{
if(~PINA&0B00000001)
{
hr=0;min=0;sec=0;dec_sec=0;
}
if(~PINA&0B00000010)
{
here:
if(~PINA&0B00000100)
{
goto next;
}
goto here;
}
next:
lcd_command(0xc4);
lcd_number(hr);
lcd_command(0xc5);
lcd_data(':');
lcd_command(0xc7);
lcd_number(min);
lcd_command(0xc8);
lcd_data(':');
lcd_command(0xca);
lcd_number(sec);
lcd_command(0xcb);
lcd_data(':');
lcd_command(0xcd);
lcd_number(dec_sec);
_delay_ms(80);
dec_sec +=10
}
}
return 0;
}
//*****************************************SUBROTINE*********************
***************************
void lcd_init()
{
lcd_command(0x02);
lcd_command(0x28);
lcd_command(0x06);
lcd_command(0x0c);
}
void lcd_command(unsigned char com)
{
lcd = com & 0xF0; //send higher bit
lcd &= ~(1<<rs); //rs =0
lcd &= ~(1<<rw); //rw =0
lcd |=(1<<en); //en =1
_delay_ms(1);
lcd &= ~(1<<en); //en =0
_delay_ms(1);
lcd = (com<<4)& 0xF0; //send lower bit
lcd &= ~(1<<rs); //rs =0
lcd &= ~(1<<rw); //rw =0
lcd |=(1<<en); //en =1
_delay_ms(1);
lcd &= ~(1<<en); //en =0
_delay_ms(1);
}
void lcd_data(unsigned char value)
{
lcd =value & 0xF0; //send higher bit
lcd |= (1<<rs); //rs =1
lcd &= ~(1<<rw); //rw =0
lcd |=(1<<en); //en =1
_delay_ms(1);
lcd &= ~(1<<en); //en =0
_delay_ms(1);
lcd =(value<<4) & 0xF0; //send lower bit
lcd |= (1<<rs); //rs =1
lcd &= ~(1<<rw); //rw =0
lcd |=(1<<en); //en =1
_delay_ms(1);
lcd &= ~(1<<en); //en =0
_delay_ms(1);
}
void lcd_string(unsigned char *str)
{
char i=0;
while(str[i]!='0')
{
lcd_data(str[i]);
i++;
}
}
void lcd_number(unsigned int value)
{
unsigned int d=0;
lcd_command(0x04); //auto decrementmode
d=value%10;
lcd_data(d+48);
value=value/10;
d=value%10;
lcd_data(d+48);
lcd_command(0x06); //auto increment mode
}
//************************************END************************************
**************
Projects done
Minor Project
 Project 1: Digital Clock

More Related Content

What's hot

PLC basic concepts
PLC  basic conceptsPLC  basic concepts
PLC basic conceptsYasir Hashmi
 
home automation using ARM7 controller
home automation using ARM7 controllerhome automation using ARM7 controller
home automation using ARM7 controllerDHANAJI BURUNGALE
 
Wireless Bomb Disposal Robot
Wireless Bomb Disposal RobotWireless Bomb Disposal Robot
Wireless Bomb Disposal RobotAbhishek Gupta
 
Controlling Home Appliances Using Voice
 Controlling Home Appliances Using Voice Controlling Home Appliances Using Voice
Controlling Home Appliances Using VoiceEdgefxkits & Solutions
 
Instrumentation and Measurements MCQ - 6.pdf
Instrumentation and Measurements MCQ - 6.pdfInstrumentation and Measurements MCQ - 6.pdf
Instrumentation and Measurements MCQ - 6.pdfEngineering Funda
 
8255:ppi & 8259:pic
8255:ppi & 8259:pic 8255:ppi & 8259:pic
8255:ppi & 8259:pic Adarsh Patel
 
Accident detection
Accident detection Accident detection
Accident detection Samana Rao
 
Password based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final reportPassword based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final reportChinaraja Baratam
 
Automatic water level controller
Automatic water level controllerAutomatic water level controller
Automatic water level controllerGeetha Smiley
 
Bluetooth based home automation using Arduino UNO
Bluetooth based home automation using Arduino UNOBluetooth based home automation using Arduino UNO
Bluetooth based home automation using Arduino UNOparameshwar koneti
 
My Final Year Project - Individual Control Home Automation System
My Final Year Project - Individual Control Home Automation SystemMy Final Year Project - Individual Control Home Automation System
My Final Year Project - Individual Control Home Automation SystemMichael Olafusi
 
Rain Alarm Using 555 Timer IC with Report
Rain Alarm Using 555 Timer IC with ReportRain Alarm Using 555 Timer IC with Report
Rain Alarm Using 555 Timer IC with ReportUzair Ahmad
 
Bluetooth based Home Automation
Bluetooth based Home AutomationBluetooth based Home Automation
Bluetooth based Home AutomationJagannath Kartik
 

What's hot (20)

PLC basic concepts
PLC  basic conceptsPLC  basic concepts
PLC basic concepts
 
B.Tech Final Year Project
B.Tech Final Year ProjectB.Tech Final Year Project
B.Tech Final Year Project
 
home automation using ARM7 controller
home automation using ARM7 controllerhome automation using ARM7 controller
home automation using ARM7 controller
 
Embedded Systems Projects Ideas
Embedded Systems Projects IdeasEmbedded Systems Projects Ideas
Embedded Systems Projects Ideas
 
Arduino Based Parking Lot System
Arduino Based Parking Lot SystemArduino Based Parking Lot System
Arduino Based Parking Lot System
 
Wireless Bomb Disposal Robot
Wireless Bomb Disposal RobotWireless Bomb Disposal Robot
Wireless Bomb Disposal Robot
 
Controlling Home Appliances Using Voice
 Controlling Home Appliances Using Voice Controlling Home Appliances Using Voice
Controlling Home Appliances Using Voice
 
Instrumentation and Measurements MCQ - 6.pdf
Instrumentation and Measurements MCQ - 6.pdfInstrumentation and Measurements MCQ - 6.pdf
Instrumentation and Measurements MCQ - 6.pdf
 
8255:ppi & 8259:pic
8255:ppi & 8259:pic 8255:ppi & 8259:pic
8255:ppi & 8259:pic
 
Accident detection
Accident detection Accident detection
Accident detection
 
Intel 8051 Programming in C
Intel 8051 Programming in CIntel 8051 Programming in C
Intel 8051 Programming in C
 
Password based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final reportPassword based door lock system using 8051 microcontroller final report
Password based door lock system using 8051 microcontroller final report
 
Automatic water level controller
Automatic water level controllerAutomatic water level controller
Automatic water level controller
 
Introduction plc
Introduction plcIntroduction plc
Introduction plc
 
Bluetooth based home automation using Arduino UNO
Bluetooth based home automation using Arduino UNOBluetooth based home automation using Arduino UNO
Bluetooth based home automation using Arduino UNO
 
My Final Year Project - Individual Control Home Automation System
My Final Year Project - Individual Control Home Automation SystemMy Final Year Project - Individual Control Home Automation System
My Final Year Project - Individual Control Home Automation System
 
Cell phone jammer ppt
Cell phone jammer pptCell phone jammer ppt
Cell phone jammer ppt
 
Rain Alarm Using 555 Timer IC with Report
Rain Alarm Using 555 Timer IC with ReportRain Alarm Using 555 Timer IC with Report
Rain Alarm Using 555 Timer IC with Report
 
ANTI THEFT PPT
ANTI THEFT PPTANTI THEFT PPT
ANTI THEFT PPT
 
Bluetooth based Home Automation
Bluetooth based Home AutomationBluetooth based Home Automation
Bluetooth based Home Automation
 

Viewers also liked

project report on embedded system
project report on embedded systemproject report on embedded system
project report on embedded systemram avtar
 
Persistence of Vision Display
Persistence of Vision DisplayPersistence of Vision Display
Persistence of Vision DisplayUday Wankar
 
Timer & Interrupt Atmega16
Timer & Interrupt Atmega16Timer & Interrupt Atmega16
Timer & Interrupt Atmega16Ramadan Ramadan
 
Điều khiển động cơ sử dụng atmega16
Điều khiển động cơ sử dụng atmega16Điều khiển động cơ sử dụng atmega16
Điều khiển động cơ sử dụng atmega16Pham Hoang
 
How PSTN phone works?
How PSTN phone works?How PSTN phone works?
How PSTN phone works?mahipal9
 
Rfid based toll tax collection system 3 (repaired)
Rfid based toll tax collection system 3 (repaired)Rfid based toll tax collection system 3 (repaired)
Rfid based toll tax collection system 3 (repaired)KrishNa Patel
 
Serial Communication In Atmega 16
Serial Communication In Atmega 16Serial Communication In Atmega 16
Serial Communication In Atmega 16Suren Kumar
 
Project Report for Automated Guided Vehicle
Project Report for Automated Guided VehicleProject Report for Automated Guided Vehicle
Project Report for Automated Guided VehicleSOORAJ V R
 

Viewers also liked (9)

project report on embedded system
project report on embedded systemproject report on embedded system
project report on embedded system
 
Persistence of Vision Display
Persistence of Vision DisplayPersistence of Vision Display
Persistence of Vision Display
 
Timer & Interrupt Atmega16
Timer & Interrupt Atmega16Timer & Interrupt Atmega16
Timer & Interrupt Atmega16
 
Điều khiển động cơ sử dụng atmega16
Điều khiển động cơ sử dụng atmega16Điều khiển động cơ sử dụng atmega16
Điều khiển động cơ sử dụng atmega16
 
final report
final reportfinal report
final report
 
How PSTN phone works?
How PSTN phone works?How PSTN phone works?
How PSTN phone works?
 
Rfid based toll tax collection system 3 (repaired)
Rfid based toll tax collection system 3 (repaired)Rfid based toll tax collection system 3 (repaired)
Rfid based toll tax collection system 3 (repaired)
 
Serial Communication In Atmega 16
Serial Communication In Atmega 16Serial Communication In Atmega 16
Serial Communication In Atmega 16
 
Project Report for Automated Guided Vehicle
Project Report for Automated Guided VehicleProject Report for Automated Guided Vehicle
Project Report for Automated Guided Vehicle
 

Similar to digital clock atmega16

Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and RoboticsNIT Raipur
 
Industrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsIndustrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsPallavi Bharti
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerRup Chowdhury
 
Microcontroller
MicrocontrollerMicrocontroller
MicrocontrollerSpitiq
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basicssagar Ramdev
 
ATmegaMicrocontrollerArchitecturenotes.pptx
ATmegaMicrocontrollerArchitecturenotes.pptxATmegaMicrocontrollerArchitecturenotes.pptx
ATmegaMicrocontrollerArchitecturenotes.pptxaartis110
 
Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller IJECEIAES
 
ELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECTELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECTvasav2204
 
electrical engineering project
electrical engineering projectelectrical engineering project
electrical engineering projectvasav2204
 
Embedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEmbedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEr. Raju Bhardwaj
 
how to generate sms
how to generate smshow to generate sms
how to generate smssumant reddy
 
PIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikarPIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikarGauravRaikar3
 
Embedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerEmbedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerAmandeep Alag
 

Similar to digital clock atmega16 (20)

Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and Robotics
 
Industrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsIndustrial training report of embedded system and robotics
Industrial training report of embedded system and robotics
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
 
Atmega16
Atmega16Atmega16
Atmega16
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
 
embedded system
embedded systemembedded system
embedded system
 
ATmegaMicrocontrollerArchitecturenotes.pptx
ATmegaMicrocontrollerArchitecturenotes.pptxATmegaMicrocontrollerArchitecturenotes.pptx
ATmegaMicrocontrollerArchitecturenotes.pptx
 
Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller
 
ELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECTELECTRICAL ENGINEERING PROJECT
ELECTRICAL ENGINEERING PROJECT
 
electrical engineering project
electrical engineering projectelectrical engineering project
electrical engineering project
 
Embedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower BotEmbedded Application : An Autonomous Robot or Line Follower Bot
Embedded Application : An Autonomous Robot or Line Follower Bot
 
how to generate sms
how to generate smshow to generate sms
how to generate sms
 
Badal sharma
Badal sharmaBadal sharma
Badal sharma
 
PIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikarPIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikar
 
Avr report
Avr reportAvr report
Avr report
 
Embedded system
Embedded  systemEmbedded  system
Embedded system
 
Embedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerEmbedded systems, 8051 microcontroller
Embedded systems, 8051 microcontroller
 
Assembler4
Assembler4Assembler4
Assembler4
 
Avr microcontroller
Avr microcontrollerAvr microcontroller
Avr microcontroller
 

More from Arcanjo Salazaku

sustainable development introduction, basics and importance
 sustainable development introduction, basics and importance sustainable development introduction, basics and importance
sustainable development introduction, basics and importanceArcanjo Salazaku
 
Speaker recognition on matlab
Speaker recognition on matlabSpeaker recognition on matlab
Speaker recognition on matlabArcanjo Salazaku
 
Summer Training Program Report On Embedded system and robot
Summer Training Program Report On Embedded system and robot Summer Training Program Report On Embedded system and robot
Summer Training Program Report On Embedded system and robot Arcanjo Salazaku
 

More from Arcanjo Salazaku (6)

Temperature Meter
Temperature MeterTemperature Meter
Temperature Meter
 
sustainable development introduction, basics and importance
 sustainable development introduction, basics and importance sustainable development introduction, basics and importance
sustainable development introduction, basics and importance
 
cop21 at paris
 cop21 at paris cop21 at paris
cop21 at paris
 
Speaker recognition on matlab
Speaker recognition on matlabSpeaker recognition on matlab
Speaker recognition on matlab
 
Traffic light using plc
Traffic light using  plcTraffic light using  plc
Traffic light using plc
 
Summer Training Program Report On Embedded system and robot
Summer Training Program Report On Embedded system and robot Summer Training Program Report On Embedded system and robot
Summer Training Program Report On Embedded system and robot
 

Recently uploaded

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 

Recently uploaded (20)

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 

digital clock atmega16

  • 1. Apeejay Stya University Department of Electronics and Communication Engineering Course: Embedded System and Design ETEC-210 Project REPORT Submitted by: BANZADIO SALAZAKU asu2013010100016
  • 2. Acknowledgment I am truly thankfulto all the faculties who imparted the lectures on various subjects/topics and took us to the plant in a guided study visitalong with detailed explaining about the plant and machinery. An Electronics studentmainly focuses on practical applications of concepts learned projects like this one provideus with an ideal opportunity to do the same. Last but not least, a big thanks to all our family members and friends, for timely cooperation and supportextended to us all the way.
  • 3. INDEX S. No. content 1. Overview of Embedded Systems 2. Introduction to Atmega16 microcontroller 3. Analog to Digital converter 4. Timers in Atmega16 6. LCD Interfacing 7 Program
  • 4. Introduction:- Embedded system is a scaled down computersystem which is designed to perform a specific taskor operation. The whole system is embedded into an appliance. This reduces human effortto a great extent. A single chip contains both hardware and software. Some important things to note about embedded systems: 1. Once an embedded hardware is programmed fora certain task, it is used foreverfor the same task. Changing the firmware afterwards is not possible. 2. Such systems are limited in computational resources like memory, CPU processing speed,I/O facilities but are still capable of performing the task given to them very efficiently. 3. Embeddedsystems can also be having a reduced functionality version of operating system called RTOS (Real Time Operating System) for highly specialized applications. 4. Interacts with physical elements in our environment, viz. controlling and driving a motor, sensing temperature, etc.
  • 5. EMBEDDED SYSTEM IN DAILY LIFE Digital Clock Traffic Light DVD Player Smart Phones 2. MICROCONTROLLER A Microcontroller is a programmabledigital processor with necessary peripherals. Both microcontrollers and microprocessors arecomplexsequential digital circuits meant to carry outjob according to the program/ instructions. ATMEGA16 MICROCONTROLLER:  We will be working on Atmega16 microcontroller,which is a 40-pin IC and belongs to the MegaAVR category of AVR family.  Some of the features of Atmega16 are:  16KB of Flash memory  1KB of SRAM  512 Bytes of EEPROM  Available in 40-Pin DIP  8- Channel 10-bit ADC  Two 8-bit Timers/Counters  One 16-bit Timer/Counter  4 PWM Channels  Serial USART
  • 6.  Digital to Analog Comparator PIN DIAGRAM I/O PORTS InputOutputfunctions are set by Three Registers for each PORT. • DDRX ‐‐‐‐>Sets whether a pin is Inputor Outputof PORTX. • PORTX ‐‐‐> Sets the OutputValue of PORTX. • PINX ‐‐‐‐‐>Reads the Value of PORTX. (WhereX= A, B, C or D) DDRX (Data DirectionRegister) Now to make a pin act as I/O we set its corresponding bitin its DDRregister. • To make Inputset bit 0 • To make Outputset bit 1 PORTX(PORTXData Register)  If a pin is set to be output, then by setting bit 1 wemake output High that is +5V and by setting bit 0, make output Low that is 0V.  If a pin is set to be input, then by setting its corresponding bit in PORTX register will make it as follows, Set bit 0 ‐‐‐> Tri‐Stated Set bit 1 ‐‐‐> Pull Up.  PORTX ‐‐‐‐> to set value of PORTX with a byte.
  • 7.  PORTX.y ‐‐>to set value of yth pin of PORTX with a bit (works only with CVAVR). PINX (Data ReadRegister) This register is used to read the value of a PORT. If a pin is set as input then corresponding biton PINregister is, • 0 for Low Inputthat is V < 2.5V • 1 for High Inputthat is V > 2.5V (Ideally, butactually 0.8 V ‐ 2.8 V is error zone!) • PINX ‐‐‐‐>Read complete value of PORTX as a byte. • PINX.y ‐‐>Read yth pin of PORTX as a bit (works only with CVAVR). SOFTWARE The softwarewhich supportthis hardwareand can communicate with micro controller using this circuit is- • AVRStudio 4 3. Analog to Digital Converters  Microcontroller understands only digital language.  To convert the analog output from the sensors to digital we need ADC.  In AVR family of microcontroller we have inbuilt ADC on PORTA. Each pin in PORTA has an ADC circuit connected behind it. Thus we have 8 channels of ADC.  The resolution of ADC output is 10 bit i.e. the output from the ADC is any number between 0 to 1023 ADC registers:  The inbuilt ADC of AVR microcontroller have three register which are used for configuring the ADC. They are:
  • 8.  ADMUX: it is used for selecting the ADC pin to be used for connecting the Analog sensors.Itis also used forsetting the reference value of the ADC.  ADSCRA:itis used forcontrolling the ADC e.g.when should it start the conversion? Should it repeat the conversion? Should interrupt be generated after the conversion is complete? Etc.  ADCH & ADCL: these are used for storing the ADC output values. Both the registers are 8 bit wide and we require 10 bits for storing the ADC value. Thus the two registers are used. The way of storing the ADC value is configured using ADSCRA. ADMUX ADLAR:-This bit is setting the manner, the ADC result will be stored in ADC data register. ADLAR = 0
  • 9. ADCH& ADCL ADCSR 4. Timers in ATMega16  In Atmega16, we have three timers:TIMER0 TIMER1 and TIMER2  Out of these, TIMER0 and TIMER2 are 8 bit timer, while TIMER1 is a 16 bit timer.
  • 10.  All the timers have three unique registers and two common registers.  TIMER1 has a special register, called ICR(Input Capture Register).It has two channels(channel A and channel B).  TIMER2 has a specialregister known as ASSR, which is used two generate PWM using asynchronous clock. Timer Registers • Each timer has three registers. They are:  TCCR(Timer Counter Control Register)  TCNT(Timer Counter),  OCR (Output Compare Register). • Thus, three registers for TIMER0 are TCCR0, TCNT0 and OCR0. • Similarly for TIMER1 and TIMER2, we have TCCR1, TCNT1, OCR1 and TCCR2, TCNT2 and OCR2. • The three timers have two common registers. They are:  TIMSK (Timer Interrupt Mask)  TIFR (Timer Interrupt Flag Register
  • 11. Register Function Description • TCCR (Timer Counter Control Register): It is used for configuring the timer i.e. modes and pre scale factor. • TCNT: It stores the present value of the timer. It is used for monitoring the status of the timer. After each incrementing in the timer value, this register compares its value with the OCR register value. • OCR(Output Compare Register): It is used for setting the required duty Cycle 6. LCD INTERFACING • LCD’s are all around us so liquid crystal displays are very useful in these days. • It is a kind of display that is made up of a special matter state formed using liquid and crystal both , it’s a forth state of matter • The most popular one is 16x2 LCD module.It has 2 rows & 16 columns. The intelligent displays are two types:  Text Display  Graphics Display
  • 12. PIN DESCRIPTION Figure 4.1: pin configuration for 16 X 2 LCD  8 data pins D7:D0 Bi-directional data/command pins. Alphanumeric characters are sent in ASCII format.  RS: Register Select RS = 0 -> Command Registeris selected RS = 1 -> Data Registeris selected  R/W: Read or Write 0 -> Write, 1 -> Read  E: Enable (Latch data) Used to latch the data present on the data pins. A high-to-low edge is needed to latch the data.  VEE: contrastcontrol.  VDD & VSS: Power supply VDD= +5V VSS=G
  • 13.
  • 14. Program Program /*-***********************************************************/ //----------------------9 Project9: Stop Watch----------------------------- ///////////lcd at port b,keypaid at porta(0-3) and portd(0-3)//////////////////- ***************************************************************************** #include<avr/io.h> #define F_CPU8000000UL #include<util/delay.h> #define lcd PORTB #define rs 0 #define rw 1 #define en 2 void lcd_init(); void lcd_command(unsigned char); void lcd_data(unsigned char); void lcd_string(unsigned char *str); void lcd_number(unsigned int); int main() { unsigned char d,i; unsigned char hr,min,sec,dec_sec; DDRB = 0XFF; DDRA = 0X00; DDRD = 0XFF; PORTA = 0XFF;
  • 15. PORTD = 0X00; lcd_init(); lcd_command(0x81); lcd_string("i3 - Stopwatch"); while(1) { for(hr=0;hr<60;hr++) for(min=0;min<60;min++) for(sec=0;sec<60;sec++) for(dec_sec=0;dec_sec<60;) { if(~PINA&0B00000001) { hr=0;min=0;sec=0;dec_sec=0; } if(~PINA&0B00000010) { here: if(~PINA&0B00000100) { goto next; } goto here; } next: lcd_command(0xc4); lcd_number(hr);
  • 17. void lcd_command(unsigned char com) { lcd = com & 0xF0; //send higher bit lcd &= ~(1<<rs); //rs =0 lcd &= ~(1<<rw); //rw =0 lcd |=(1<<en); //en =1 _delay_ms(1); lcd &= ~(1<<en); //en =0 _delay_ms(1); lcd = (com<<4)& 0xF0; //send lower bit lcd &= ~(1<<rs); //rs =0 lcd &= ~(1<<rw); //rw =0 lcd |=(1<<en); //en =1 _delay_ms(1); lcd &= ~(1<<en); //en =0 _delay_ms(1); } void lcd_data(unsigned char value) { lcd =value & 0xF0; //send higher bit lcd |= (1<<rs); //rs =1 lcd &= ~(1<<rw); //rw =0 lcd |=(1<<en); //en =1
  • 18. _delay_ms(1); lcd &= ~(1<<en); //en =0 _delay_ms(1); lcd =(value<<4) & 0xF0; //send lower bit lcd |= (1<<rs); //rs =1 lcd &= ~(1<<rw); //rw =0 lcd |=(1<<en); //en =1 _delay_ms(1); lcd &= ~(1<<en); //en =0 _delay_ms(1); } void lcd_string(unsigned char *str) { char i=0; while(str[i]!='0') { lcd_data(str[i]); i++; } } void lcd_number(unsigned int value) { unsigned int d=0; lcd_command(0x04); //auto decrementmode d=value%10; lcd_data(d+48);
  • 19. value=value/10; d=value%10; lcd_data(d+48); lcd_command(0x06); //auto increment mode } //************************************END************************************ **************
  • 20. Projects done Minor Project  Project 1: Digital Clock