We are having trouble using the MXP DIO pins as digital outputs.
After attempting to use HC-SR04 ultrasonic sensors on two different roboRIOs using the WPILib ultrasonic VIs, we found that the sensors work when plugged into the roboRIO onboard DIO, but not on the MXP DIO. We tried this on two different roboRIOs, both with the REV Robotics More Board.
After this, we tested the pins as inputs with a limit switch, which worked on both the MXP and onboard DIO pins.
However, when trying to use the MXP DIO as an output, the pin seems to stay low all the time regardless of the value set to it in code. We wired an LED and resistor between an onboard DIO pin and ground and were able to light it up with the DIO pin, but when trying on an MXP DIO using the exact same code with only the port value changed to MXP pins, the LED will not light.
When code is not running, the LED lights extremely faintly, which I think is due to the roboRIO’s internal pullups. After opening the port as an output in code, the pin goes to 0 volts and the LED goes out completely. However, attempting to set the pin high has no effect, and the pin stays at 0 volts.
The pin is indeed being pulled up to 3.3v when unconfigured, and when opened as an output goes to 0, but writing to the pin has no effect. We tried this on MXP DIO pins 0, 1, and 2. Using the roboRIO onboard pins, we can light up the LED brightly. The MXP pins work fine as inputs, but not outputs.
This further testing was only done on one roboRIO, but ultrasonic sensors will not work on the MXP on either of our roboRIOs, and do work on the onboard DIO. I believe this is because the code attempts to use an output for the “trigger” pin on the sensor, but setting the pin has no effect.
Has anyone successfully used the roboRIO MXP DIO as outputs? I find it hard to believe that something so commonly used simply doesn’t work.