40X1 but plan on using 28x2 once it arrives
I want to send a square wave to a Steper motor driver and I need an accurate result.
I am using the following code:
I am sure there is a better way to skin this cat and I am looking for ideas.
I used a usb oscilloscope and measured the frequency generated vs what I want and the error is bad at the higher frequencies.
The attachment show the errors and the range I need acurate results (<1% error if possible)
I want to send a square wave to a Steper motor driver and I need an accurate result.
I am using the following code:
Code:
runmotor:
pauseus total ' total is 16 bit value
toggle 7 'output pin for square wave
'Check input states for limit switch trigger to stop motor.
goto runmotor
I used a usb oscilloscope and measured the frequency generated vs what I want and the error is bad at the higher frequencies.
The attachment show the errors and the range I need acurate results (<1% error if possible)
Attachments
-
51.7 KB Views: 26