Arduino as ECU? - Page 10 - Miata Turbo Forum - Boost cars, acquire cats.

Welcome to Miataturbo.net   Members
 


ECUs and Tuning Discuss Engine Management, Tuning, & Programming

Reply
 
 
 
LinkBack Thread Tools Search this Thread
Old 02-25-2011, 09:49 AM   #181
Junior Member
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

Quote:
Originally Posted by JustinHoMi View Post
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 is offline   Reply With Quote
Old 02-25-2011, 09:57 AM   #182
Junior Member
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

Quote:
Originally Posted by FieldEffectDave View Post
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 is offline   Reply With Quote
Old 02-25-2011, 10:12 AM   #183
Junior Member
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

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 is offline   Reply With Quote
Old 03-14-2011, 07:44 AM   #184
Junior Member
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

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...
Attached Thumbnails
Arduino as ECU?-ecu.jpg  

Last edited by bloodline; 03-14-2011 at 08:01 AM.
bloodline is offline   Reply With Quote
Old 03-14-2011, 08:29 AM   #185
Junior Member
 
Join Date: Feb 2007
Location: 11368 miles from where i would like to be
Posts: 269
Total Cats: 92
Default

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.
rb26dett is offline   Reply With Quote
Old 03-14-2011, 08:33 AM   #186
Supporting Vendor
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,440
Total Cats: 198
Default

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.
Reverant is offline   Reply With Quote
Old 03-14-2011, 08:39 AM   #187
Junior Member
 
Join Date: Feb 2007
Location: 11368 miles from where i would like to be
Posts: 269
Total Cats: 92
Default

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.
rb26dett is offline   Reply With Quote
Old 03-14-2011, 11:06 AM   #188
Elite Member
iTrader: (10)
 
Join Date: Oct 2008
Location: Seattle, Wa
Posts: 1,780
Total Cats: 30
Default

Quote:
Originally Posted by rb26dett View Post
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 **** yourself with it.
Jeff_Ciesielski is offline   Reply With Quote
Old 03-14-2011, 11:34 AM   #189
Junior Member
 
Join Date: Feb 2007
Location: 11368 miles from where i would like to be
Posts: 269
Total Cats: 92
Default

Quote:
Originally Posted by Jeff_Ciesielski View Post
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 **** 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.

Quote:
Originally Posted by Jeff_Ciesielski View Post
Quote:
Originally Posted by Joe Perez
Techsalvager, if you were my kid, Id un-make you for being such a retard.
rb26dett is offline   Reply With Quote
Old 03-14-2011, 12:43 PM   #190
Elite Member
iTrader: (10)
 
Join Date: Oct 2008
Location: Seattle, Wa
Posts: 1,780
Total Cats: 30
Default

Quote:
Originally Posted by rb26dett View Post
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 ;-)


E-thug is thuggish.

Quote:
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.
Jeff_Ciesielski is offline   Reply With Quote
Old 03-14-2011, 01:36 PM   #191
Junior Member
 
Join Date: Feb 2007
Location: 11368 miles from where i would like to be
Posts: 269
Total Cats: 92
Default

Quote:
Originally Posted by Jeff_Ciesielski View Post
Well now, I'm sorry I injured your sensibilities.
No, not at all.

Quote:
Originally Posted by Jeff_Ciesielski View Post
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 :-)

Quote:
Originally Posted by Jeff_Ciesielski View Post
Don't make the mistake of thinking that I'm insulting your abilities.
No, not sensibilities, nor abilities, nothing injured or insulted.

Quote:
Originally Posted by Jeff_Ciesielski View Post
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.
rb26dett is offline   Reply With Quote
Old 03-14-2011, 06:02 PM   #192
Junior Member
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 0
Default

Quote:
Originally Posted by bloodline View Post
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.
JustinHoMi is offline   Reply With Quote
Old 03-15-2011, 02:54 AM   #193
Newb
iTrader: (1)
 
Join Date: Sep 2010
Posts: 27
Total Cats: 0
Default

Quote:
Originally Posted by bloodline View Post
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.
kakarot is offline   Reply With Quote
Old 03-16-2011, 10:44 AM   #194
Junior Member
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

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?
bloodline is offline   Reply With Quote
Old 03-16-2011, 02:08 PM   #195
Newb
 
Join Date: Aug 2009
Posts: 35
Total Cats: 0
Default

Quote:
Originally Posted by bloodline View Post
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?
FieldEffectDave is offline   Reply With Quote
Old 03-16-2011, 02:16 PM   #196
Junior Member
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 0
Default

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.
JustinHoMi is offline   Reply With Quote
Old 03-16-2011, 04:20 PM   #197
Junior Member
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

Quote:
Originally Posted by FieldEffectDave View Post
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...

Quote:
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 :(

Quote:
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 is offline   Reply With Quote
Old 03-16-2011, 08:49 PM   #198
Junior Member
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

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
Attached Thumbnails
Arduino as ECU?-ecunodau.jpg  
bloodline is offline   Reply With Quote
Old 04-10-2011, 11:25 AM   #199
Newb
 
Join Date: Aug 2009
Posts: 35
Total Cats: 0
Default

Havn't forgotten about this, just waiting for my OEM ECU to arrive!
FieldEffectDave is offline   Reply With Quote
Old 04-11-2011, 11:49 AM   #200
Junior Member
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

Quote:
Originally Posted by FieldEffectDave View Post
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!
bloodline is offline   Reply With Quote
 
 
Reply

Related Topics
Thread Thread Starter Forum Replies Last Post
Raleigh: Fiberglass headlight scope, 1.6L ECU, AFM, Hardtop latches, more bigmackloud Miata parts for sale/trade 13 09-22-2017 01:34 PM
3rd Time's a Charm...hopefully. zephyrusaurai Meet and Greet 2 09-28-2015 11:59 PM
Are my coils failing? viriiguy General Miata Chat 5 09-28-2015 08:39 PM
ME221 Now has Autotune and Long Term Fuel Trim Tables Motorsport-Electronics ECUs and Tuning 0 09-05-2015 09:02 AM


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 04:39 AM.