Miata Turbo Forum - Boost cars, acquire cats.

Miata Turbo Forum - Boost cars, acquire cats. (https://www.miataturbo.net/)
-   ECUs and Tuning (https://www.miataturbo.net/ecus-tuning-54/)
-   -   Arduino as ECU? (https://www.miataturbo.net/ecus-tuning-54/arduino-ecu-50695/)

bloodline 02-25-2011 08:49 AM


Originally Posted by JustinHoMi (Post 692607)
I think you'd lose developers if you switched to C#. Check out this arm-based arduino clone:

http://leaflabs.com/

If I wanted to take an Arduino ARM (for some serious power), this is the board I would use :) the NETduino is not great for embedded development, I certainly wouldn't go near C# for this type of work. I already consider the C++ subset the arduino uses a little too high-level ;)

My current ARM platform is the lovely mBED, but that is another project ;)

bloodline 02-25-2011 08:57 AM


Originally Posted by FieldEffectDave (Post 692584)
Is it possible to build fast accurate hardware timers in a CPLD device?

http://hackaday.com/2008/12/11/how-t...-devices-cpld/

I am wondering would it be possible if you built something like the above and have the CPLD do the time critical tasks of ignition and injection timing and leave the arduino to read A2Ds perform the calculations for injection time and ignition advance and transfer this to the CPLD. (Maybe with a parallel bus?)

Where I am getting at is you abstract all the timing critical tasks out of the Arduino and leave the "fun" stuff for a larger spectrum of enthusiasts to play with, within the Arduino development environment?

I've not used CPLDs, but I did think about using an FPGA... Bit really once you go down that route, the project needs more advanced soldering and multilayer technology.

Ideally the custom electronics should be no more than a simple board with a few discrete components that sit between the miata ECU plug (engine side) and the Arduino :)

bloodline 02-25-2011 09:12 AM

I totally agree than we need to move the project to GITHub, but as I'm currently Job Hunting I'm not able to spend any time on this project. Also I want to freeze the current code base, as I think I've come up with a much better way to implement it. My current timing model is a little too complex, and I think we could actually use a much simpler one freeing up a lot of CPU time :)

bloodline 03-14-2011 06:44 AM

1 Attachment(s)
I local garage had a '93 MX5 write-off in and I picked up the ECU for £20. My car is a '91 but I think the computers are compatible... This ECU is a B63H... I figured that even if the board was not compatible I would at least have an ECU Plug that I could use to make an Arduino->MX5 Loom adaptor.

But opening it up, it seems I lucked out! Someone has socket mounted the CPU (and mounted a Turbo daughterboard- Help identifying this would be good)... So If I could figure out the Pinout of the MX5's CPU I could interface the ECU with the Arduino much more simply and get some real world testing done.

I am aware that the CPU is some custom 6800 (Marked MP5270 in my attached photo)... but trying to find details of it is hard.

-Edit- All the chips on the daughter board have had their markings blacked out, I have tried to remove the ink, but to no avail :(
-Edit2- Googling around suggests the CPU might be a MC68HC908AP64... reading the datasheet now...

rb26dett 03-14-2011 07:29 AM

Screw this, mannnnnnnn, swap in a 4and1 disk instead of the DSM style disk and you can run FreeEMS RIGHT NOW :-) On a 4 cyl you can run wasted spark and sequential OR COP/CNP and semi sequential/bank injection. In a few weeks I'll have added the DSM/Miata decoder and you'll be able to run them like that without the disk swap. On any hardware you want. Without restriction. Free. Libre. Gratis.

Fred.

Reverant 03-14-2011 07:33 AM

If they really wanted to run something off the shelf or somewhat ready, they would have installed a PNP Megasquirt or assembled a DIY V3 board and they would be golden by now. The point of this thread is that they want to do something completely on their own.

rb26dett 03-14-2011 07:39 AM

Urr, which drugs are you smoking dude? Next time I'm having a bad day I'd like to be that far away from the truth. There is nothing off-the-shelf about FreeEMS, what-so-ever, it's 100% DIY... to the core, to the grave.

Jeff_Ciesielski 03-14-2011 10:06 AM


Originally Posted by rb26dett (Post 701123)
Urr, which drugs are you smoking dude? Next time I'm having a bad day I'd like to be that far away from the truth. There is nothing off-the-shelf about FreeEMS, what-so-ever, it's 100% DIY... to the core, to the grave.

Do you have to write the code for it? Is it *THAT* DIY?

I'm not asking if you can, for free, unrestricted. I'm asking if you *have* to. As Reverant said, it wasn't about installing someone else's work on their cars. This is about building something completely from the ground up 100% on their own.

Now take your shitty attitude and go fuck yourself with it.

