Home > Uncategorized > Stepper Motor Controller Code Update

Stepper Motor Controller Code Update

October 15th, 2009

Just a quick update, I’ve added support for limit switches in the firmware. Enable them by specifying the associated pin, and if it’s active high or active low.  The preferred method is active low otherwise you need to add your own pulldown resistor if it’s active high.

// specify min-max sense pins or 0 if not used
// specify if the pin is to to detect a switch closing when
// the signal is high using the syntax
// #define MIN_X 12 | ACTIVE_HIGH
// or to sense a low signal (preferred!!!)
// #define MIN_Y 13 | ACTIVE_LOW
// active low is preferred as it will cause the AVR to use it's internal pullups to
// avoid bounce on the line.  If you want active_high, then you must add external pulldowns
// to avoid false signals.
#define ACTIVE_HIGH _BV(7)
#define ACTIVE_LOW  _BV(6)
#define MIN_X 0
#define MAX_X 0
#define MIN_Y 0
#define MAX_Y 0
#define MIN_Z 0
#define MAX_Z 0


  1. | #1

    Hi Reza – I wanted to introduce myself. I work for Texas Instruments MSP430 marketing – we’re fans of your site and wanted to tell you about a low power design contest we’re running that we think would be of interest for your readers. Please email me if you have any questions.

    Thanks, Russell


    Design MSP430 Ultra-Low Power Challenge – $10,000 In Prizes – http://DesignMSP430.com

    Show us what you’re made of by submitting your MSP430 eZ Designs and learning from other MSP430 users around the world. Choose from your favorite ultra-low power devices and tools – MSP430x1xx, MSP430F2xx, MSP430x4xx, MSP430F5xx, CC430Fxxxx. Submit your design in the MSP430 forum and learn more about the world’s lowest power MCU.

    Get your free silicon samples at http://www.ti.com/msp430
    Get your discounted development tools and software at AvnetExpress.com, and save through January 19, 2010:
    • Get a 25% tool discount on any MSP430 development tool through Avnet.
    • Get a 50% discount of the Code Composer Studio v4 software (a $500 value) through Avnet.

    MSP430 Design Contest:

    TI Microcontrollers on Facebook:

  2. admin
    | #2

    And I’m a fan of your products. Jacob B. over there is a great guy and has been a great supporter of my work as well. I don’t want release the design schematics for my MSP430 project — can I submit with the high level design? And do I get more points for using additional TI components in the design? 😉

  3. Pulkit
    | #3

    hi reza,
    i am a beginner, trying to drive stepper motor with MSP430. to start with i have chosen DRV 8811 as the suitable option as a stepper driver. Is their any other option or is it the best one?
    and i am also trying to generate PWM from MSP430, So would you please guide me through this.

  4. | #4

    UIROBOT Integrated Stepper Motor with Drives

  5. admin
    | #5

    I’m unfamiliar with the drv8811, why did you chose it? And I’ve not done pwm on the msp430 but I’m sure you should be able to find some information online or from the datasheet.

  6. | #6

    Hello Reza, I bumped across your project here. There is an open contest at http://www.43oh.com/2010/11/november-2010-the-msp430-project-of-the-month-contest-win-a-ti-chronos-watch/ and was hoping you could join with any of the MSP430 project you have. Thanks!

  1. No trackbacks yet.