Originally Posted by
kur4o
I aim for dead spot on spark only because spark scatter...
I think I PM'd you a zip of the source that's flashed on your AVR. Attached is an object dump of the resultant .elf binary before it was repackaged as intel hex. To do this yourself you can hold down shift before compiling (you can use the verify function - button with a checkmark - to compile without attempting to upload to the AVR) and note the build info in the lower pane of the IDE. Near the end you should see it mention the full path to the generated .elf code. I haven't used Arduino on windows in ages so no idea if they include avr-objdump.exe but this is how I generated the attached dump on linux:
Code:
avr-objdump -S /tmp/arduino_build_639568/diy_ltcc_0_9_18.ino.elf > output.txt
The EST line is using the highest priority external interrupt (except the reset interrupt) so when a falling edge signal is caught on pin 2 the AVR datasheet says there could be a maximum of 4 instructions executed before the INT0 ISR begins. This potential delay, and the instructions at 0x07fc prior to the register being toggled off should be the only points spark delay should be introduced by the controller.
There is an input debouncer check, and a few other checks to accomodate ATDC spark timing. Here are the instructions that toggle the output register.
Code:
*sequencer[sequenceIndex].portAddr &= ~sequencer[sequenceIndex].bitMask;
80e: 60 91 05 01 lds r22, 0x0105 ; 0x800105 <sequenceIndex>
812: 30 91 05 01 lds r19, 0x0105 ; 0x800105 <sequenceIndex>
If this entire ISR could be optimized in assembly I think I can inline it directly in the source file.
Originally Posted by
kur4o
For now the only thing that can be offered is some new spark offset table vs rpm
Curious if you know the address of this table in $ee offhand. I'm relatively sure this was intended to compensate for "lost" high resolution interrupt counts.
Originally Posted by
kur4o
There is even factory output pin with pwm modulated signal of TPS position
I think I'm already using all the timers that would enable measuring a PWM signal, but there are available analog inputs so reading the TPS voltage directly would probably be easier and more efficient for the AVR since it has a dedicated ADC that works asynchronous of the main loop. Unfortunately it's multiplexed so reading TPS would have to share time with ignition voltage and MAP measurements.
Bookmarks