rb26dett 03-14-2011 10:34 AM


Originally Posted by Jeff_Ciesielski (Post 701155)
Do you have to write the code for it? Is it *THAT* DIY?

I'm not asking if you can, for free, unrestricted. I'm asking if you *have* to. As Reverant said, it wasn't about installing someone else's work on their cars. This is about building something completely from the ground up 100% on their own.

Now take your shitty attitude and go fuck yourself with it.

You know, I was going to tear you a new arsehole, because you need it, BUT, then I saw your sig and decided you can't be that bad after all, do pull your head in, though, before it gets knocked off ;-)

Fred.

PS, you may have mistaken me for a noob, think again.


Originally Posted by Jeff_Ciesielski (Post 701155)

Originally Posted by Joe Perez
Techsalvager, if you were my kid, I’d un-make you for being such a retard.



Jeff_Ciesielski 03-14-2011 11:43 AM


Originally Posted by rb26dett (Post 701167)
You know, I was going to tear you a new arsehole, because you need it, BUT, then I saw your sig and decided you can't be that bad after all, do pull your head in, though, before it gets knocked off ;-)

:laugh:

E-thug is thuggish.


PS, you may have mistaken me for a noob, think again.
Well now, I'm sorry I injured your sensibilities. I know who you are. I've been following the DIYEFI thing passively for a while now because I'm interested in seeing where it goes and I may yet give it a run some day if and when megasquirt stops being interesting to me. Don't make the mistake of thinking that I'm insulting your abilities. You made a dick comment, you got a dick response.

rb26dett 03-14-2011 12:36 PM


Originally Posted by Jeff_Ciesielski (Post 701195)
Well now, I'm sorry I injured your sensibilities.

No, not at all.


Originally Posted by Jeff_Ciesielski (Post 701195)
I know who you are. I've been following the DIYEFI thing passively for a while now because I'm interested in seeing where it goes and I may yet give it a run some day if and when megasquirt stops being interesting to me.

Thanks for that, I quoted you elsewhere, I hope you don't mind. I need to document the process that you're at the beginning of for the benefit of others. I find MegaSquirt* incredibly dull, because I understand it on every level. You'll have your epiphany eventually, don't worry :-)


Originally Posted by Jeff_Ciesielski (Post 701195)
Don't make the mistake of thinking that I'm insulting your abilities.

No, not sensibilities, nor abilities, nothing injured or insulted.


Originally Posted by Jeff_Ciesielski (Post 701195)
You made a dick comment, you got a dick response.

Bingo, here is the part that IS confusing, I didn't! I'm not sure what you read or thought you understood. Whatever it is, though, it's irrelevant.

The only "mistake" I made here is believing that this behaviour from you both has anything to do with forum social pecking order, which can't be argued, because it is purely subjective.

Fred.

JustinHoMi 03-14-2011 05:02 PM


Originally Posted by bloodline (Post 701113)
I local garage had a '93 MX5 write-off in and I picked up the ECU for £20. My car is a '91 but I think the computers are compatible... This ECU is a B63H... I figured that even if the board was not compatible I would at least have an ECU Plug that I could use to make an Arduino->MX5 Loom adaptor.

But opening it up, it seems I lucked out! Someone has socket mounted the CPU (and mounted a Turbo daughterboard- Help identifying this would be good)... So If I could figure out the Pinout of the MX5's CPU I could interface the ECU with the Arduino much more simply and get some real world testing done.

I am aware that the CPU is some custom 6800 (Marked MP5270 in my attached photo)... but trying to find details of it is hard.

