MS2-Extra

Serial connection setup

MS2/Extra manual index

Getting correct serial communications between your computer and Megasquirt is critical to enable tuning.

Almost all reported user problems are actually a computer setup problem, so follow these steps to get your settings right.

Before starting the instructions, a word of advice. As supplied, most Megasquirt-2 (in kit form) are supplied 'blank' without firmware loaded. In this case it is normal for TunerStudio to report no connection and for the firmware loopback tests to fail.

So before you get into a panic, go through steps 1-6 here to establish the correct COM port, then load the firmware to your MS2.

1. Serial connection identification.

The Megasquirt serial port




Standard DB9-DB9 straight through serial cable:




Computer DB9 serial port




Computer USB ports




Typical USB-serial cable:




2. If you computer does not have a standard serial port, as is the case with many computers over the last few years, then you probably have USB only and will need a USB-serial adapter cable.

3. If you are using a USB-serial cable then ensure you have installed the drivers (if required) before plugging in the cable for the first time.

3. Open Device Manager on your computer.

There are several ways to do this, and you may have a preferred way. If you don't know how to do this, here are directions for getting into the Device Manager for XP and Vista.

On Windows XP, right-click My Computer and select Manage. This will bring up the Computer Management screen. Select the Device Manager from the list at the left.



For Vista, click the Start button and go to the Control Panel. From there, click System and Maintenance, then click on the Device Manager from there. You may need to enter a password.




If you DO NOT see "Ports" listed in the devices then you do not have any ports setup. This would usually indicate either your forgot to plug in your USB-serial cable or there is a driver problem. Usually the best solution to the driver problem is to unplug the cable, uninstall the driver and then re-install the driver.

Alternative for Windows
Right-click and save portcheck.exe to your computer and then run it.

Sample output - in this example there is a Megasquirt 2 with MS2/Extra firmware loaded on COM1.

4. Take a note of the COM port number listed above. In this case it was COM1. Most drivers allow you to change the com port number through the device manager. Set to COM1 if it is free.

5. Use this COM port number when setting up your tuning software.

6. Hopefully that should be sufficient to get you connected.
The next step is loading the firmware to your MS2.
If you do experience problems during loading firmware, there are additional tests to try.

Serial diagnostics

In all of these tests, we will use the 'Miniterminal' found on the Communications menu of TunerStudio.
Be sure to have TunerStudio installed.

7. Start TunerStudio (or other tuning software.) Open an existing project or if necessary, create a new project.

8. Open Communications -> Miniterminal. Ensure your Megasquirt is powered and connected to your computer.
Select the port as above (i.e. if your connection was COM5 in device manager, then choose COM5 here.)
Select the baud rate.
MS2/3 = 115200 (MS1 = 9600)
Click to Open the port.

A. Serial cable loopback test
Note! This test is performed on the serial plug, not possible if your Megasquirt has USB plug only.

9. Unplug the serial cable from the Megasquirt and carefully short pins 2 & 3. This performs a "loopback" test where the serial signal should go out from the computer, through the short and back into the computer again.




10. Open MiniTerminal as above in step 7,8.

11. With the pins shorted as above, type in something to Miniterminal. Whatever you type into the top window should appear in the lower window. As shown here this indicates the computer serial end is working ok.




If test A fails, there is no point in trying the other tests

B. Firmware serial comms test
Note! This test can only be performed if firmware has already been loaded. If it has not, try the cable and CPU socket loopback tests.

12. Open MiniTerminal as above in step 7,8.

13. Type a capital 'S' and you should see a signature string returned in the lower window as shown here. If you do not then there is a serial problem somewhere.




C. CPU socket serial loopback test

14. Turn off power and remove Megasquirt case.

15. Very carefully, prise out the CPU U1. Lift it out progressively by prying up each end a fraction at a time. Be certain not to bend the pins.

16. Apply jumper betweens pins 12 & 13 of U1

17. Ensuring there are no shorts underneath the board, re-connect your serial cable and apply power.

18. Open MiniTerminal as above in step 7,8.

Any characters you type into the top window should be quite literaly "looped back" to the bottom window.

19. When done, turn off power, re-install CPU and re-install case.

Test analysis

20. If test A fails then you have a serial driver or configuration problem on your computer - consult the documentation that came with the computer or cable.
Until this test works, serial communications are not going to work.

21. If test A passes but test C fails.
Double check that there is power at your Megasquirt (measure voltage between +5V and 0V in the prototype area.) If that is ok, there might be something wrong on the Megasquirt end of things - perhaps you made an assembly error with the MAX232 (ST232) chip or associated capacitors - check for poor soldering or bridged traces.

22. If tests A and C pass, but B fails then you most likely do not have firmware installed on your processor - double check that you have loaded it and retry the 'portcheck' step above.

23. If tests A, B and C all pass but you are having problems with the tuning software, it is most likely a settings problem within the tuning software itself. Double check the COM port and baud rate.



If you have a question, comment, or suggestion for this FAQ please post it on the forum.
Last Updated: 10/07/2009 15:45

No part of this manual may be reproduced or changed without written permission from James Murray, Ken Culver and Philip Ringwood.