You have no items in your shopping cart.

Subtotal: 0.00

How to Interface Stepper Motor with CY8C3866 PSOC3 Development Board

PSoc 3 Development kit

The PSoc 3 Development kit is specifically designed to help students to master the required skills in the area of embedded systems. The kit is designed in such way that all the possible features of the microcontroller will be easily used by the students. The kit supports FX2LP Programmer which is done through USB port.

Cypress CY8C3866 core (CY8C3866), PSoc 3 Development kit is proposed to smooth the progress of developing and debugging of various designs encompassing of speed 8-bit Microcontrollers. It integrates on board CAPSENSE BUTTONS, CAPSENSE LINEAR SLIDER, UART, ADC, DAC, Relay, Buzzer, Seven Segment, Serial EEPROM, Temperature Sensor LM35, Matrix Keypad, Switch, LED, Stepper Motor Driver, Traffic Light Controller, RTC, LCD & GLCD Display to create a stand-alone versatile test platform. User can easily engage in Development in this platform, or use it as reference to application Development.

Stepper Motor

A stepper motor is a brushless, synchronous electric motor that converts digital pulses into mechanical shaft rotation. Every revolution of the stepper motor is divided into a discrete number of steps, and the motor must be sent a separate pulse for each step.

Interfacing Stepper Motor

Fig. 1 shows how to interface the Stepper Motor to microcontroller. As you can see the stepper motor is connected with Microcontroller output port pins through a ULN2003 array. So when the microcontroller is giving pulses with particular frequency to ULN2003, the motor is rotated in clockwise or anticlockwise.

Fig. 1 Interfacing Stepper Motor to Microcontroller


Interfacing Stepper Motor with CY8C3866

We now want to control a stepper motor in CY8C3866 Development Board. It works by turning ON & OFF a four I/O port lines generating at a particular frequency.

TheCY8C3866 Development board has four numbers of I/O port lines, connected with I/O Port lines (P4.0 – P4.3) to rotate the stepper motor. ULN2003 is used as a driver for port I/O lines, drivers output connected to stepper motor, connector provided for external power supply if needed.

Pin Assignment with CY8C3866


Stepper Motor(5V)

CY8C3866 Lines

Stepper Motor PWR Select










Make switch SW28 to SM/RL label

marking position.


Circuit Diagram to Interface Stepper Motor

C Program to control stepper motor using CY8C3866


Title : Program to control stepper motor rotations


#include <device.h> void main() { uint8 i=0; STEPPER_Write(0x00); for(;;) { i=FOR_REV_Read(); if(i) // clockwise rotation { STEPPER_Write(0x08); CyDelay(25); STEPPER_Write(0x04); CyDelay(25); STEPPER_Write(0x02); CyDelay(25); STEPPER_Write(0x01); CyDelay(25); } else // anti-clockwise rotation { STEPPER_Write(0x01); CyDelay(25); STEPPER_Write(0x02); CyDelay(25); STEPPER_Write(0x04); CyDelay(25); STEPPER_Write(0x08); CyDelay(25); } } } /* [] END OF FILE */