I have a circuit that appears to have some noise problems related to stepper motors I'm driving. When I changed some switches to use pull up instead of pull down resistors, I get better results. Why?
I'm using a PCF8574 digital IO expander for some limit switches. It has an interrupt pin that goes LOW on any transition from the limit switches. The limit switches are mounted on an aluminum frame with no more than 3' of wire. Several of the limit switches are within 1 inch next to a stepper motor, being driven at no more than 2.2A. Digital inputs are pulled low via 10Kohm, and the limit switches connect digital signals to 3.3V. Logic voltage does not seem to be a problem. The stepper motor and limit switch lines are sometimes ran next to each other (no cable shielding).
When I power my stepper motors, the interrupt pin goes nuts (my uC resets interrupt via a read request). As in, the IO expander detects high->low and/or low->high transitions when none of the limit switches are being pressed. Limit switch state is correctly transmitted if I'm not powering the motors. Problem is only when motors are on. Stepper motor drivers have adequate capacitors (470uF), and all digital logic have small caps nearby.
When I change from a pull down to a pull up resistor on the digital inputs, the interrupt does not go crazy. Why do pullup resistors work better for my limit switches?