I've been meaning to write this for awhile, and finally finished it up. It is C code for an XS650 Special-like ignition. It is for the TM4C123G evaluation board, which is a tiny little controller board you can get for around $15 these days. Add a coil firing transistor circuit, and buffering for the pickup mounted on the stator and you're ready to run...
...almost. Many easy changes needed to be made to the values for the variables. For example for ease of conceiving it, I assumed TDC is 180 degrees CCW from the second pickup pole. I assumed the two pickup poles are 10 degrees apart. I assumed advance kicks in at 1000 RPM and is finished at 5000 RPM. I assumed the maximum advance is 20 degrees - all incorrect for the XS650 excepting for coincidence, but if you understand the code, changing these and a few other things to the right values is nothing. Now go make an ignition!
https://github.com/hwm1/electronic-ignition
...almost. Many easy changes needed to be made to the values for the variables. For example for ease of conceiving it, I assumed TDC is 180 degrees CCW from the second pickup pole. I assumed the two pickup poles are 10 degrees apart. I assumed advance kicks in at 1000 RPM and is finished at 5000 RPM. I assumed the maximum advance is 20 degrees - all incorrect for the XS650 excepting for coincidence, but if you understand the code, changing these and a few other things to the right values is nothing. Now go make an ignition!
https://github.com/hwm1/electronic-ignition