Pin Reassignment Request for Input Capture and Fuel Injector

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:

Pin Reassignment Request for Input Capture and Fuel Injector

Post by SleepyKeys »

As a lot of you know I started writing code for the opti-spark distributor(LT1-360-8.c). I need to use the pulse accumulators in counter mode in an attempt to lower the primary ISR frequency. After reading some stuff about the pulse accumulator registers I found that pulse accumulator A is somewhat different from pulse accumulator B. I'm not 100% sure yet, but I may need to use A which is attached to PT7. Right now we are using 0/1 for input capture and 2-7 for injection control.

May I suggest that we change this to 1-6 for injection and 0/7 for input. I believe that will give us the greatest flexibility in the future. Since the other 6 channels are used in output mode, why cover up features that we may need now or in the future?

Thanks,
Sean
You snooze, you lose!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Pin Reassignment Request for Input Capture and Fuel Injector

Post by Fred »

I can't see a problem with this and I think it makes sense to do. I won't be changing the code or my stuff for a while though as I have no time to redo the board at the moment. If we go ahead with this one of us should probably maintain a patch and keep a different version locally. Reluctantly, it would make the most sense for that to be me too.

Go ahead and experiment with it, of course, and we'll give everyone a week to complain before nailing it down (again).

(see guys, this is why the software must come first).

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!
User avatar
jharvey
1N4001 - Signed up
Posts: 1607
Joined: Tue Jun 10, 2008 5:17 pm

Re: Pin Reassignment Request for Input Capture and Fuel Injector

Post by jharvey »

Fred wrote:(see guys, this is why the software must come first).
Chicken or the egg, blah blah blah.

The hardware doesn't do us much good with out the software, so I agree.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Pin Reassignment Request for Input Capture and Fuel Injector

Post by Fred »

Working on the hardware side of this right now, about 2/3 the way through I guess. Should have it back together in a while and then its just some minor software tweaks and I can test it and call it good.

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!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Pin Reassignment Request for Input Capture and Fuel Injector

Post by Fred »

Hardware is probably done (not tested yet), so just the software changes to go now. I'll be doing that shortly.

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!
User avatar
SleepyKeys
LQFP144 - On Top Of The Game
Posts: 549
Joined: Mon Feb 11, 2008 10:52 pm
Location: Arizona
Contact:

Re: Pin Reassignment Request for Input Capture and Fuel Injector

Post by SleepyKeys »

SWEET, that was fast !

Thanks,
Sean
You snooze, you lose!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Pin Reassignment Request for Input Capture and Fuel Injector

Post by Fred »

Software is done too, but there is one of :
  • Hardware bug
  • Software bug
So I need to find it and then I can push the changes up to the server :-)

Hopefully it won't take too much longer...

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!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Pin Reassignment Request for Input Capture and Fuel Injector

Post by Fred »

Well, I didn't find the issue yet, but while looking I did find that we are way way better off using 01 than 07 for 99% of decoders. I actually knew this but had forgotten...

I wish I'd remembered though as I spent a chunk of time on it yesterday...

Anyway, while on the toilet this morning I had an idea which should make it a bit easier to do either.

The only thing we would need is jumperable pin selection for the secondary RPM input and one of the fuel pins. We'd need to think carefully about that though as we don't want to create a confusing situation for users.

I'm going to continue trying to make this work as is today. Once I do I'll convert it to work either way with only software changes on my test rig and then setup the software and push IF I finish it.

What a PITA...

Sean, I'm not pissed with you, just pissed that I didn't do my homework before I started... so relax :-)

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!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Pin Reassignment Request for Input Capture and Fuel Injector

Post by Fred »

Bug is fixed. I had forgotten to switch the interrupt vectors out...

This still needs some careful consideration.

For example, what exactly do you need to do with the pulse accumulators?

I can't see a good reason for needing 16 bits there. pretty much you are either going to do what you are doing : counting to 5 and interrupting OR counting the number of blips in a large window which should be around the 50 mark absolute max.

Having those delay counters = hardware noise immunity and that is a crucial thing IMO.

I'm going to commit my work to a temporary branch (as I did with my comms changes before starting this) and go and rewire my board to have 8 timer leds and be able to connect the inputs to any pins.

I'll then go back to using it how I was before until this discussion is fully complete. I can probably send you my work if you want to try out the other PA, but I really think you can get away with the 256 ones. Also, pin 7 is special for output stuff too... not that we need that, but... just something to keep in mind.

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!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Pin Reassignment Request for Input Capture and Fuel Injector

Post by Fred »

I got the board to the stage of having 8 leds for port T only to realise that 5v turns them on and that I need to pull the inputs high for the JimStim to work. So I need to change some things there...

More on that tomorrow.

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