CAN (Controller Area Network) support for Megatune

Questions specific to Megatune. (Only about the tuning software, not about MS1/MS2 code or code features)
Note that Megatune is obsolete.
Post Reply
ESDave
MS/Extra Newbie
Posts: 18
Joined: Wed Feb 03, 2010 3:15 am
Location: Cologne - Germany

CAN (Controller Area Network) support for Megatune

Post by ESDave »

Hi,

I am sure I remember a while ago seeing some development for a CAN interface support for MegaTune.

I am really interested in perusing this and have performed a few searches but can't seem to find anything.

Is there anything out there?
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CAN (Controller Area Network) support for Megatune

Post by jsmcortina »

Megatune can already send out messages compatible with Megasquirt-CAN.

Have you read the CAN docs?
http://www.msextra.com/doc/ms3/can.html

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".
ESDave
MS/Extra Newbie
Posts: 18
Joined: Wed Feb 03, 2010 3:15 am
Location: Cologne - Germany

Re: CAN (Controller Area Network) support for Megatune

Post by ESDave »

Sorry I just twigged:

That's conceptually what I am interested in, but instead of using an entire Megasquirt ECU as a "USB to CAN" dongle has someone written a MegaTune interface driver for an off the shelf RS232 / USB CAN adaptor, eg somthing like this:

http://www.can232.com/products.htm

Actually now looking up the price... you could buy a MS2 daughter board solder it to a breadboard with an Max232 / FTDI and you end up almost at the same cost.
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CAN (Controller Area Network) support for Megatune

Post by jsmcortina »

Megasquirt doesn't support industry CAN, so this might not help you?

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".
ESDave
MS/Extra Newbie
Posts: 18
Joined: Wed Feb 03, 2010 3:15 am
Location: Cologne - Germany

Re: CAN (Controller Area Network) support for Megatune

Post by ESDave »

Agreed, the example adaptor would only work if someone had written a device driver which (in software on the PC running Megatune) packaged the CAN packets correctly in the Megasquirt protocol so the variables from MT would be end up written to the right locations in RAM by the MS. Basically emulating the CAN pass through function which currently exists in the MegaSquirt as described in your link.

My original question was, was anyone working on such a device driver for MegaTune, for any off the shelf CAN adaptors? I think the answer is no, what I probably remember is discussion on the CAN pass through feature.

What I might do is build what I proposed above, an MS2 daughter board on breadboard with an FTDI chip in a small box. Should be able to power it all off the USB 5V.

Then in theory I can update to a multi node CAN bus and tune / datalog it without carrying around a whole megasquirt to use as a USB to CAN adaptor.

Thanks for the replies!
Last edited by ESDave on Tue Oct 26, 2010 11:25 am, edited 1 time in total.
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CAN (Controller Area Network) support for Megatune

Post by racingmini_mtl »

I don't quite get what you want to do. If you want to communicate with an MS (MS2 or MS3) then I don't see the point in using a USB to CAN when you could as easily use a USB to RS232 instead. If you want to use CAN for another device then using Megatune won't work (as mentioned by James) and the MS CAN code won't work either.

So please elaborate on what you want to do and why.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
ESDave
MS/Extra Newbie
Posts: 18
Joined: Wed Feb 03, 2010 3:15 am
Location: Cologne - Germany

Re: CAN (Controller Area Network) support for Megatune

Post by ESDave »

So please elaborate on what you want to do and why.
Sorry I should have started with this.


Currently in my car I have a MegaSquirt connected via RS232 to a LCD display I put together a while ago:

http://mx5cartalk.com/forum/viewtopic.php?f=55&t=41019

It is mildly inconvenient to remove the display RS232 connection, when the serial connection is required for tuning.

So the next project was going to be update my display to use the CAN interface on the MegaSquirt.

To then move the tuning interface for the megasquirt to the CAN bus would seem the next logical step, and an "interesting" project.

But taking a step back and considering your comments I have to agree there is little tangible benefit over retaining the serial connection for tuning, apart from an "interesting" project and abit of a neater architecture in the car.

Perhaps some benefit for tuning / data logging with a bigger available bandwidth of a direct CAN connection?

I come from an electrical background, so tinkering with the electronics / communications interface side of the MegaSquirt is as much fun for me as tinkering on the car in general.
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CAN (Controller Area Network) support for Megatune

Post by racingmini_mtl »

Ok, I see now what you want to do.

Since you can already use your MS to communicate to all the CAN nodes using the RS232 port in passthrough mode, the only advantage of using another device to communicate on the CAN bus would be if you bypassed completely the RS232 and USB-to-serial drivers. This would get rid of some of the limitations and issues that these bring.

