Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

EX NO 1A : STEPPER MOTOR CONTROL IN ARM PROCESSOR

Aim : To verify and Validate the stepper motor control by using open source software Embest IDE and Flash magic in ARM Processor.

Apparatus Required : ARM Processor kit Adapter USB Port 1 1

THEORY : The ARM TDMI processor is a member of the ARM family of general purpose 32 bit microprocessor. The ARM family offers high Performance for low power Consumption. The ARM Architecture is based on RISC Principles. Its instruction set and related decode mechanism are much simpler than CISC design. This simplicity gives

A High instruction throughput. An excellent real time interrupt response. A small & cost effective Procedure : Type the program in notepad and save it in the folder along with the including files. Open the software Embest IDE and select the new workspace in file menu. Select add files to folder and open the program and save it. All the settings should be changed in the project dialog box. Switch on the kit and rebuild the program. Open the software Flash Magic and Browse the Program and click start. Change the Switch position and reset button. The output will be analyzed in the kit.

/***************************************** /* Program to drive a stepper motor /****************************************/

#include "LPC214X.H"

void InitializeIO(void);

int main (void) { unsigned char a; unsigned int b; long c,d; InitializeIO(); while(1) { //Initialize the I/O lines

for(d=0;d<100;d++) { // Rotate clock wise b=0x6666; for(a=0;a<4;a++) { IOPIN1 = (b & 0xff00) << 8 ; IOCLR0 = 0x00400000; // Clear A3

IOSET0 = 0x00400000; for(c=0;c<0xa000;c++); b = b << 1; one

// Set A3 // Delay // Shift left side

} } for(d=0;d<100;d++) { // Rotate counter clock wise b=0x6666; for(a=0;a<4;a++) { IOPIN1 = (b & 0xff00) << 8 ; IOCLR0 = 0x00400000; IOSET0 = 0x00400000; for(c=0;c<0xa000;c++); b = b >> 1; side one } } } } // Clear A3 // Set A3 // Delay // Shift right

void InitializeIO(void)

{ IODIR0 = 0x00580000; IODIR1 = 0x00ff0000; IOCLR0 = 0x00580000; IOSET0 = 0x00180000; }

void __gccmain() {

Result : Thus the Stepper motor has been verified and validated by using open source software Embest IDE and magic in ARM processor.

You might also like