CDI tester project

Maybe this also helps, I ask a friend with a similar interest and he said.

How wide should the on time of each pulse I send to the DAC be?

The answer is: "it depend !"

For having Zero volt , DAC need 10 (MSB pin at 1 , others at 0)
Leave MSB pin at 1 , others at 0 as long as you want a 0volt, about 350degres (so most of the time)

The time MSB is 1 and other are 1 too to produce a +12v is up to you.
If you want a 1ms pickup, then those 2 pins must not move during 1ms

Personally , I decided that ONE pulse last 10degree so the code is :

  • send 10 to produce 0volt

  • for positive pickup: send 11 to produce +12v

  • wait (PERIOD/360) * 10 (PERIOD is in ms)

  • send 10 to produce 0volt
    -wait 'barWidth' millisecond you want

-send 00 to produce -12v
-wait (PERIOD/360) * 10 (PERIOD is in ms)

  • send 10 to produce 0volt

That's it , then wait for the next rotation

Do I use 'barWidth' for beginning of pulse to end of the other, or between the 2 pulses.

between the 2 pulses