View unanswered posts | View active topics It is currently Wed Oct 18, 2017 11:06 pm



Reply to topic  [ 4 posts ] 
Coarse Bit Banged High Speed Outputs 
Author Message
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14822
Location: Home sweet home!
For tacho drive and knock windowing we'll be providing the following fairly coarse signal possibility:

Twiddle a bit for each and every RPM input event that can be scheduled from.

Per output pin options for each input event will be:

  • Do nothing
  • Turn pin on
  • Turn pin off
  • Invert pin state

We'll support 4 or 8 outputs like this, 4 at first, 8 if there is demand. Each one will have:

  • Pointer to the control register for the port being used
  • Bit mask for pin

I'll configure this to strobe some of my dev pins, so expect some of those to flash on your setup if you have LEDs attached. In the long term the default will be OFF.

This will burn 256 bytes of linear flash (512 if we move to 8 outputs), which is nothing really, and provide some really powerful functionality, especially if you're running a high res wheel like 60-2.

This will need some config exclusion on the GPIO stuff too. IE, the port will need to be registered with the central pin registry.

For example, on a DSM or 4/1 CAS you could reasonably configure it to pulse 4 times per engine cycle, either longer on or longer off. Either possible config would work fine for a tacho, one will be better for knock.

Users with low res inputs and low cylinder/output counts could also use Sean's XG BB stuff for these functions and obtain higher resolution.

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!


Sun Oct 16, 2011 4:35 pm
Profile WWW
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14822
Location: Home sweet home!
Code to be positioned after scheduling and possibly outside of sync space such that input noise shows up as noise in a tacho, or not, what about knock chips?

Code:
if(arrayOfCoarseConfs[currentEvent]){
    int offset;
    for(offset=0;offset<numCoarseOuts;offset++){
        unsigned char behaviour = (arrayOfCoarseConfs[currentEvent] >> offset) & 0x03;
        if(behaviour){
            if(behaviour == 1){
                configuredPorts[offset] |= configuredMasks[offset];
            }else if(behaviour == 2){
                configuredPorts[offset] &= ~(configuredMasks[offset]); // syntax correct for 8/16 bits?
            }else if(behaviour == 3){
                configuredPorts[offset] ^= configuredMasks[offset];
            }
        }
    }
}

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


Wed Oct 26, 2011 3:40 pm
Profile WWW
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14822
Location: Home sweet home!
numCoarseOuts should be configured to how ever many are being used so loop iterations is kept to a minimum. loop will only run if something is needed on this event anyway.

All array vars should be set to zero when not in use, along with the numCoarseOuts var set to zero such that time isn't wasted with two checks instead of one.

Perhaps add a config check to exclude the possibility of non zero array entries with zero numCoarseOuts or all same entries for numCoarseOuts not equal zero.

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


Mon Dec 19, 2011 1:07 pm
Profile WWW
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14822
Location: Home sweet home!
This is finally in the code base! Time to move this thread out of hiding :-)

Code is 2 + months old and worked perfectly pretty much as-is.

http://issues.freeems.org/view.php?id=296

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!


Wed Jan 11, 2012 2:46 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF. ColorizeIt.