91.305 home

FRI DEC 12
finals study guide txt
bombs source code directory

MON DEC 8
gdb notes pdf txt

FRI DEC 5
bomblab (ass'n 11) pdf
bombs directory
due fri dec 12

WED DEC 3
adv cpu topics txt
pls rtn kit on friday! pdf
pls do course eval! html

MON DEC 1
assignment 10: caches pdf
  due fri dec 5

FRI NOV 14
assignment 9: pipe optimization pdf
  files tar

FRI NOV 7
assignment 8: cpu research pdf

TUE NOV 4
take-home midterm due Wed Nov 5 pdf

MON NOV 3
assignment 7 practice pdf

FRI OCT 31
assignment 7: y86 and seq pdf due Nov 7
  assignment7.tar tar
  ass'n 5 back
  ass'n 6 back
  ass'n 6 answers
  ISA slides pdf
  SEQ slides pdf

WED OCT 22
midterm (open data sheets, ass'n 6 not included)

MON OCT 20
midterm review
  notes txt

WED OCT 15
assignment 6b: mapping a RAM pdf
  due Oct 20 (along with Ass'n 6)
  6.270 hardware pdf
  Cypress 6264 8K RAM pdf
  Handy Board schem gif
  68HC11 big manual pdf

FRI OCT 10
assignment 6: address decoding pdf
  due Oct 17
  expanddemo.s
  mystery5000.rel

MON OCT 6
assignment 5 pdf
  due Oct 15
  README FIRST!
  BootLoad.java
  ReadRel.java
  Serial.java
  serialxmit.s
  BootTerm.java
  BootTermSafe.java
  analogdemo.s

MON SEP 29
intro to 6811 pdf
m68hc11e manual pdf
assignment 4 pdf html
  due Oct 6
  java setup html
  HC11Boot.java
  Serial.java
  beep.s

WED SEP 24
garage state machine pdf

MON SEP 22
logic implementation of eqns pdf tiff

FRI SEP 19
assignment 3 pdf html due Sep 29
logic eqn reading from Fletcher no link

MON SEP 15
schematic hints html pdf
mystery hints pdf

FRI SEP 12
transistor reading from horowitz/hill no link
pp 117-141 from Tanenbaum no link

MON SEP 8
assignment 2 pdf due Sep 15
data sheets html
uml305dev html pdf
parts list pdf

WED SEP 3
assignment 1 pdf due Sep 8

resources COURSE EVAL ikonboard software data links

Installing & Configuring Java for HC11Boot

This document explains how to:

  • install Sun's Java Development Kit (JDK) on a Windows PC;
  • install the javax.comm serial communications library and driver;
  • compile the HC11Boot.java test program for communicating with your 68HC11;
  • run the HC11Boot program and have it download a tiny test program onto your 68HC11.

These instructions are based on the use of JDK version 1.1.8, which is old, but (a) works just fine, and (b) is way smaller and simpler than the latest stuff.

You are also free to use the machines in the Engaging Computing Lab (OS306). These machines already have JDK 1.1.8 installed per these instructions.

At the end of this document, there are notes for using the HC11Boot.java program on non-Windows computers.

Your Own PC

The following instructions are for those of you who wish to set up your own PC for development.

Installing JDK 1.1.8

You will need to download and install Sun's Java Development Kit.

I recommend the old 1.1.8 version because it's smaller and faster than the latest versions and it runs perfectly well. So the instructions that follow will assume you're taking my suggestion and using this obsolete, but eminently functional, version of Java. You are of course free to download and install the latest-and-greatest, but then you'll have to adapt the instructions accordingly on your own.

First download the 1.1.8 JDK from Sun. You may use their URL http://java.sun.com/products/archive/jdk/1.1.8_010/index.html or you may retrieve a local copy.

Run the installer, and the whole system will get installed under C:\JDK1.1.8\.

Installing javax.comm

javax.comm is the name of the standard libraries created by Sun for interacting with a serial port from the Java language. I have created a tiny zip download that has precisely the three necessary files and an installer batch file for putting them in the right place.

Download the javax.comm for JDK118 zip file and extract it into a temporary directory. There will be three files and an installer batch file named install-JDK118.bat. Run the batch file (double-click on it), and the following files will be copied to the following directories:

  • win32com.dll to C:\JDK1.1.8\BIN\
  • comm.jar to C:\JDK1.1.8\LIB\
  • javax.comm.properties to C:\JDK1.1.8\LIB\

After the installer runs, check that the three files are indeed in their specified locations.

Configuring Paths

Now you need to tell your PC where the Java binaries are located (they're in C:\JDK1.1.8\BIN\). Also, you need to create an environment variable named CLASSPATH that tells the Java software about the new comm.jar communications library.

The way to do this is to modify the Environment Variables setting. Go to the Control Panels, then open the System icon. From the System Properties window that then opens, click on the Advanced tab. Then, click on the Environment Variables button.

The Environment Variables window will show. In the bottom half are the System Variables. There will already be an entry for the PATH. You want to add on to the end of the existing value, so select PATH, click the Edit button, right-arrow to the end, and then add:

;C:\JDK1.1.8\BIN\

Note the initial semicolon.

Then you'll want to create a CLASSPATH environment variable. Click the New button, type CLASSPATH into the name field, and set its value to be:

.;C:\JDK1.1.8\LIB\COMM.JAR

Note the initial period, then a semicolon, followed by the location of the communications .jar file.

Now boot up a DOS shell (Start Menu:Run and type cmd or, if, on an older Windows machine, type command). At the shell, type java . If you see a bunch of text starting with usage: java [-options] class etc. then you're all set.

Compiling the HC11Boot.java and Serial.java Files

OK, you're ready to compile Java code! Create a directory for your work, download the two test files for this exercise (use Assignment 3: Files link on left menu), and put them both into the directory:

  • Serial.java—a small library for opening, reading, and writing to the serial port.
  • HC11Boot.java—a driver program for bootstrap download into the 68HC11E chip's internal RAM.

Please note that Java is case-sensitive with respect to filenames, so the files must have the proper capitalization when installed on your disk: Serial.java and HC11Boot.java.

Now, from the MS-DOS command shell, change directory (the cd command) to the directory where these two files are located, and compile them together by typing:

javac *.java

If you didn't get any errors, it worked! You should now have two additional files named Serial.class and HC11Boot.class.

If you got an error related to javax.comm, it probably has to do with the CLASSPATH setting. Go back and make sure you did that step properly. Type set at the command shell and it should show you the CLASSPATH value.

Running HC11Boot to Discover Serial Ports

Now let's run the HC11Boot.java program. Still at the command shell, type:

java HC11Boot

Again, please note that you must follow the capitalization HC11Boot exactly.

When run without arguments, the HC11Boot program displays a list of available serial ports. You should see a result like:

Usage: HC11Boot serial-port
Available ports are:
  COM1
  COM2

If you get at least one serial port showing up as available, congratulations! You're now ready to talk to your 68HC11; skip to the next step.

If you instead got the message “no ports found”, there are a couple of possibilities:

  • There actually aren't any serial ports available on your system—either the low-level comm port drivers are not installed right, or other programs have them open.
  • The javax.comm drivers are not installed properly.

To see if you should have available serial ports, please run the standard communications package HyperTerminal (it may already be on your machine; check Start Menu->Accessories->Communications). See if it presents you with any serial ports to connect to. If yes, then it's likely a javax.comm setup problem—skip to the next paragraph. If HyperTerminal did not give you any COM port choices, then you likely have a lower-level serial driver problem. This would be beyond the scope of this document, but resolution generally involves a trip to the Device Manager in Windows' System Control Panel, and in extreme cases, change to your CMOS machine configuration.

If you suspect a javax.comm configuration problem, make sure that the win32comm.dll file is properly in the JDK bin directory and that the javax.comm.properties file is in the JDK lib directory.

Running HC11Boot to Load a Program on your 68HC11

The function of the HC11Boot program is to install a program into the 68HC11E's 512 bytes of internal memory using the chip's bootstrap download feature.

The distribution version of the file installs a three-instruction program that turns on bit 4 of the Port A register. This is represented with the following excerpt from the HC11Boot.java file:

buf[i++] = (byte)0x86;  // RAM loc 0 -- LDAA with 0x10
buf[i++] = (byte)0x10;  //         1         0x10 (bit 4 on)
buf[i++] = (byte)0xb7;  //         2 -- STAA extended to 0x1000
buf[i++] = (byte)0x10;  //         3         0x10
buf[i++] = (byte)0x00;  //         4         0x00  (the PORTA reg)
buf[i++] = (byte)0x7e;  //         5 -- JMP extended to 0x0005
buf[i++] = (byte)0x00;  //         6         0x00
buf[i++] = (byte)0x05;  //         7         0x05 (loop the JMP!)

The three instructions are LDAA 0x10, STAA 0x1000, and JMP 0x0005. These instructions put the number 0x10 into the A register, store this value to the PORTA data register—thereby setting the Port A 4 bit high—and then loop endlessly.

Now we are ready to download this program to the 68HC11.

OK, you've got a valid serial port, probably COM1 or COM2 since you're on a PC. Plug your assembled 68HC11 system into the serial port using your DB9 cable.

Turn the board on. LED8, which should be hooked up to the 6811's TxD, should be off. This indicates that the 6811 is correctly in the bootstrap mode (power on but TxD LED off).

Also, the probe LED indicating the state of PA4 should be green, indicating logic low. This is the default power-on state of the PA4 output.

Type at the MS-DOS prompt:

java HC11Boot COM1

replacing COM1 with whichever serial port you are using, of course.

The green SER-IN LED on the UML305DEV board should start flashing.

The LED8 HC11 TxD indicator should also flash, as the 6811 replies to the host computer while the bootstrap download is happening. (The TxD isn't hooked back to the PC, so the replies aren't received, but that's OK.)

When the flashing is done and the HC11Boot program has finished, the probe LED should turn red, indicating logic high. Then little boot program has run and set PA4 to a one! Also, the LED1 TxD indicator should turn on fully.

If all this works, congratulations! Your 68HC11 system is up and running.

If you didn't get the PA4 to turn to one, then check all of your wiring and try again. You may need to come to lab where we have more advanced tools for debugging the set-up.


Notes for Non-Windows OSes

The only special trick for running on non-Windows OS'es is finding a replacement for the javax.comm libraries.

There is an open-source initiative located at http://www.rxtx.org for making replacement javax.comm-compatible drivers for lots of different OS'es. From this site, download, configure, and install the rxtx drivers appropriate for the OS you are running.

There are version of the rxtx software with the comms routines located either in the javax.comm package or a gnu.io package. Use the version that has the stuff in javax.comm.


Last modified: Monday, 29-Sep-2003 09:14:36 EDT by