XGATE PIT based bit bang fuel injection

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

Re: XGATE PIT based bit bang fuel injection

Post by SleepyKeys »

Changed one var so my ticks are the same size as s12 stuff. Same pattern just different times :)

Image
You snooze, you lose!
User avatar
SleepyKeys
LQFP144 - On Top Of The Game
Posts: 549
Joined: Mon Feb 11, 2008 10:52 pm
Location: Arizona
Contact:

Re: XGATE PIT based bit bang fuel injection

Post by SleepyKeys »

Interesting, with the only xgate interrupt running(Metronome) set at a static 40.00ms the USB LA reads a bit extra. Thoughts???

Image


I don't think it's my code, the longer the tock from the metro the more it skews. My interrupt only flips the LED and clears the interrupt. The down counter value is left alone.

xgateMetronome: ; PIT 2 ISR, called by PIT2 interrupt. Decrement out delayCounter.
;CIF
LDL R2, #PIT2_CFLAG_MASK
LDD R3, #PITTF
STB R2, R3, #ZERO_OFFSET

LDD R5, xgatePORTPFlip
JAL R5; jump to xgatePORTPFlip
RTS
You snooze, you lose!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: XGATE PIT based bit bang fuel injection

Post by Fred »

Try it with the bench test stuff from the ECT and see what you get. Could be a crystal tolerance thing. When I tested I had near perfect results, I think that was at your house!
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!
jonr
QFP80 - Contributor
Posts: 46
Joined: Mon Aug 29, 2011 12:59 pm

Re: XGATE PIT based bit bang fuel injection

Post by jonr »

IMO, the ideal high level subroutine to handle fuel injection or ignition would be passed something like this:

Pin #
Start time (in degrees)
Pulse width (in usec)

It would continue to output pulses until told to stop.

The subroutine would also receive position pulse times so that it could update the correlation between timer ticks and degrees.

Use of 32 bit timers make sense given the max period and the desired accuracy.
Open5xxxECU.org
User avatar
SleepyKeys
LQFP144 - On Top Of The Game
Posts: 549
Joined: Mon Feb 11, 2008 10:52 pm
Location: Arizona
Contact:

Re: XGATE PIT based bit bang fuel injection

Post by SleepyKeys »

That's exactly what the params are now.

It could be useful to do that and that's how I originally thought stuff like that would/should work with an EFI system, but the truth is with a respectable input pattern you are always scheduling off of an input event every cycle.

Will post videos later today of it running my V8 :)
You snooze, you lose!
User avatar
SleepyKeys
LQFP144 - On Top Of The Game
Posts: 549
Joined: Mon Feb 11, 2008 10:52 pm
Location: Arizona
Contact:

Re: XGATE PIT based bit bang fuel injection

Post by SleepyKeys »

http://powerefi.com/files/xgate-test.mpeg

Alpha test Video!!!!!!!!

Engine is noticeably more responsive(remember we don't have any AE code yet).
You snooze, you lose!
jonr
QFP80 - Contributor
Posts: 46
Joined: Mon Aug 29, 2011 12:59 pm

Re: XGATE PIT based bit bang fuel injection

Post by jonr »

What are the application requirements in terms of pulse time, pulse accuracy, min durations, etc? 1 degree accuracy is what, 17 usec at 10,000 rpm? That's 680 cpu clock ticks? Sounds doable for a tight loop on a dedicated processor.
Open5xxxECU.org
User avatar
SleepyKeys
LQFP144 - On Top Of The Game
Posts: 549
Joined: Mon Feb 11, 2008 10:52 pm
Location: Arizona
Contact:

Re: XGATE PIT based bit bang fuel injection

Post by SleepyKeys »

+/- 1 tick @ .8usec currently :)

parameters are .8usec
You snooze, you lose!
jonr
QFP80 - Contributor
Posts: 46
Joined: Mon Aug 29, 2011 12:59 pm

Re: XGATE PIT based bit bang fuel injection

Post by jonr »

So one can schedule any pin to change at some point in the future and it will occur at exactly that time +- .8 usec? That should work great.

I would encourage you to write as little as possible in assembler.
Open5xxxECU.org
User avatar
SleepyKeys
LQFP144 - On Top Of The Game
Posts: 549
Joined: Mon Feb 11, 2008 10:52 pm
Location: Arizona
Contact:

Re: XGATE PIT based bit bang fuel injection

Post by SleepyKeys »

Are you asking me to write a C port in addition to the binutils port I did ?

"So one can schedule any pin to change at some point in the future and it will occur at exactly that time +- .8 usec? That should work great. " yes

I originally wanted to do it at .1us but .8 should be fine and matches the main system's scale.
You snooze, you lose!
Post Reply