Re: Fred's firmware development diary
Posted: Wed Mar 05, 2008 11:35 am
I had a bit of a "moment of truth and enlightenment" last night in the shower. I already knew that the hardware timer could be extended by incrementing another variable on overflow, but (of course) that can not be used to switch the hardware outputs. Thus, the input side of counting can be arbitrarily precise out to the nth degree, but the output side is bounded by two things, maximum period, and unit of measure. Obviously we want the unit of measure to be as small as possible, but what about the period... well, we need to be able to inject enough under high load, low rpm, heavy enrichment situations. If we used 16 as the prescaler, we get 400ns units, and 26.2144ms maximum pulse width. That is not enough for all situations. The next step gives 52.4288ms which should be plenty for most situations and still has less than 1us accuracy (800ns/0.8us). There is going to need to be a minimum pulse width limit too because of the latency of the code that switches the hardware timer register. That should be very small indeed. But it will exist as a limitation.
Things that I need to do :
When thats done, it will be ready for on car manual pulsewidth control idle testing :-)
Admin.
Things that I need to do :
- Ensure that "pulse width" is above min and below max at all times by force. (maybe set a flag for each condition that says something is wrong)
- Make overlapping periods transition to full on cleanly and transition back to switching cleanly again
- Read the signal properly with a good usable on car strategy
- Hardware tooth throwing out (introduces a 256,512,1024 bus cycle delay before interrupt if used)
- Software tooth throwing out (means performing actions at end of tooth (better for VR anyway)
- Counter increment on leading edge, decrement on trailing if invalid tooth (needs thought and status)
- History and comparison of the previous gaps between main teeth
- History and comparison of the previous tooth widths
- Comparison of second trigger location with where expected
- History and comparison of second trigger tooth width
When thats done, it will be ready for on car manual pulsewidth control idle testing :-)
Admin.