sanpai
Newbie level 6
Hey team ,
We are trying to interface the stepper motor with the LPC 1343 controller and we are facing quite a number of challenges in the same .
We haven got the ULN2003 ic for the driver but we used l293d and DS2003N in the place but no luck .
we have tried everything but haven been successful in getting the motor run.
below is the code for the same , please let us know where exactly the problem is surfacing .
Expecting an early reply from you folks
CODE :
The code is building fine but its not running the motor ,please let us know whether we have to use ULN2003 IC itself and not anything else .and please do review the code if there are anymistakes .
Thanks,
Santhosh Pai
We are trying to interface the stepper motor with the LPC 1343 controller and we are facing quite a number of challenges in the same .
We haven got the ULN2003 ic for the driver but we used l293d and DS2003N in the place but no luck .
we have tried everything but haven been successful in getting the motor run.
below is the code for the same , please let us know where exactly the problem is surfacing .
Expecting an early reply from you folks
CODE :
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 /* =============================================================================== Name : main.c Author : Santhosh Pai Version : Copyright : Copyright (C) Description : main definition =============================================================================== */ #ifdef __USE_CMSIS #include "LPC13xx.h" #include "clkconfig.h" #include "gpio.h" #include "config.h" #include "timer32.h" #endif #include <cr_section_macros.h> #include <NXP/crp.h> // Variable to store CRP value in. Will be placed automatically // by the linker when "Enable Code Read Protect" selected. // See crp.h header for more information __CRP const unsigned int CRP_WORD = CRP_NO_CRP ; // TODO: insert other include files here // TODO: insert other definitions and declarations here int main(void) { //considering an stepper motor with an step angle of 1.8 degree //setting the pins of p2.0 to p2.4 as outputs LPC_GPIO2->DIR |= 0x0000000F; enable_timer32(0);//enable timer 0 while(1)//anticlockwise rotation { LPC_GPIO2->DATA |= 0x00000006; LPC_GPIO2->DATA |= 0x00000003; LPC_GPIO2->DATA |= 0x00000009; LPC_GPIO2->DATA |= 0x0000000C; delay32Ms(0,100); } return 0 ; }
The code is building fine but its not running the motor ,please let us know whether we have to use ULN2003 IC itself and not anything else .and please do review the code if there are anymistakes .
Thanks,
Santhosh Pai
Last edited by a moderator: