Page 1 of 1

CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 10:17 am
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?

Re: CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 10:18 am
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

Re: CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 10:34 am
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.

Re: CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 10:38 am
by jsmcortina
Megasquirt doesn't support industry CAN, so this might not help you?

James

Re: CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 11:07 am
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!

Re: CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 11:25 am
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

Re: CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 11:40 am
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.

Re: CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 12:05 pm
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

Re: CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 12:21 pm
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. :?

Re: CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 12:28 pm
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.

Re: CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 12:30 pm
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

Re: CAN (Controller Area Network) support for Megatune

Posted: Tue Oct 26, 2010 2:56 pm
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!

Re: CAN (Controller Area Network) support for Megatune

Posted: Sat Oct 06, 2012 10:32 am
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

Re: CAN (Controller Area Network) support for Megatune

Posted: Sun Oct 07, 2012 3:41 am
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