Shop OBEX P1 Docs P2 Docs Learn Events
Interference when using BS2 microcontroller with 12V Stepper motor — Parallax Forums

Interference when using BS2 microcontroller with 12V Stepper motor

Geoff1Geoff1 Posts: 2
edited 2012-09-25 21:07 in BASIC Stamp
Hi there,

I'm using a 4-Phase / 12 Volt Unipolar Stepper Motor with the BS2 microcontroller and have got it working perfectly by itself with my program.

I tried to put it inside another program including a timer/clock and an alarm. The clock is supposed to reach a certain time and then sound the alarm and rotate the motor by one revolution.
It doesn't work as the motor seems to receive some sort of interference, likely from the clock. The motor vibrates and stutters when it is not supposed to be active. Notably, the motor seems to react more when I press the buttons on the LCD screen to set the alarm time. Any thoughts on what the problem may be and how it can be resolved?

Cheers,

Geoff1

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-09-23 21:13
    You will need to post your program as an attachment to a message (don't just cut & paste it).

    Most likely your program is too busy with either the clock or LCD buttons to get the timing right for the stepper motor.
  • Geoff1Geoff1 Posts: 2
    edited 2012-09-25 01:21
    Pill_dispense.bs2

    Here is the file attached.

    Just a guess, does it matter if both are defined as OUTB?

    LcdBusOut VAR OUTB
    Phase VAR OUTB ' phase control outputs

    Cheers
    Geoff
  • Mike GreenMike Green Posts: 23,101
    edited 2012-09-25 21:07
    Sure it matters if both are defined as OUTB. That means you're using the same I/O pins for two different functions. That would be ok if the two functions can share the same I/O pins. A parallel LCD interface can share I/O pins with something else because there's an additional enable line (E). The LCD ignores the bus pins if the enable line is low. The stepper motor phase outputs probably don't have an enable / disable line, so any use of the LCD will affect the stepper. You'll have to change the I/O pins around so the stepper has its own set of 4 pins.
Sign In or Register to comment.