Op amp circuit attached. I use a cheap PC supply for +/-5V and 12V into VEMS box. D0 and D1 are 5V logic parallel port pins. I made my pulse 1/20 of the pulse to pulse period. Codes looks something likeout &H378,0 ;LPT1 data 0 and 1 low for initout &H378,1 ;pulse downdelay period/40out &H378,2 ;pulse updelay period/40out &H378,0 ;back to zerodelay period ;hang around until the next pulseInsert pulse pattern by repetition (12-1, 60-2,,,,)
As for the code, most mortals can not pull off real time stuff in Windows. You just can not control the overhead. There is a bit of pulse shifting in interpreted basic (QB) DOS running at higher rpm settings (shorter delay loops, thus any additions are more apparent) for non-compiled code. Mostly it is not a problem unless you have a lot of teeth on the "wheel" and high rpm. When this happens, any DOS overhead becomes a larger percentage of the period between pulses (because the period is so small).