Arduino to MS?

This forum is for the discussion of other projects on Megasquirt/Microsquirt hardware that don't fit into any of the other forums

Moderators: jsmcortina, muythaibxr

Post Reply
aut0m4tic1
Experienced MS/Extra'er
Posts: 201
Joined: Mon Feb 06, 2012 12:32 pm
Location: Layton, Utah

Arduino to MS?

Post by aut0m4tic1 »

Has anyone successfully connected an arduino to the MS? I see the loguino project, but it is super technical, and more than I need for simple testing. I want to connect the arduino to the db9 connector and show the data on the serial termial of the arduino IDE.
I have piggybacked on the TTL connectors of my linvor bluetooth dongle, and I can see the phone pinging the MS. The problem seems to be rx at the 115200 baud rate with the arduino. I'm pretty new with Arduino so i might not even realize that I'm in over my head...
Thanks guys
aut0m4tic1
SymTech Laboratories
Super MS/Extra'er
Posts: 2188
Joined: Sun Aug 31, 2008 4:02 pm
Location: South Florida, USA
Contact:

Re: Arduino to MS?

Post by SymTech Laboratories »

aut0m4tic1 wrote:Has anyone successfully connected an arduino to the MS? I see the loguino project, but it is super technical, and more than I need for simple testing. I want to connect the arduino to the db9 connector and show the data on the serial termial of the arduino IDE.
I have piggybacked on the TTL connectors of my linvor bluetooth dongle, and I can see the phone pinging the MS. The problem seems to be rx at the 115200 baud rate with the arduino. I'm pretty new with Arduino so i might not even realize that I'm in over my head...
What role is the Bluetooth dongle playing? Are you trying to monitor data between your MegaSquirt ECU and a remote PC through the Bluetooth dongle? If so, that'll be difficult to get to work.

You can connect your Arduino to your MegaSquirt ECU like any other serial device. You will need a TTL-to-RS-232 converter IC (i.e. MAX232), and three connections to the MegaSquirt ECU's DB9 connector: Rx, Tx, and ground. The Arduino should be able to handle the 115200 baud rate. The rest is all in the software:

http://arduino.cc/en/Reference/serial
http://www.msextra.com/doc/ms2extra/RS232_MS2.html
SymTech Laboratories, LLC ----- MSQ File Repository: megasquirt.symtechlabs.com
Image
aut0m4tic1
Experienced MS/Extra'er
Posts: 201
Joined: Mon Feb 06, 2012 12:32 pm
Location: Layton, Utah

Re: Arduino to MS?

Post by aut0m4tic1 »

The bluetooth dongle was just a convienient place to access the data stream and wont be used in the future. Im hoping to log a few parameters on the arduino and make a small display. Its not for an actual need, just fun to learn...
colossusuk
MS/Extra Newbie
Posts: 10
Joined: Tue Mar 23, 2010 3:48 pm
Location: Hertfordshire, UK

Re: Arduino to MS?

Post by colossusuk »

ive connected up an arduino to MS2extra fine, however i had to use the on board hardware serial port on pins 0 and 1 i believe, instead of using the softserial as it couldnt keep up with the high baud rate, also and this was the most important thing, i had to increase the serial buffer from the arduino default of 128bytes (i think), to something bigger, say 200bytes so that it would be able to buffer the 'a' serial command which used something like 154bytes - depending on firmware version. you can check this in the megasquirt.ini file to see how many byes it needs.

ive no experence of using bluethooth with the arduino/ms but this was with the arduino connected directly via a max232 chip to the MS2.

hopefully that helps.

cheers,

james.
aut0m4tic1
Experienced MS/Extra'er
Posts: 201
Joined: Mon Feb 06, 2012 12:32 pm
Location: Layton, Utah

Re: Arduino to MS?

Post by aut0m4tic1 »

Thanks James!
Im kind of new to arduino and the buffer bit really helps. I'll give it a go in the next few days.
colossusuk
MS/Extra Newbie
Posts: 10
Joined: Tue Mar 23, 2010 3:48 pm
Location: Hertfordshire, UK

Re: Arduino to MS?

Post by colossusuk »

thats ok :)

but in regards to changing the serial buffer, basically you need to edit one of the header files within the arduino ide, its like a one line change, and then the next time you compile your program it will use the new larger buffer you have and should start working :)

have a look at this web page, it should tell you what you need to do, but obviously make it bigger and not smaller!!

http://www.ladyada.net/library/arduino/hacks.html
Post Reply