Caveman Level Understanding of Megasquirt?

A general forum and a place for initial or prospective users. See Manuals/Documentation
Click here to enter
Contact a Forum Administrator
If unsure where to post, post in this sub-forum.

Moderators: jsmcortina, muythaibxr

fj1289
Helpful MS/Extra'er
Posts: 112
Joined: Mon May 07, 2012 10:16 am

Caveman Level Understanding of Megasquirt?

Post by fj1289 »

I’ve been trying to get smart on the V3.0 PCB.

From what I’ve read in the various manuals, forums, anything online I can find, here is what I think my caveman level understanding is:

The CPU has several “dedicated” circuits that are built into the board – most are for the “basic” EFI install and are generally not modified for other uses:
Tach in
TPS
MAP
MAT
CLT
O2
12v power and multiple grounds
INJ1 and INJ2
Fuel Pump relay control
Idle (this is the exception – commonly repurposed for other uses)

Then there are 13 “configurable” CPU INPUTS/OUTPUTS (if you don’t use CAN devices):
JS0,1,2, and 3: OUTPUT 0-12v .5amps max (JS0 and JS1 are “married and opposite” as are JS2 and JS3 – i.e. if JS0 is 12v then JS1 is 0v and vice versa). So this really reduces the number of “available” INPUTS/OUTPUTS to 11…
JS4 and 5: INPUT 0-5v analog
JS6 and 8: CANH and CANL (not counted in the 13 “configurable” CPU INPUTS/OUTPUTS)
J7: INPUT ground-switch
J9: tied to 12v (so not really an INPUT/OUTPUT - brings us down to 10 ... )
J10 and 11: general INPUT/OUTPUT .02 amp max
LED14 “squirt”: OUTPUT .2 amp max
LED15 “accel”: OUTPUT .2 amp max
LED16 “warmup”: OUTPUT .2 amp max

