Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help to Control speed of the Motor using PWm for LPC2378

Status
Not open for further replies.

nagarajanj21

Member level 1
Joined
Aug 24, 2010
Messages
37
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Chennai, INDIA
Activity points
1,492
i need help ho to calculate the duty cycle of the PWm in LPC2378(explain it breifly) and i have use the IR sensor for motor to rotate motor i clock and anticlock direction... how to do this..



thanks in advance.... wish u a HAPPY NEW year
 

first u will have to tell me that u have single face motor or three,i can help u because i have worked to much with pwm technology in picmicrocontroler and i can make remote control also
 

i am using 12 DC motor with driver... i need how to stop and rotate clock wise and anti clock wise directions... sorry for late reply...


thanks in advance
 

#include <LPC23xx.H> /* include for LPC23xx */

static void PWMInit(){
/* considering LPC2387 */
/* Select PWM1.2 output on P1.20 */
PINSEL3 |= (0x2 << 8);

/* reset PWM counter */
PWM1TCR = 0x02;

/* setup match control to reset on MR0 */
PWM1MCR = 0x02;

/* select single edge for PWM1.2 and enable PWM1.2 o/p */
PWM1PCR = 1 << 10;

/* setup PWM period */
PWM1MR0 = 100;

/* setup PWM duty cycle (50%) */
PWM1MR2 = 50;

/* start counter and enable PWM */
PWM1TCR = 0x81;

/* enable LER */
PWM1LER = 0x04;
}

int main(){
PWMInit();
while(1);
}
 

i already did that above coding... but i what i want is to rotate motor reversly as well as control the speed of motor using IR sensor...............
 

i cant interface motor directy with the processor. thats why i use driver ckt. just for giving data to the motor...
 

If i put
PWM1MR0 =0x100 and PWM1MR2=50 its not working.... instead i Put

PWM1MR0 = 12000000/500; and PWM1MR2 = PWM1MR0/2 mans its working...
 

If i put
PWM1MR0 =0x100
PWM1MR2=50 ------------> its not working wave for PWm is not generated....

instead i Put

PWM1MR0 = 12000000/500;
PWM1MR2 = PWM1MR0/2 its working...


why u put PWM1MR0 = 100;
PWM1MR2 = 50;


explain me it detail.....
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top