Fred's firmware development diary

Official FreeEMS vanilla firmware development, the heart and soul of the system!
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

Post by Fred »

Nothing much to report tonight.

I did add 6 more outputs mainly to check the wiring on my test setup.

Here is the video :

http://www.youtube.com/watch?v=B8pV3oLazr8

Admin.
Attachments
freeems-v0.0.2plus.s19.zip
13 leds flash (the extra ones are : pwm 0 - 6)
(1.01 KiB) Downloaded 1075 times
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

Post by Fred »

I haven't touched the code tonight really at all except to turn on the LED's that I added. Now that the test rig is fairly complete I can make some serious progress on it tomorrow though! Stay tuned :-)

New LEDs :

http://www.youtube.com/watch?v=MoQdrLiS-tI

Admin.
Attachments
freeems-v0.0.2++.s19.zip
added port A and B to flashing LED routine. port K on solid.
(1.17 KiB) Downloaded 1038 times
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

Post by Fred »

This code shows a very basic method of cycling injector channels in semi sequential mode whilst ignition is fired in COP mode. It utilises all connected LEDs and flashes them in 5 different ways.

Still no timer or interrupt or PWM code included. Version 0.0.4 should have one of those types of code included.

Download from here :

http://sourceforge.net/project/showfile ... _id=578900

Admin.
Attachments
freeems-v0.0.3.s19.zip
(1.4 KiB) Downloaded 1043 times
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

Post by Fred »

OK, dual ADC controlled period for the strobing, variables updated to reflect my thoughts in the goals thread, tacho output, randomish PWM outputs x 6 at varying frequency, and 12.5 25 50 75 87.5 % steps and one that cycles through the lot.

Get the files here :

http://sourceforge.net/project/showfile ... _id=579196

See it in action here :

http://www.youtube.com/watch?v=vkATvZ473lM

Enjoy,

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

Re: Fred's firmware development diary

Post by Fred »

Version 0.0.5 is released :-)
0.0.5 - 26/2/08
Added RTI code to cycle the "user led" at 1Hz (Many thanks to Karsten for pointing out my mistake)
Added port H input interrupt code with basic debounce and variables to control what is switched and when
Fixed a small bug in the logic for cylinder count etc
Rearranged significant portions of the code
Added these release notes
Get it here :

http://sourceforge.net/project/showfile ... _id=579658

And here's the video, excuse my dull nasal New Zealand accent :

http://www.youtube.com/watch?v=a9NsA1wtiwI

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

Re: Fred's firmware development diary

Post by Fred »

I discovered this morning that you cant read PORTT/PTT to get the ports value when in OC mode, you must use PTIT...

Favourite phrase of the morning "wtf??" :-) good bye several flash write erase cycles...
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

Post by Fred »

0.0.6 - 3/3/08
Setup Timer interrupts and mimicked the JimStim input signal on port J 6,7
Fixed init bug (hadn't done it at all yet) that only sampled ADC 0 - 3
Added reset of port B so it can be used for numerical display of debug info
Added wheel analysis document
Made MakeFile dump pre-processed C
Fixed up all header structure
Split interrupt vector table out of main
Added timer overflow handler and extension variable
Moved all injector code to Timer ISR's
Attempted some basic math in the main RPM input ISR and failed

http://sourceforge.net/project/showfile ... _id=581266

Boring vid :

http://www.youtube.com/watch?v=6UI8qTESOUg

Enjoy. (Sean, this should be an ok base to start work from, but there will be more coming soon thats good)
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

Post by Fred »

This video illustrates just how critical the ISR code is. The slow down to the main loop code is significant because of the ISR load, this could end up being the limiting factor for cylinder count support IMO. I hope we can do as we intend and code for 12 pot donks, but perhaps that is stretching the idea a bit too far. Perhaps not too.

The video is 2 minutes long, you only need to watch a few seconds to see the ISR artifacts in the bit banged spark outputs. The rest of it you can spend listening to the intro to Pink Floyd - Wish You Were Here, dedicated to some random friends like Lazar and Karsten and Rob etc :-)

http://www.youtube.com/watch?v=5x8jw1Srqgc

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

Re: Fred's firmware development diary

Post by Fred »

Well, I have a rough as guts NipponDenso 6 pot only decoder happening sort of.

Trouble is, the timer is getting reset before it ever gets reached :-)

I need to have a serious think about timers and scheduling and scale and then approach the code again.

So, it's sort of working sort of.

It's nearly 2am now though, so thinking is somewhat off the menu :-)

Bed time instead.

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

Re: Fred's firmware development diary

Post by Fred »

This morning I had timer controlled input capture scheduled, output compare actuated, sequential LED flashing with variable pulsewidth based on ADC and variable speed based on JimStim input RPM :-) It looked cool...

... till you turned up the advance, pulsewidth or rpm too much, then it did weird stuff.

I'm working on sussing out exactly the best way to handle the 24/2 wheel and timer setup etc.

I hope to release again tonight with a semi/working wheel decoder of the very most basic unuseful kind.

In other news, I have banned the use of the int data type :-)

This may seem extreme and somewhat Nazi/Lance like, but they are ambiguous and have the potential to cause major and hard to find issues. Ints on this platform are either 16 or 32 bit depending on compile time flags. That's not too big a deal, as long as you don't change it, but it also screws readability royally if you have shorts and ints interacting. Both are the same thing, but are they? who knows...

I think all declarations should be in these forms :

signed char 8 bit
unsigned char 8 bit
signed short 16 bit
unsigned short 16 bit
signed long 32 bit
unsigned long 32 bit

There are also long long (64), float (32), double (64), but those are all inefficient and we should be avoiding them anyway.

If you disagree with this move, please say so now and state some very very good reasons other than "I'm lazy". If you don't, I assume either you agree, didn't care enough to post, or didn't care enough to look through this post till the end :-)

As a little FYI, you can't spec unsigned/signed in a prototype or GCC will whinge... There is probably a good reason, and it can be turned off, but I don't know what the reason is.

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!
Locked