The “configurable” inputs and outputs need a way to get to the DB37 connector. This is done thru 9 pin “pads” that correspond with DB37 pins:
IGN (DB37 pin #36)
IAC1A (DB37 pin #25)
IAC1B (DB37 pin #26)
IAC2A (DB37 pin #27)
IAC2B (DB37 pin #28)
SPR1 (DB37 pin #3)
SPR2 (DB37 pin #4)
SPR3 (DB37 pin #5)
SPR4 (DB37 pin #6)

I hope all the above is accurate – it is what I “think” I know…

Now – here’s where I am still a bit fuzzy…
Although there is a “suggested” implementation for the CPU INPUTS/OUTPUTS and the pin “pads”, in reality can’t the INPUTS/OUTPUTS be connected to the pin “pads” as determined by the user? Or are there limitations within the software or firmware that will only allow certain INPUTS/OUTPUTS to go to certain pins?
I realize each CPU INPUT/OUPUT is limited in what function it can perform based on what it is (i.e. can’t directly input a frequency signal to the analog inputs, can’t drive a large relay with a .02 amp output, can’t input an analog signal to the ground switched input, etc). But, within the constraints of the type of the INPUT/OUTPUT, and the number of pin pads available, can any “compatible” INPUT/OUTPUT be connected to any available pin “pad”?

Is there anything within MS3 that further restricts INPUT/OUTPUT usage compared to what “should” be possible based on my understanding above?

Please correct anything I’ve gotten wrong or isn’t accurate. I’m much more of a knuckle buster than an electrical engineer – it’s taken me two weeks to get to this level of understanding – hope I don’t have to unlearn any of it!

Thanks,
Chris
Last edited by fj1289 on Fri Sep 23, 2016 4:25 pm, edited 1 time in total.
ol boy
Super MS/Extra'er
Posts: 1532
Joined: Mon Sep 10, 2007 3:06 am
Location: Tucson, Az

Re: Caveman Level Understanding of Megasquirt?

Post by ol boy »

Uhm....

Best to look at the chip set data sheet for both ms2 and 3. Most data sheets in around chapter 2 will layout the feature of each port/pin. Generally all pins can do digital I/O. But not all can do ADC or hardware interrupt input, ect.. some ports at tied directly to 8/16/32 bit timers that can be scaled for the resolution you desire.

Find the data sheets. Good bathroom material, lots of reading for sure.

Sent from my SM-G920V using Tapatalk
306 SBFord, Torquer II EFI intake, 60 lbs injectors, 8 LS2 coils, VS Racing 7668 turbo, 4R70W, MS3x fw1.4 w/built in trans controller.
slow_hemi6
Super MS/Extra'er
Posts: 4122
Joined: Fri May 07, 2004 3:33 am
Location: Australia

Re: Caveman Level Understanding of Megasquirt?

Post by slow_hemi6 »

fj1289 wrote: Although there is a “suggested” implementation for the CPU INPUTS/OUTPUTS and the pin “pads”, in reality can’t the INPUTS/OUTPUTS be connected to the pin “pads” as determined by the user? Or are there limitations within the software or firmware that will only allow certain INPUTS/OUTPUTS to go to certain pins?

Is there anything within MS3 that further restricts INPUT/OUTPUT usage compared to what “should” be possible based on my understanding above?
There certainly are limitations. As old boy said there are hardware limitations as to what function a processor pin can actually perform. But there are also firmware/software issues that restrict the usage of pins. That usage is also restrictive on other pins and there potential usage. Take for example the order of the spark outputs and what pins can be used. Spark A usually has a couple of choices but B through to H are hard coded to their respective pins. They can't be changed or jumbled up if they are designated to be spark outputs. The ones not used by spark, say it's a 4cyl, cop, then only ABCD are used and E through H are available for re purpose, provided some other code function does not specifically require that pin, and the hardware inside the processor can do what you want it to.
Most "available" for use pins can do digital I/O but that is not the case with ADC or PWM
Find the Manuals up top under Quick links: Manuals. :RTFM:
Cheers Luke
billr
Super MS/Extra'er
Posts: 6828
Joined: Sun May 15, 2011 11:41 am
Location: Walnut Creek, Calif. USA

Re: Caveman Level Understanding of Megasquirt?

Post by billr »

Wading through, and understanding, the CPU data-sheet can be a daunting project; much beyond "cave man" skills, I think. What, exactly are your concerns about the MS I/O or features? Are there some I/O devices you want to use that you think MS can't handle? It might be far easier (for you!) if we discuss your actual concerns, rather than you try to become proficient with MS software and hardware.
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: Caveman Level Understanding of Megasquirt?

Post by racingmini_mtl »

The MS3 manuals linked at the top of the page should give all the answers you need. If you want to know more about the CPU by all means read the datasheet but the real limitations are in the firmware and hardware. Anything that's not covered in the manuals is irrelevant unless you want to create your own firmware and hardware.

As mentioned above, if you have questions that are not covered in the manuals or not clearly explained there then you should ask. But trying to cover any potential issue any reader think you might be be concerned about is not a very productive way to go about it.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
fj1289
Helpful MS/Extra'er
Posts: 112
Joined: Mon May 07, 2012 10:16 am

Re: Caveman Level Understanding of Megasquirt?

Post by fj1289 »

Thanks everyone for the advice. Although studying the data sheet would be helpful I'm sure -- but I'm more interested in understanding how Megasquirt works at the soldering level vice re-engineering an ECU.

I'm trying to understand what I/O I might be able to use in a MS3 Base V3.0 build.

I looked through the sample MS3 project in TunerStudio. Here's what I'd like to do:

4 cylinder batch fire (or semi-sequential), wasted spark with logic level coils.
No idle valve.
No CAN devices

NEED: 2 stages progressive nitrous, sequential shift with auto shift.
WANT: shift light, tach output, data log fuel pressure and nitrous pressure.

Here is what I think will work:
INJ 1&2
IGN A&B D14 & D16

Shift IN - JS7
Shift OUT - D15
N2O IN - JS10
N2O 1 OUT - IAC1
N2O 2 OUT - IAC2
Shift Light - FIDLE
Tach - JS11
Fuel Pressure - JS4
N2O Pressure - JS5

Does that plan sound doable with MS3 Base V3.0?

Thanks,
Chris
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Caveman Level Understanding of Megasquirt?

Post by dontz125 »

That can be done - with those very pins! - with either an MS2 or MS3. Note that you also have one more digital input (if needed) in PE1 / Pin 15; this needs a delicate daughter card mod for use with the MS2. JS4 & 5 can be 0-5 ADC inputs, or digital inputs.
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
jsmcortina
Site Admin
Posts: 39618
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Caveman Level Understanding of Megasquirt?

Post by jsmcortina »

As Jean says, the MS3base/V3.0 Hardware Manual has a list of I/O available and what it can be used for.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
fj1289
Helpful MS/Extra'er
Posts: 112
Joined: Mon May 07, 2012 10:16 am

Re: Caveman Level Understanding of Megasquirt?

Post by fj1289 »

My intro to megasquirt came through microsquirt - where things are a bit more cut and dry. The microsquirt hardware manual, 3.7.1 shows the functions available on each I/O. I understand this type of table isn't realistic for the V3.0 MS2 or MS3 due to the customization that can be accomplished on various circuits. That's the knowledge gap I'm trying to bridge. I appreciate everyone's input. The MS3Base V3.0 Hardware Manual has the "overall" table in 3.3.3, and usage specific info in places like 3.4.10 and 3.4.9, and references to those in the short VSS section 3.4.14. It's also taken me a while to sort out the different naming references for CPU pin names/numbers/pads/jumpers/DB37 pins/function names and how most of those interact. Compared to microsquirt where everything pretty much goes by the function name.

I also forgot to include a VSS input last night. Is PE1 / pin 15 suitable?

I'll move specific questions about the VSS - sensor specifics and conditioning circuits - to the MS3 forum.

Thanks again,
Chris
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Caveman Level Understanding of Megasquirt?

Post by dontz125 »

PE1 can be used for a digital VSS input. You want some sort of guard circuit; a series diode (band away from the processor) and a 1k pull-up to 5v will suffice for a Hall sensor. A 12v pull-up outboard of the series diode can make for a stronger signal, especially in a noisy environment.

If using a VR sensor, something like the jbperf Dual VR board is a compact and economical unit, and - if mounted inside the MS case - is all the conditioning / guard circuitry needed.
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
fj1289
Helpful MS/Extra'er
Posts: 112
Joined: Mon May 07, 2012 10:16 am

Re: Caveman Level Understanding of Megasquirt?

Post by fj1289 »

dontz125 wrote:PE1 can be used for a digital VSS input. You want some sort of guard circuit; a series diode (band away from the processor) and a 1k pull-up to 5v will suffice for a Hall sensor. A 12v pull-up outboard of the series diode can make for a stronger signal, especially in a noisy environment.
I plan to reuse a 3 wire hall sensor previously used with a DL-32 datalogger. It requires magnets (will be on brake rotor bolts) to activate. It looks like it is a Littelfuse Hall Sensor 55100 3H02A 0705 - previously sold by motorsorts innovation as part number S-365 I think.

Does the 12 volt pull-up get installed in addition to the 5 volt? Just on the other side of the series diode? And I assume the diode to ground also gets used as shown in the top figure in 3.4.10 in the MS3Base/V3.0 Hardware Guide?

Thanks for your time and advice
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Caveman Level Understanding of Megasquirt?

Post by dontz125 »

fj1289 wrote:Does the 12 volt pull-up get installed in addition to the 5 volt? Just on the other side of the series diode? And I assume the diode to ground also gets used as shown in the top figure in 3.4.10 in the MS3Base/V3.0 Hardware Guide?
Yes, yes (at least 1k), and yes; make sure the band of the anti-reverse diode is towards the processor.
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
fj1289
Helpful MS/Extra'er
Posts: 112
Joined: Mon May 07, 2012 10:16 am

Re: Caveman Level Understanding of Megasquirt?

Post by fj1289 »

Thanks Don

If I want to operate the shift solenoid without using an external relay (to keep the wiring as simple as possible this time - last build used 11 relays) would I use the circuit on page 48 of the MS3Base/V3.0 Hardware Guide that uses a TIP122? Or the high current ignition circuit on page 73 that uses a BIP373? Or is there a better option?

Thanks,
Chris
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Caveman Level Understanding of Megasquirt?

Post by dontz125 »

If you have the Q16 installed, go with it. Otherwise, probably any TO220 transistor would do the job, including the TIP122. Run a jumper from D15 (with a base resistor inline - R330 for a BIP, 1k for most others) to IGBT_In; jump out IGBT_Out to IGN; jump out R43. Delete R57.

I wouldn't want to use a relay to drive a shift solenoid due to the possibility of latency / lag in the relay armature.
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
fj1289
Helpful MS/Extra'er
Posts: 112
Joined: Mon May 07, 2012 10:16 am

Re: Caveman Level Understanding of Megasquirt?

Post by fj1289 »

It's a wonder it all worked at all - much less as well as it did! Almost every interface between the microsquirt and the other systems (primarily a nitrous progressive controller and a shift-counter to act as a poor gear position sensor) required a relay to reverse the signals both going into the microsquirt as well as coming out. At some point an "upgrade" to the setup defeated the auto shift I setup using a programmable output and required me to add another swap relay for the shift solenoid too.

It's time to "step it up" and do as much as possible with the megasquirt and quit "bandaid-ing" the rest.

I will use solid state relays to drive the nitrous solenoid. And two relays for main power and the fuel pump are hopefully the only relays needed!

Thanks again for your help - it'll be critical to me learning what needs to be done -- and hopefully answers someone else's questions along the way.
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Caveman Level Understanding of Megasquirt?

Post by dontz125 »

Seriously.jpg
Something is very wrong with that set-up. Would you be interested in emailing your wiring diagram and .msq, and I'll take a look?
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
fj1289
Helpful MS/Extra'er
Posts: 112
Joined: Mon May 07, 2012 10:16 am

Re: Caveman Level Understanding of Megasquirt?

Post by fj1289 »

The wiring diagram I drew is on my work computer. I'll post it tomorrow.

Some of the issues -- the output from the shift counter is 12v (used to activate nitrous in 2nd gear). That needed to be swapped to ground to activate the nitrous routine in the microsquirt. I used the nitrous out from the microsquirt to activate the nitrous controller. Another solenoid to swap ground to 12 volt. Similar issue with the shift counter - 12 volt signal to activate, ground needed for microsquirt input.

Yes - it was a mess - even with labels on the relays and a wiring diagram!
fj1289
Helpful MS/Extra'er
Posts: 112
Joined: Mon May 07, 2012 10:16 am

Re: Caveman Level Understanding of Megasquirt?

Post by fj1289 »

dontz125 wrote:If you have the Q16 installed, go with it. Otherwise, probably any TO220 transistor would do the job, including the TIP122. Run a jumper from D15 (with a base resistor inline - R330 for a BIP, 1k for most others) to IGBT_In; jump out IGBT_Out to IGN; jump out R43. Delete R57.

I wouldn't want to use a relay to drive a shift solenoid due to the possibility of latency / lag in the relay armature.
If I setup D15 through a 1K resistor to Q16 (VB921) as above - will I still get the spurious pulse at power on as mentioned for the logic output on pg 80? If so, I'll need to use this circuit for something else like the shift light. A spurious signal to the air shift solenoid could bend shift forks without the engine running.

Thanks,
Chris
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Caveman Level Understanding of Megasquirt?

Post by dontz125 »

Run your jumper from the connection of R27 and Q7 (delete Q7 if building it yourself, and run the jumper from the base hole) to IGBT_In. No spurious pulse, and the signal isn't inverted. Also, if the solenoid is connected to 12v through the Fuel Pump Relay, it doesn't receive any power until the MS is fully booted up and ready to control its peripherals.

Oh, yes - when mentioning something like "pg 80 in the manual", it's helpful to specify WHICH manual you're referring to - there are currently *EIGHT* manuals for MS3 1.4.x ... :shock:
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
fj1289
Helpful MS/Extra'er
Posts: 112
Joined: Mon May 07, 2012 10:16 am

Re: Caveman Level Understanding of Megasquirt?

Post by fj1289 »

Sorry about the manual reference!

Built the circuit. The junction of R27 and Q7 is the "bottom" of R27 vice the "top" of R27 -- so this uses the resistor.

Since this board is already built - do I need to remove Q7? Or leave it in place?

Thanks
Post Reply