-Edit- All the chips on the daughter board have had their markings blacked out, I have tried to remove the ink, but to no avail :(
-Edit2- Googling around suggests the CPU might be a MC68HC908AP64... reading the datasheet now...


Oooh, that's interesting. I've never seen that daughtercard before. The only one I've seen before this one is the board from Grid in Japan (http://www.grid.co.jp/direct/direct150.htm).

The only other thing I can tell you about that ECU is that it's not a USDM one. There's no barometric sensor. I know the Japanese ECU's don't have barometric sensors, but I don't know about the European units.

kakarot 03-15-2011 01:54 AM


Originally Posted by bloodline (Post 701113)
I local garage had a '93 MX5 write-off in and I picked up the ECU for £20. My car is a '91 but I think the computers are compatible... This ECU is a B63H... I figured that even if the board was not compatible I would at least have an ECU Plug that I could use to make an Arduino->MX5 Loom adaptor.

But opening it up, it seems I lucked out! Someone has socket mounted the CPU (and mounted a Turbo daughterboard- Help identifying this would be good)... So If I could figure out the Pinout of the MX5's CPU I could interface the ECU with the Arduino much more simply and get some real world testing done.

I am aware that the CPU is some custom 6800 (Marked MP5270 in my attached photo)... but trying to find details of it is hard.

-Edit- All the chips on the daughter board have had their markings blacked out, I have tried to remove the ink, but to no avail :(
-Edit2- Googling around suggests the CPU might be a MC68HC908AP64... reading the datasheet now...

AllData may have the stuff you looking for. Next time I get a chance to play with one (during this week) I will search for it.

bloodline 03-16-2011 09:44 AM

After reading the datasheet, it looks like the 68HC9 is a pretty standard 6800 in a 42pin package with a bunch of GPIO and 8 analogue inputs.

Now a question for the hardware guys, if I remove the CPU (and the daughterboard), then test the signal between a pin on the ECU plug and a pin on the CPU socket, will I be able to see what is connected to what... Given the very small amount of logic on the mainboard and the high IO count of the CPU, I am going to assume that for many pins there will be a 1:1 relationship between at least some of the signals on the CPU plug and the ECU plug... Can I assume this? Really, I would prefer if someone had a schematic for the ECU... Any joy?

FieldEffectDave 03-16-2011 01:08 PM


Originally Posted by bloodline (Post 702165)
After reading the datasheet, it looks like the 68HC9 is a pretty standard 6800 in a 42pin package with a bunch of GPIO and 8 analogue inputs.

Now a question for the hardware guys, if I remove the CPU (and the daughterboard), then test the signal between a pin on the ECU plug and a pin on the CPU socket,

Its not really that easy to determine by simple probing: EG inputs might have common pullups, which means simple probing would find they are all sort of connected together. Output drivers are not going to have a testable connection between the uC pin and the connector pin.

The best way is to slowly work backwards from the ECU connector and reverse engineer the complete schematic.

I actually was planning to do this for the whole ECU anyway, mainly because I am interested in comparing the hardware input / output circuits and components we use in megasquirts to what was chosen for the OEM design. (And compare design margins etc...)

Should receive an ECU any day now hopefully and I will start, ill will take a photo of the PCB when I get it, I wonder how many variants of ECU there might be and how much they will differ internally?

JustinHoMi 03-16-2011 01:16 PM

I've spent a little while reverse engineering some of the circuits. You do have to be careful "copying" circuits from the OEM ECU to the megasquirt. You have to take the entire MS as a whole, and realize that there's more to it than just a bunch of individual circuits.

For instance, the OEM ECU uses a 10k resistor along with two caps to filter the AFM signal. The megasquirt suggested circuit for a MAF is a 2.2k resistor and two caps. If you compare the circuits you'll see that the OEM circuit has quite a bit more smoothing, which makes sense. However, if you look at the datasheet for the megasquirt's CPU, you'll see that they warn against using any resistor 10k or higher on the analog inputs, otherwise it could affect the timing of the readings.

bloodline 03-16-2011 03:20 PM


Originally Posted by FieldEffectDave (Post 702268)
Its not really that easy to determine by simple probing: EG inputs might have common pullups, which means simple probing would find they are all sort of connected together. Output drivers are not going to have a testable connection between the uC pin and the connector pin.

Yeah... I kinda figured as much...


The best way is to slowly work backwards from the ECU connector and reverse engineer the complete schematic.
I have no experience with hardware reverse engineering :(


I actually was planning to do this for the whole ECU anyway, mainly because I am interested in comparing the hardware input / output circuits and components we use in megasquirts to what was chosen for the OEM design. (And compare design margins etc...)

Should receive an ECU any day now hopefully and I will start, ill will take a photo of the PCB when I get it, I wonder how many variants of ECU there might be and how much they will differ internally?
You could well be the saviour of my project then :) As long as your ECU uses the same CPU, I'm gonna guess the IO is going to be the same (or similar enough for me to have a good starting point) as my ECU.

If I can help in any way then let me know.

If I can use my spare ECU as an interface between the Engine and the Arduino, I can do some real testing of my software :)

bloodline 03-16-2011 07:49 PM

1 Attachment(s)
I removed the Daughterboard to see what was underneath. Here is a photo of the main board, the socket is where the CPU goes... and where I want to attach a new Microcontroller, probably on a new daughterboard ;)

FieldEffectDave 04-10-2011 10:25 AM

Havn't forgotten about this, just waiting for my OEM ECU to arrive!

bloodline 04-11-2011 10:49 AM


Originally Posted by FieldEffectDave (Post 712573)
Havn't forgotten about this, just waiting for my OEM ECU to arrive!

Cool! I'm busy with real life so no rush yet ;)

I'm rather keen to rewrite my code using a simpler timing model!


All times are GMT -4. The time now is 06:45 PM.


© 2024 MH Sub I, LLC dba Internet Brands