I'll document my progress on the InputTrigger/NissanTrigger Helper Board here.
Been thinking about this, sorry to say that this board is not needed.
All that is needed is a changed interrupt handler (a define and a firmware compiled with my_make for this setup):
- primary trigger (acts eg. on rising edge): increase engine.trigcount (a 1-byte counter in SRAM). This would be very short, in the 3 usec range (30 usec available at 12000 RPM).
- secondary trigger
- rising edge: engine.trigcount=0 and enable primary_trigger interrupt
- falling edge: disable primary_trigger interrupt (this way we only burn clock cycles for counting the dense teeth, when it really makes sense, appr. 5% of the total time) and fire rpmcalc, set engine.igncount to the relevant cylinder
This is my current table setup:
The chip is the AtTiny2313.
The (ugly) schematic:
(I didn't have a AtTiny2313 component for the schematic, thus the older AT902313 is pictured, but the pinlayout is the same.)
The code is [here].
It will light up the corresponding green LED. I've never seen the LED used for decoding errors light up.
I also need to output the trigger for the tachometer, but that's just copying the simple trigger output.
When removing the need for the extra tachometer functionality, I realized that I just had copied the InputTrigger/AudiTrigger, but without the two LM1815 chips.
TODO:
- Change output to simple trigger + cam sync
- Create a real schematic
- Get input on the solution
- Make a real board
- ?????
- Profit!!!