In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Jim Fouch wrote: This may seem simple, but I was wondering what was the best way to clear the states of only 4 pins on a port w/o disturbing the others. In my project I'm using Port B (pins 1-3) for an A/D and also pins 4-7 to drive a stepper motor . Here is the code I'm using now... [code] SendMotorCommand: Read HalfSteps + StepIndex, Temp1 RB.7 = 0 RB.6 = 0 RB.5 = 0 RB.4 = 0 RB = RB or Temp1 Return RelaxMotor: RB.7 = 0 RB.6 = 0 RB.5 = 0 RB.4 = 0 Return HalfSteps: Data %00000000 Data %00010000 Data %00110000 Data %00100000 Data %01100000 Data %01000000 Data %11000000 Data %10000000 Data %10010000 Just wondering is there is a better way to address (clear) the states of only 4 pins on a port. Thanks, Jim[/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=105636 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)