metron9
04-27-2006, 08:21 PM
I have been away from programming for a few months and it seems I am just to foggy in the brain to get this proof of concept through my head.
I have a stepper motor from an automotive guage, it is a little white plastic one with 270 degrees of movement
The panel when operated turns on the stepper in a counter clockwise direction till it bangs against the pin so it knows it is at position 0.
The motor operates typically with I think is called an H bridge but I want to control it with 4 stamp pins.
270 ohms per coil
Pattern to rotate motor clockwise given pins
pin1---(coil1)---pin2
pin3---(coil2)---pin4
1=+---+---+---
2=--+---+---+-
3=-+---+---+--
4=---+---+---+
Time----.>>>
How do I flip flop say pins 12,13,14 and 15 from inputs on 3 pins and output on one pin and then rotate through the pattern.
I used 2 leds to see them blink for testing
Pin 15>+(LED1)-<pin14 when 15=high and 14 is input to sink current is lit
Pin15>-(lLED2)+<pin14 when 14 is high and 15 is input to sink current
Below is code that is not working using direction registers and code that works using the HIGH LOW commands
I guess I just need to understand the direction registers again but I have been putting in 15 hour days at work and I just cant seem to find enough time to work it out.
Anyway I misss interacting with folks on this board and the mind stimulation I get working with programming and chips.
' {$STAMP BS2}
' {$PBASIC 2.0}
notworking:
DIRD=%1000 'direction pin15 output and 14 input
OUTD=%1000 'make pin 15 high and pin 14 sinks the current
PAUSE 100
DIRD=%0100 'direction pin 15 =input and pin 14 =output
OUTD=%0100 'make pin 14 high and sink current with pin 15
PAUSE 100
goto notworking
'================================================= ======
' The code below works but is this the way to do it?
Xloop:
HIGH 15
LOW 14
PAUSE 100
LOW 15
HIGH 14
PAUSE 100
GOTO xloop
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
Post Edited (metron9) : 4/27/2006 1:24:04 PM GMT
I have a stepper motor from an automotive guage, it is a little white plastic one with 270 degrees of movement
The panel when operated turns on the stepper in a counter clockwise direction till it bangs against the pin so it knows it is at position 0.
The motor operates typically with I think is called an H bridge but I want to control it with 4 stamp pins.
270 ohms per coil
Pattern to rotate motor clockwise given pins
pin1---(coil1)---pin2
pin3---(coil2)---pin4
1=+---+---+---
2=--+---+---+-
3=-+---+---+--
4=---+---+---+
Time----.>>>
How do I flip flop say pins 12,13,14 and 15 from inputs on 3 pins and output on one pin and then rotate through the pattern.
I used 2 leds to see them blink for testing
Pin 15>+(LED1)-<pin14 when 15=high and 14 is input to sink current is lit
Pin15>-(lLED2)+<pin14 when 14 is high and 15 is input to sink current
Below is code that is not working using direction registers and code that works using the HIGH LOW commands
I guess I just need to understand the direction registers again but I have been putting in 15 hour days at work and I just cant seem to find enough time to work it out.
Anyway I misss interacting with folks on this board and the mind stimulation I get working with programming and chips.
' {$STAMP BS2}
' {$PBASIC 2.0}
notworking:
DIRD=%1000 'direction pin15 output and 14 input
OUTD=%1000 'make pin 15 high and pin 14 sinks the current
PAUSE 100
DIRD=%0100 'direction pin 15 =input and pin 14 =output
OUTD=%0100 'make pin 14 high and sink current with pin 15
PAUSE 100
goto notworking
'================================================= ======
' The code below works but is this the way to do it?
Xloop:
HIGH 15
LOW 14
PAUSE 100
LOW 15
HIGH 14
PAUSE 100
GOTO xloop
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
Post Edited (metron9) : 4/27/2006 1:24:04 PM GMT