Saturday, 12 November 2016

interfacing of motor in atmega16/32

#include<avr/io.h>

#include<util/delay.h>

 
 
void main()
{
DDRA=0XFF;

while(1)

{

PORTA=0x0a;
}
}



 




There are two types of motor generally used in embedded system:-

1.       DC motor

2.       Stepper motor

 

Commands for two DC motor:-

Forward = 10 10 = 0x0a

Backward = 01 01 = 0x05

Right move = 10 00 = 0x08

Left move = 00 10 = 0x02

Stop = 00 00 = 0x00

 

Using these commands operate two DC motors.

In proteus or hardware I need a motor driver to operate it that’s called L293D  in which 4 inputs and 4 outputs pins , 2 VCC pin , 4 pin for GND, 2 enable pin.  This is total 16 pin IC.

No comments:

Post a Comment