Output Pin Requirments(xgate fuel and ignition)
Posted: Wed Oct 05, 2011 2:05 am
I would like to summarize the required behavior for bit banged outputs given a scenario.
The following formula will be assumed for the given parameters(decoderInputEdge16, channelNumber16, startTime32, stopTime16).
correctedStartTime = (currentTime - decoderInputEdge) - startTime;
stopTime = correctedStartTime + stopTime;
Having the channelNumber 16 bits is excessive but it doesn't save any room or processing time to change it to an 8 bit parameter. This also gives us *free bits to do special things.
Arithmetic examples using one schedule per output channel:
1. a pulse(10ms,10ms) has been requested and no other events are scheduled on that channel.
______10ms_______|-----10ms-----|____________________________
2. a pulse(10ms,10ms) has been requested but there is an existing event scheduled(20ms, 20ms) that has not started yes.
______10ms_______|-----10ms-----|____________________________ (complete overwrite)
3. a pulse(10ms,10ms) has been requested but there is an existing event(5ms, 30ms) that has been running for 15ms.
__5ms____|-------------25ms------------|____________________________ (event shortened)
4. a pulse(10ms,10ms) has been requested but there is an existing event(5ms, 15ms) that has been running for 15ms.
__5ms____|-------------25ms------------|____________________________ (original event extended)
This allows for both zero and 100% DC. This also allows multiple schedules to share the same pin and will behave as long as you don't achieve 100% DC(fuel purposes).
Examples using multiple schedules per output channel as it is now:
1b. two pulses have been scheduled at the same time (5ms,10ms/10ms,20ms)
__5ms_____|-----10ms-----|__________
15ms will be lost which is improper for fueling
2b. two pulses have been scheduled at the same time (5ms,10ms/20ms,20ms)
__5ms_____|-----10ms----|__5ms__|----------10ms---------|_________
Once I make sure what I have is correct I will add the necessary overhead to correct the example in 1b.
-sean
The following formula will be assumed for the given parameters(decoderInputEdge16, channelNumber16, startTime32, stopTime16).
correctedStartTime = (currentTime - decoderInputEdge) - startTime;
stopTime = correctedStartTime + stopTime;
Having the channelNumber 16 bits is excessive but it doesn't save any room or processing time to change it to an 8 bit parameter. This also gives us *free bits to do special things.
Arithmetic examples using one schedule per output channel:
1. a pulse(10ms,10ms) has been requested and no other events are scheduled on that channel.
______10ms_______|-----10ms-----|____________________________
2. a pulse(10ms,10ms) has been requested but there is an existing event scheduled(20ms, 20ms) that has not started yes.
______10ms_______|-----10ms-----|____________________________ (complete overwrite)
3. a pulse(10ms,10ms) has been requested but there is an existing event(5ms, 30ms) that has been running for 15ms.
__5ms____|-------------25ms------------|____________________________ (event shortened)
4. a pulse(10ms,10ms) has been requested but there is an existing event(5ms, 15ms) that has been running for 15ms.
__5ms____|-------------25ms------------|____________________________ (original event extended)
This allows for both zero and 100% DC. This also allows multiple schedules to share the same pin and will behave as long as you don't achieve 100% DC(fuel purposes).
Examples using multiple schedules per output channel as it is now:
1b. two pulses have been scheduled at the same time (5ms,10ms/10ms,20ms)
__5ms_____|-----10ms-----|__________
15ms will be lost which is improper for fueling
2b. two pulses have been scheduled at the same time (5ms,10ms/20ms,20ms)
__5ms_____|-----10ms----|__5ms__|----------10ms---------|_________
Once I make sure what I have is correct I will add the necessary overhead to correct the example in 1b.
-sean