I will have a look at tone() presuming it likely makes a nice square wave.
But just to clarify, my issue isn’t quite that I am not achieving exactly 2khz. It is that with the photon my stepper motor seems to max out at much much lower speed than expected where as on the Arduino it runs as expected with the same code. As such I was presuming I was “loosing” pulses when the code was run through the photon.
Or else its my 3v issue.