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)
- 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.
- 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.
- 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.
- Download
the MegasquirtEmulator. Unzip it into any convenient
directory, let’s call it <your eclipse> from here on.
- 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.
- 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.
- Use
“Help->Help Contents” for more information on using this eclipse based
emulator.
Install the MegasquirtEmulator Plugin (each update):
- Download
the updated megasquirt emulator plugin from MegasquirtPlugin.zip into <your
eclipse>\eclipse\MegasquirtPlugin.zip.
- Unzip
the jar file in place. You should
see the new MegasquirtEmulator plugin in <your eclipse>\eclipse\plugins, check the version number.
- Restart
eclipse.
Troubleshooting
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
- Add
I/O registers to the registers group view
- Context
sensitive assembler editing (very low priority)
- MSII
support (even lower priority as I don’t own one…)
History
- 01/29/2007 Updated to version 1.3.0.0
- updated for compatibility with the latest eclipse runtime
- 08/01/2006 Updated to version
1.2.0.0
- added a viewer of the emulator outputs (Indicators)
- added a control for emulator inputs (Channels)
- added “jump to line”
- 07/23/2006 Updated the emulator
and the plugin to version 1.1.0.0
- added a built in assembler function, CASM
- added help
- 07/21/2006 MegasquirtEmulator
for Eclipse, version 1.0.1.0
- converted to using the eclipse debug framework
- 06/27/2006 68HC908 Emulator
Version: 0.5.1 alpha
- added megatune emulation support for different
versions of MSNSE
- 06/24/2006 68HC908 Emulator
Version: 0.5.0 alpha
- fixed the loading process (megatune ws timing out and failing)
- updated ComEmulDrv to work properly with Megatune
- 06/22/2006 68HC908 Emulator
Version: 0.4.0 alpha
- added Megatune emulator mode for easier flash
loading
- 06/03/2006 68HC908 Emulator
Version: 0.3.4 alpha
- minor performance and function tweaks
- 06/03/2006 68HC908 Emulator Version:
0.3.3 alpha
- minor performance and function tweaks
- 06/01/2006 68HC908 Emulator
Version: 0.3.2 alpha
- fixed duplicate listeners on list problem (performance)
- 06/01/2006
68HC908 Emulator Version: 0.3.1 alpha
- fixed crash in source viewer from invalid number
- 05/29/2006
68HC908 Emulator Version: 0.3.0 alpha
- fixed some weirdness when changing between comm. ports and console input
(blocking I/O calls are so frustrating!)
- add INTSCR (meaning external (coil) IRQs will
be blocked until the rest of the system is running)
- processor control: StepOver (execute
subroutine, break on return), StepInto (normal
step), StepReturn (break on next RTI or RTS at
current stack level)
- UI – added pop-up menus to most panels for extra function
- UI – added a memory monitor (memory viewer using symbol names)
- Added save/load for breakpoints, memory monitor
- fixed an error in the MUL instruction
- fixed a problem with the carry flag for the SUB and SBC instructions
- hover help for most UI screens, buttons, lists
- 05/14/2006
68HC908 Emulator Version: 0.2.2 alpha
- initial control panel for I/O control, including the ADCC and button to
generate an IRQ from the ignition system.
- added display and creation of breakpoints from the source view
- fixed a problem with the TXS and TSX instructions that was causing an
incorrect stack location during execution
- fixed problem with SCIM emulation causing transmitter overruns
- new basic features which can be found in the main menu
- breakpoint register conditions
- execution log: save to file, double click on line to jump to line in
source view
- search function in source view, add/remove breakpoints from source
window
- 05/01/2006
68HC908 Emulator Version: 0.2.1 alpha
- added Clock Generator Module (PLL) simulator
- add A/D converter simulator (ADCC)
- corrected CARRY & OVERFLOW flag error
- fixed BRCLR problem
- fixed BHI problem
- added SourceViewer for symbolic debugging
o can’t get the source view to
show the program counter location until the user clicks once in the SourceView text area
- 04/28/2006
68HC908 Emulator Version: 0.2.0 alpha
- added flash memory: control
- fixed SCIM– default was always console
- 04/28/2006
68HC908 Emulator Version: 0.1.1 alpha
- added support for Std (console) input & output
- 04/27/2006:
68HC908 Emulator Version: 0.1 alpha – first external release
My home page:
Mike's 250lb Locost Site