68HC908 Emulator

Last update 01/29/2007, updated to v1.3.0.0. See “History”.

Description

A java emulator of the 68HC908 processor used in the Megasquirt I boards.  It provides basic processor and memory bus emulation, debug support, and device emulation.  This allows unit test and debug of changes to the Megasquirt software written in 68HC908 assembler.

Know Issues:

1.      RPM and along with it the timers don’t seemed to be sorted yet.

Installation

Install the Eclipse MegasquirtEmulator (once only)

  1. You need to install the java runtime environment.  If you’re not java literate, download and install the Java Runtime Environment (JRE) from http://java.com/en/download/index.jsp.  If you’re already using the JDK you don’t need me to explain any part of this. 
  2. Install javax.comm package.  For some reason the Sun supported version 3.0 no longer supports windows, so use version 2.0 that you can get here: javacomm20-win32.zip.  Follow the instructions carefully.  The dll needs to be available to the runtime in <your java>\jre\bin, while the comm..jar needs to in the <your java>\jre\lib\ext directory.  The properties file must be in <your java>\jre\lib so the comm support can find it and then the dll.

 

  1. If you’re planning to run the emulator and Megatune on the same computer you need to install and configure the serial port emulator.  You need the updated version, version 0.0.4.0 that I’ve modified: ComEmulDrv4.zip.  Note that the modified version probably only works with megatune & the emulator.  I have only tested this driver under WinXP! 
    Note: The original is here: http://www.mixw.net/related.htm#tncemu, the ComEmulDrv3.zip package.  Version 3  DOES NOT work properly with megatune and the emulator.

 

  1. Download the MegasquirtEmulator. Unzip it into any convenient directory, let’s call it <your eclipse> from here on.

 

  1. This is a tricky part: follow the readme instructions in <your eclipse>\eclipse\readme.  You need to launch “eclipse.exe” by pointing it to your java exe, for example:
    "C:\Documents and Settings\polan\My Documents\Megasquirt\68hc908 Emulator\EclipsePluginTest\eclipse\eclipse.exe" -vm "C:\Program Files\Java\jdk1.5.0_07\bin\javaw.exe" -vmargs -Xmx256M
    The easiest way to do this is to create a shortcut for the eclipse.exe you’ll find in <your eclipse>\eclipse\eclipse.exe, then editing that shortcut as shown above.  Use the windows explorer to navigate to your  java installation, copy/paste the location from the properties view of the exe. 

 

  1. You start megasquirt by double clicking on the shortcut you created in the previous step.  You can use the default location for the workspace, or move it anywhere more convenient.  You will load your megasquirt system using the files from your workspace.

 

  1. Use “Help->Help Contents” for more information on using this eclipse based emulator.

Install the MegasquirtEmulator Plugin (each update):

  1. Download the updated megasquirt emulator plugin from MegasquirtPlugin.zip into <your eclipse>\eclipse\MegasquirtPlugin.zip.
  2. Unzip the jar file in place.  You should see the new MegasquirtEmulator plugin in <your eclipse>\eclipse\plugins, check the version number.
  3. Restart eclipse.

Troubleshooting

  1. Do you have the right JRE?  “java –showversion” should respond with version 1.2 or better.  If you get “program not found” or a lower version then you need to install the JRE.  I haven’t tried to get javax.comm to work with the JRE installed by windows; it’s easier if you install the JRE from sun, install the javax.comm package there and reference the java.exe program directly when you start the emulator.

  2. If you get messages such as class javax.comm… not found, double check your installation of the javax.comm package.  Watch for which java is being loaded – the one from the JDK (watch out, it contains two) or somewhere else in your system.  It’s always safer to use the full path name to the java.exe, and use the version in the jre.  Remember, the comm..jar file goes into the jre\lib\ext directory.

 

  1. When you run the emulator application you should see a list of available comm ports under the “device->CommPorts” option.  If no ports are shown you need to check the installation of the javax.comm package.  In particular check the location of the jar file, the properties file and the dll.

 

  1. You must reboot after installing the serial port emulation device driver and whenever you change the null cabled pairs settings.   You can test it by starting hyperterminal port sessions under “start->programs->accessories->communications->hyperterminal”.  Start it twice, one for each one of the pair of ports you connected using the serial port emulator.  If properly configured when you type in one window, the data should show up in the other.  If not, check the device settings and make sure you reboot after making any changes.

 

  1. Megatune hangs when you start it.  The comm ports are probably improperly configured – they exist but don’t work, or there’s nothing running on the other end of the null cable pair.  To double check, start the 68HC908Emulator jar as described above.  Start a hyperterminal session on the other port of the pair before hitting the “run” button in the console.  You can then issue commands like “T” and “S”, which should list the version of the megasquirt software that has been loaded. “!!” will bring you into the boot loader.  Megatune needs to be cancelled from the windows Task Manager if it doesn’t come up.  If you get a message that a copy of megatune is already running but you can’t find it, again the windows Task Manager can be used to find and terminate it.

 

  1. Lots of beeping and strange behavior when using megatune for realtime views and msq loading.  Check the output record length (run->run…->Megasquirt.S19->Megatune Emulation) against that specified in your megatune msns-extra.ini.  Load the source listing file (View->Source).  Check the page size length (Settings->PageSize).

Future Features

History

 

My home page:

Mike's 250lb Locost Site