0% found this document useful (0 votes)
166 views

Relay and AVR Atmel Atmega 16

Robo India presents the working and concept of electro mechanical switch Relay. It also explains how to use it with AVR family's microcontroller Atmel Atmega 16.

Uploaded by

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

Relay and AVR Atmel Atmega 16

Robo India presents the working and concept of electro mechanical switch Relay. It also explains how to use it with AVR family's microcontroller Atmel Atmega 16.

Uploaded by

Robo India
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Relay and AVR

Atmel
Atmega16

Robo India
http://roboindia.c

INPUT/OUTPUT

PORTS

Atmega16 have total of 40 pins


32 I/O pins..
PORT
PORT
PORT
PORT

A
B
C
D

=
=
=
=

8 Pins
8 Pins
8 Pins
8 Pins

I/O PORT REGISTER

Port
X
DDRX

PORTX

PINX

NOTE:- X is the name of port


and it can
be A, B, C or D .

USES OF REGISTER
DDRX For setting the direction i.e. Input
or output.
PORTX For setting output value of port.
PINX For reading data available in port.
NOTE:- X is the name of port and it can be
A,
B, C or D .

DEFINING PORT
(DATA DIRECT REGISTER)
DDRX= 0xFF; (O/P-Port)
DDRX= 0x00; (I/P-Port)
or
DDRX = 0b 1 1 1 1 1 1 1 1 ; (O/PPort)
DDRX = 0b 0 0 0 0 0 0 0 0 ; (I/PPort)
NOTE:- X is the name of port and it
can
be A, B, C or D .

CONDITION AND LOOP


1.If
if ( conditions )
{ code to be executed }
2.For loop
for(start ; condition ; step)
{code to be executed}
3.While loop
while( Condition)
{ code to be executed }

ELECTRO
MECHANIC
AL
SWITCHIN
G

ELE. MEC.
SWITCHING ?

RELAY
Qn. What is RELAY

ANS. RELAY is a electromechanical


switch
which
use
ELECTROMAGNET for switching
operations.

RELAY

#include <avr/io.h>
#include <util/delay.h>

RELAY

#include <avr/io.h>
#include <util/delay.h>

THANKS & REGARDS


TEAM ROBO INDIA

To share your views and queries please


write usWebsite: http://roboindia.com
Email- [email protected]

You might also like