But that would require using a microcontroller that would be able to communicate natively to the USB port and have a CAN port and you'd need to develop the firmware for it as weel as the software on the PC side. That would be a quite involved project.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
24c
Master MS/Extra'er
Posts: 847
Joined: Tue Jan 20, 2009 10:21 am
Location: Lancashire UK
Contact:

Re: CAN (Controller Area Network) support for Megatune

Post by 24c »

racingmini_mtl wrote:
But that would require using a microcontroller that would be able to communicate natively to the USB port and have a CAN port and you'd need to develop the firmware for it as weel as the software on the PC side. That would be a quite involved project.
I know I am a dunce at this, but to communicate with a USB port via a microcontroller/microprocessor would mean using TTL voltage levels, as opposed to RS232, and there are dedicated chips that do this, as well as development boards with CAN interfaces on the market, that can parse, filter and convert these data streams. :?
Yamaha GTS1000 v2 MicroSquirt, B&G 2.891
Yamaha GTS1000 v3 beta MicroSquirt, B&G3.760
Yamaha GTS1000 MSExtra 3.1, Dual VR Board
Yamaha YZF1000 MSExtra 3.1
ESDave
MS/Extra Newbie
Posts: 18
Joined: Wed Feb 03, 2010 3:15 am
Location: Cologne - Germany

Re: CAN (Controller Area Network) support for Megatune

Post by ESDave »

24c wrote:
racingmini_mtl wrote:
But that would require using a microcontroller that would be able to communicate natively to the USB port and have a CAN port and you'd need to develop the firmware for it as weel as the software on the PC side. That would be a quite involved project.
I know I am a dunce at this, but to communicate with a USB port via a microcontroller/microprocessor would mean using TTL voltage levels, as opposed to RS232, and there are dedicated chips that do this, as well as development boards with CAN interfaces on the market, that can parse, filter and convert these data streams. :?
I would have been more inclined to find something off the shelf. I have used these which are very good and come with a really good software package for logging and scripting (but all priced way beyond the range of any home project):

http://www.vector.com/vi_cancase_xl_en,,223.html

But USB CAN tools are an increasing market... and they all come with .dll's to interface for custom requirements.

The work would then be write the interface between megatune and the provided .dll with your tool.

Which summarising this thread, really is alot of work for not much gain in terms of megasquirt.
Last edited by ESDave on Tue Oct 26, 2010 12:30 pm, edited 1 time in total.
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CAN (Controller Area Network) support for Megatune

Post by racingmini_mtl »

24c wrote:... and there are dedicated chips that do this, as well as development boards with CAN interfaces on the market, that can parse, filter and convert these data streams. :?
Yes but none that can convert from/to an MS CAN protocol data stream. So that would have to be done from scratch and most likely would not be possible to do with what I think you're referring to.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
richyvrlimited
Master MS/Extra'er
Posts: 568
Joined: Mon Jun 26, 2006 1:03 pm
Location: Warrington, NorthWest England

Re: CAN (Controller Area Network) support for Megatune

Post by richyvrlimited »

ESDave wrote:
So please elaborate on what you want to do and why.
Sorry I should have started with this.


Currently in my car I have a MegaSquirt connected via RS232 to a LCD display I put together a while ago:

http://mx5cartalk.com/forum/viewtopic.php?f=55&t=41019
Dave, firstly apologies for the thread hijack...

I've seen you posts before and they inspired me to have a go myself, (purchased the same display module and have an MX5 ;)) I did PM you on miataturbo.net, but I don't think you visit there any more :(

Just wondering if you have any tips/advice etc? I've not actually done anything like this before!

Cheers!
2003 MX5. Coldside MP62
-
MS3, RTC, & Knock board, Release 1.2. LC-1 Wideband.
ray80
MS/Extra Newbie
Posts: 1
Joined: Wed Oct 03, 2012 9:32 am

Re: CAN (Controller Area Network) support for Megatune

Post by ray80 »

hi

I was looking for some precise information about CAN until i found that link shared by Dave . They Discussed two ways to use CAN ; Is it specific to Mega squirt or any just any CAN network does this way ? and i am bit confused in understanding CAN - Pass Through ! How 2 Lines are differentiated by H and L . on the bases of Voltage level or Address and Data ?

Thanks
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CAN (Controller Area Network) support for Megatune

Post by jsmcortina »

Have you read the CAN and CAN-technical pages in the manual?

But also... start a new topic! Megatune is way obsolete.

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".
Post Reply