Maybe directly setting the pin improves timing issues?