Possible uses of our timer resources : ideas soon please!

Official FreeEMS vanilla firmware development, the heart and soul of the system!
User avatar
SleepyKeys
LQFP144 - On Top Of The Game
Posts: 549
Joined: Mon Feb 11, 2008 10:52 pm
Location: Arizona
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by SleepyKeys »

So let me get this strait. It has come down to this as far as core functions/priority go.


Primary injector pulse width and angle controlled as accurately as the hardware will allow

timing angle controlled as accuratly as possible with less priority to pulse width(dwell)

secondary injector pulse width controlled as accurately as possible with less priority to angle

What ever is left over for additional I/O

Do I have that right?
You snooze, you lose!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by Fred »

8InchesFlacid wrote:what happens when you miss an effectively unimportant tooth while doing something important
Given that IC0 is of the highest possible priority, and IC1 next, you don't miss a tooth at all until you simple run out of processor time to run all of your interrupt code and/or they come in before you get a chance to store the value and clear the flag. This is why higher tooth and cylinder counts get lower max rpms.
And, I think the only real "other time" suggestions anyone mentioned were traction control related.
True, but the internal timers are no good for that, and the external ones are not up for discussion. (without sound reasoning from someone that really knows ;-) )

Sean, there are 8 IC/OC hardware accurate timers, ONLY these can output truly precisely, or record input truly precisely. There are 4 internal PIT timers that can generate an interrupt precisely, but under load, when that code runs is any body's guess. We may be able to do a subtraction to find out the latency on each pass and make it fairly accurate in that regard (load reg - count reg = latency).

As written in the first post (mostly) :
IC x 2 = engine position / RPM input to (at the moment 0.8us)
OC x 6 = injector control to (at the moment 0.8us)
PIT x 2 = ignition control (1 for start of dwell, one for end and fire of coil)
PIT x 2 = staged injector control (1 for open, 1 for close)
(PIT accurate to ~0.8us, but with latency that will be unpredictable and only accountable on the first trigger, the second one fires when it fires, probably around the 10us range)

Hopefully that clears it up and leaves it easy to implement whatever staged control is desired including i guess (though, this would raise the run time of the tooth code and lower the run time of the injector code) firing the staged injector earlier than main.

Admin.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
AbeFM
Post Whore!
Posts: 629
Joined: Sat Feb 16, 2008 12:11 am
Location: Sunny San Diego
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by AbeFM »

seank wrote:So let me get this strait. It has come down to this as far as core functions/priority go.


Primary injector pulse width and angle controlled as accurately as the hardware will allow

timing angle controlled as accuratly as possible with less priority to pulse width(dwell)

secondary injector pulse width controlled as accurately as possible with less priority to angle

What ever is left over for additional I/O

Do I have that right?
Just for posperity, you should say how many channels you intend to have on these (keeping in mind overlap is indeed possible if I stick dual baby 1500cc injectors on my MiataFromHell (tm)
User avatar
SleepyKeys
LQFP144 - On Top Of The Game
Posts: 549
Joined: Mon Feb 11, 2008 10:52 pm
Location: Arizona
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by SleepyKeys »

8InchesFlacid wrote: Just for posperity, you should say how many channels you intend to have on these (keeping in mind overlap is indeed possible if I stick dual baby 1500cc injectors on my MiataFromHell (tm)
I was just referring to core function priority, not my needs necessarily. There was a lot of conversation and I just wanted to make sure I was up to speed. I'll start a new thread about possible combinations after I assess my goals. Nice (tm) BTW.
You snooze, you lose!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by Fred »

As discussed in another thread it shouldn't be too hard to do a sequential bit banging fork/branch of the code for 8 10 12 cyls. each ISR would fire one of two injectors each time it was called. Easy. You just have to set the "action" to "do nothing" and leave the interrupt enabled. MUCH later is the time for that, we really need focus and a clear set of obtainable goals to work towards at the moment. When we reach those, that is the time to reassess what we are trying to achieve.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by Fred »

I'd like to point out that the modulus down counter that is part of the ECT module works very much in the same way as the PIT timers, and thus can be used in the same fashion for timing something or other. Currently it's setup to flash the "user led" such that new FreeEMS testers can verify the operation of their unit when they power it up and load the code to it.

Admin.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Serj
TO220 - Visibile
Posts: 6
Joined: Tue Apr 08, 2008 1:00 pm

Re: Possible uses of our timer resources : ideas soon please!

Post by Serj »

My expirience,

MC9S12 80 pin

1 TIMER(IC) - CRANK
2 TIMER(IC) - CAM
3 TIMER(basic) - INJECTION CLOSE (+ STAGED, 16th ANGLE INDEPENDENT INJECTIONS TOTALLY)
4 TIMER(basic) - ANGLE EVENTS: KNOCK (OPEN/CLOSE WINDOW), TDC, MAINLOOPCALC, INJECTION START
5 TIMER(IC) - VVTI INTAKE
6 TIMER(IC) - VVTI EXHAUST
7 TIMER(basic) - DWELL
8 TIMER(basic) - SPARK

All harware ports are bitbanged, all talks about 'slow' are trash. my latency about 10us(up to 30 when there are too much masked ints in mainloop for synchronisation) at 10krpm its 1 deg. All events are angle scheduled. AFR is absolutely f..g stable. So Fred i am with you, you are going right way.

BR
Serj
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by Fred »

Thanks Serj, that's an OLD thread! :-) Is your stuff open source? We're on our way to making this thing work pretty soon, I think! Lots of progress recently.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Serj
TO220 - Visibile
Posts: 6
Joined: Tue Apr 08, 2008 1:00 pm

Re: Possible uses of our timer resources : ideas soon please!

Post by Serj »

Fred, unfortunately no, but i can share with you with ideas and help with problems. concerning this 30-10 us jitter. in case xgate is used the jitter could be almost removed.

BR,
Serj
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Possible uses of our timer resources : ideas soon please!

Post by Fred »

Yes, with xgate, and no other interrupts, just matched sets of sequential bit bangs, there should be no jitter at all, just a slight delay :-)

Is your product commercial? Does it have a website we could take a look at?

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Post Reply