Leigh,
Didn't get your latest program.
However, now that you've changed the number of pulses per rev, the prescaler will need to be changed to 4 instead of 2.
With a prescaler of 2. If the engine is running at 794 RPM the capture count would be 75,510. This is too high. The timer would wrap around after 65535 and you would be left with 9974 as the period result.
By setting the prescaler to 4, this will keep it from overflowing untill the RPM gets below 460. Of course, this now changes the calculation again.
I'm trying to come up with a formula can take all these changes into account and automatically correct for them. No doubt, you'll be changing other things later. Most likely is the OSC speed, for what you want to eventually do with the timing, and injectors, 4mhz isn't going to cut it.
Let me know what you get with the new prescaler.
Darrel




Bookmarks