pradeep23
Member level 5

how to interface dc motor with 8051.....i want to use the concept of PWM ..........I don't know how to use that can any one please tell me how to program for that ....or please provide any circuits for that
- - - Updated - - -
#include <reg52.h> /* special function register declarations */
/* for the intended 8051 derivative */
#include <stdio.h> /* prototype declarations for I/O functions */
//L293D Pin Defines
sbit E1 = P2^0;
sbit I1 = P2^1;
sbit I2 = P2^2;
void Delay(void); //Function prototype declaration
void main (void) {
E1 = 1; //Set E1 pin High to Enable Channel of L293D
while(1) //End less while so that program never ends
{
//Rotate in One Direction
I1 = 0;
I2 = 1;
Delay();
Delay();
Delay();
Delay();
//Rotate in Other Direction
I1 = 1;
I2 = 0;
Delay();
Delay();
Delay();
Delay();
}
}
void Delay(void)
{
int j;
int i;
for(i=0;i<10;i++)
{
for(j=0;j<10000;j++)
{
}
}
}
- - - Updated - - -
...............
- - - Updated - - -
i am using this circuit only ..........
- - - Updated - - -
and programs
- - - Updated - - -
for the above circuits....
- - - Updated - - -
#include <reg52.h> /* special function register declarations */
/* for the intended 8051 derivative */
#include <stdio.h> /* prototype declarations for I/O functions */
//L293D Pin Defines
sbit E1 = P2^0;
sbit I1 = P2^1;
sbit I2 = P2^2;
void Delay(void); //Function prototype declaration
void main (void) {
E1 = 1; //Set E1 pin High to Enable Channel of L293D
while(1) //End less while so that program never ends
{
//Rotate in One Direction
I1 = 0;
I2 = 1;
Delay();
Delay();
Delay();
Delay();
//Rotate in Other Direction
I1 = 1;
I2 = 0;
Delay();
Delay();
Delay();
Delay();
}
}
void Delay(void)
{
int j;
int i;
for(i=0;i<10;i++)
{
for(j=0;j<10000;j++)
{
}
}
}
- - - Updated - - -

- - - Updated - - -
i am using this circuit only ..........
- - - Updated - - -
and programs
- - - Updated - - -
for the above circuits....