Fred's firmware development diary comments thread

Official FreeEMS vanilla firmware development, the heart and soul of the system!
Post Reply
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary comments thread

Post by Fred »

Thanks for the compliments.

Atomic means that all things between the two tags happen at once and un-interrupted. It blocks all interrupts from things like inputs and outputs etc. All atomic blocks should be very short as should all interrupt handlers them selves as nothing else can run during those times. It's basically a lock on the data being accessed such that it can't change half way through. Some operations on say a 32 bit integer happen over multiple cycles, so you might have done half of it and then the number will change under you (because of an interrupt) and mean you get an inconsistent result.

I don't use them much though :-)

As for html, quite right. If I didn't give you power over the web content on the sourceforge site, I should. You can maybe put up a basic front page and link to FreeEMS related things such as the doxygen (you should version the links from the word go).

Once it is setup I can change that www.freeems.org redirect to go to that site instead of here.

Let me know if you aren't allowed to do it and I'll give you permission.

Cheers,

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: Fred's firmware development diary comments thread

Post by Fred »

Dave, attached is structs.h for your viewing pleasure.

Fred.
Attachments

[The extension h has been deactivated and can no longer be displayed.]

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: Fred's firmware development diary comments thread

Post by jharvey »

Fred wrote:As for html, quite right. If I didn't give you power over the web content on the sourceforge site, I should. You can maybe put up a basic front page and link to FreeEMS related things such as the doxygen (you should version the links from the word go).
I see more --> admin --> file release. Sounds like web content could be another one next to file release. Or perhaps I'm barking at the wrong tree.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary comments thread

Post by Fred »

You now have shell access. I'm not sure what power that gives you, but I trust you to behave :-)

Do read the stuff on how to layout the page etc. You have to display the SF logo, and it would be nice if you put the donate button up there too.

There is facility to link the freeems.org url directly to the site, but I have no idea how.

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: Fred's firmware development diary comments thread

Post by jharvey »

I've started a dia block diagram to help me keep track of the firm. I've come up with a couple questions. Here's a picture of what I've got in dia, and how I see the layout at this point it time.

Image

main is where it typically plays, and ISR's break it out to do special stuff. I only listed ISR's that had some code behind them, there are several listed, that have yet to be filled in. I got my list of ISR's primarily from interrupts.h. Then I added the bottom two. I stumbled across commsISR, and I made up MapISR because I didn't see the Map input(s) yet. Perhaps it's in there and I haven't stumbled across it yet.

I can guess the general purpose of ignition dwell, ect, but some I don't quite grasp at first glance. So the questions.

What is the general purpose of ModDownCounter and why doesn't is say ISR like the rest?

What is the general purpose of UISR, XIRQ, PortJ, PortP? Currently they are backed by a counter. Is that to let you know if it gets called when you don't expect it to be called?

What is the general purpose of StagedOffISR and StagedOnISR?

Should commsISR be included in the functions listed here?

http://freeems.sourceforge.net/doxygen- ... ts_8h.html

Oh also I uploaded the doxygen files to SF, they can be found here

http://freeems.sourceforge.net/doxygen- ... index.html

They can also be downloaded as a zip from the SF file releases. When time premits I'll likely update the SF web page redirect. But for now, the web version of the doxygen files are a bit hidden.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary comments thread

Post by Fred »

jharvey wrote:I got my list of ISR's primarily from interrupts.h.
Try interrupts.c to see what is actually setup to be run if triggered, and the init.c file to find out what is configured to run (though that will be less obvious).
Then I added the bottom two. I stumbled across commsISR, and I made up MapISR because I didn't see the Map input(s) yet. Perhaps it's in there and I haven't stumbled across it yet.
Ditch mapisr, there will never be one, and commsISR will be in the next version, though not necessarily called that :-)
What is the general purpose of ModDownCounter and why doesn't is say ISR like the rest?
Fixed, the reason was to keep the table in interrupts.c uniform. It now reads ModDownCtrISR :-)
What is the general purpose of UISR, XIRQ, PortJ, PortP? Currently they are backed by a counter. Is that to let you know if it gets called when you don't expect it to be called?
UISR is just to count stuff that shouldn't be called, and the others are bumping that same variable for the same reason. Port H is in use right? The other ports have the same sort of setup. XIRQ and IRQ are single pin unmaskable interrupts with their own handlers.
What is the general purpose of StagedOffISR and StagedOnISR?
Like dwell and fire. Staged injection. A second bank of injectors with a different timing scheme.

Cheers for the feedback :-)

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: Fred's firmware development diary comments thread

Post by jharvey »

Is there a way to make nice circular pictures / timing schematics? Something similar to what delta posted about a while back.

http://www.diyefi.org/forum/viewtopic.p ... 4601#p4601

I'd like to draw up a timing graph showing when and what code will run at what parts of the cycle. I guess I can do it with a pie charge in a spread sheet, but it feels like there is a better tool out there, and I just don't know it. Something that would allow me to put A/D convert at 10 degree to 11 degree, and fuel calcs at 11 to 15 degrees, or what ever the degrees end up being.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary comments thread

Post by Fred »

I don't know about tools, but you won't really be able to do a diagram like that as some things are absolute duration based and some angle based so it will be a diagram for a specific configuration and rpm if at all.

A flow diagram of some sort might be better, or just an english language description?

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: Fred's firmware development diary comments thread

Post by jharvey »

Part of my problem is that the block or flow is mostly IRQ driven not soft / PC counter driven. I seem to be hung up on trying to establish blocks that very closely match the software blocks. I really should try to abstract myself and accept that these blocks aren't going to match the soft bocks that closely. The IRQ's will allow for two or more soft blocks to be executed at the same time where the flow diagram only allows for one block at a time.

I'm working on a set of block diagram(s) that perhaps other will find handy, but I goal right now is simply keeping track of and learning the firmware as I see it now. I guess I'll be happiest with both a flow diagram, as well as a software block diagram. However the software block diagram(s) will be very similar to the call graphs from Doxygen.

Anyhow, just learning and flopping around. Don't pay me to much attention right now.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary comments thread

Post by Fred »

Once the main loop is populated with more stuff the doxygen style stuff will be more use, in the mean time its very much ISR driven. I don't mind what you do really. If I can help you make sense of it by correcting your pics and answering your questions, all the better.

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