changing output pin question on BS2
cdmarion
Posts: 2
Hello,
I'm trying to change the output pins 4,5,6 and 7 to 9,10,11 and 12 in the program below, I cant seem to translate the DIRB = %1111 binary number to assign the new pins. I've not seen any stepper programs for the BS2 use any pins except 4 thru 7. Any help would be greatly appreciated.
I'm using;[FONT=Tahoma,Bold][FONT=Tahoma,Bold]Program: SW21-EX27-Stepper_Control.BS2
[/FONT][/FONT][FONT=Tahoma,Bold][FONT=Tahoma,Bold][/FONT][/FONT]
This is out of the Stampworks manual.
Setup:
DIRB = %1111 ' make P4..P7 outputs
stpDelay = 5 ' set step delay
I'm trying to change the output pins 4,5,6 and 7 to 9,10,11 and 12 in the program below, I cant seem to translate the DIRB = %1111 binary number to assign the new pins. I've not seen any stepper programs for the BS2 use any pins except 4 thru 7. Any help would be greatly appreciated.
I'm using;[FONT=Tahoma,Bold][FONT=Tahoma,Bold]Program: SW21-EX27-Stepper_Control.BS2
[/FONT][/FONT][FONT=Tahoma,Bold][FONT=Tahoma,Bold][/FONT][/FONT]
This is out of the Stampworks manual.
Setup:
DIRB = %1111 ' make P4..P7 outputs
stpDelay = 5 ' set step delay
Comments
To change the output states, use OUTB = %____
9, 10, 11, 12 are in C and D (C is 8-11, D is 12-15)
DIRS = %000111100000000 makes 9 through 12 outs (the 0's = inputs). DIRH = %00011110 effects bits 15-8
You should use outputs in a nibble, don't straddle (viz 9-12)
Go with 8-11 or 12-15 and life will be less complicated.