We have build a simulator based on a PIC16F873, it genetate crank and cam signals. I want to test every thing before install it on the bike.


It generates a two 0-5 volt signals:

Signals are captured with a USB digital oscilloscope called OPTAscope.


My config

primary_trigger; /rising, toothwheel, no filtering/ = 0x03

secondary_trigger; /rising, enable, no filtering, toothwheel???/coil???, cam sync, single edge??/ = 0x11 or 0x19

tooth_wheel = 0x16

trigger_tooth = 00 (missing tooth)

crank_minper = ???

tooth_wheel_twidth1 = ???

tooth_wheel_twidth2 = ???

cam_sync_r_edge_phase = ???

cam_sync_f_edge_phase = ???

reset_engphase_after = ???





ign_out = 0x70

ignchmax = 0x01


I have been trying several configurations but I have not seen ignition signal yet, it is injection signal. I have oscilloscope channel connected to CS_IGN259 but it remains 5 volt everytime.

I have tested this config [dumpconfig1] with my simulator (crank signal 24-2 connected to trigger1, and cam signal connected to trigger2)

next, i have tested this other congif [dumpconfig2] trigger1 configured as coil and trigger2 disabled, i have connect trigger1 to my simulator cam signal.

both tests with the same tables [dumptables1]

There are no results!!!

A: Jose, it seems you are using a firmware version from about a month ago. If you update your firmware from cvs (or checkout a new version) and configure the third line of the h[] table and ignchmax variable in config it should work fine. You can take a look at my [config] and [tables] for inspiration. - DB

Ok. I have updated firmware and I have modified this tables for my config and IT WORKS OK!!!


I´m checking ignition firing precision. It was very precise upto 8000 RPM, and very close to optimum upto 15000 RPM (less power-loss from optimal than what 3C difference in MAT means) : about 6/20 degree average unexpected latency at 15000 RPM (in old firmware):


There were some firmware changes recently that bring this down to about 4/100 degree (less power-loss from optimal than what 0.4C difference in MAT means!!) at 15000 RPM (this is below the tuning limits of the most professional tuner, in engine output measurable in F1 laboratory only. And absolutely unmeasurable at 6000 RPM.) The results are somewhat better with even-type trigger than with multitooth.


Q: even-type trigger do you mean evenly spaced magnets with HALL? Goodjob !!

A: It doesn't matter if it's HALL or optical or even mechanical; the difference is that the even (often called "coil-type") type trigger input interrupt never interferes with the output scheduling (the input comes at say 45 degrees BTDC and ignition fires at say 20..40 degree). There are thoughts to make the inputtrigger interrupt slimmer by passing most of the processing to userspace: this decreases the effect of the pulses from the multitooth trigger to practical minimum. However, improvements around camsync have priority.

With this precision the only key to good tuning in affordable time is the lambda-feedback and DetonationDetection (hopefully IonSense soon).

Interpretation of scope measurements: