91.305 home

WED MAY 5
&bull assignment 9: cache memory pdf
due Wed May 12
&bull microprocessor design article pdf

WED APR 14
&bull archlab part B practice html

FRI APR 2
• assignment 8: archlab parts A and B
due Mon Apr 12
    tar
    sum.ys starter file
    pdf handout
for Mon Apr 12: Part A, sum.ys and rsum.ys only

FRI MAR 26
• assignment 7: bomblab
    pdf due Fri Apr 2
    BOMBLAB README txt
    gdb notes pdf txt

FRI MAR 12
• assignment 6 answers out
• mid-term review txt

WED MAR 10
• assignment 4 handed back w/answers

MON MAR 1
assignment 6: memory-mapping and the stack pdf due Mar 10
• appendix b pdf
• cy6264 pdf
• expanddemo.s s
• mystery5000.rel rel

NOTE: THERE IS NO ASSIGNMENT 5.

FRI FEB 20
assignment 4: the HC11 pdf due Feb 27
• java setup html
README FIRST!
• intro to 6811 pdf
• m68hc11e manual pdf
HC11Boot.java
Serial.java
beep.s
BootLoad.java
ReadRel.java
serialxmit.s
BootTerm.java
BootTermSafe.java
analogdemo.s
the above files in a zip

THU FEB 19
• assignment 2 answers out

WED FEB 11
assignment 3b: transistor ckts html due Feb 18

MON FEB 9
• sch draw hints pdf
• volt div, trans reading – no link
assignment 3: state machines pdf due Feb 18

FRI FEB 6
univ closed – class canceled

WED FEB 4
• uml305dev manual pdf
• uml305dev checkout pdf
• datasheets html

MON FEB 2
• labkits distributed
assignment 2: transistors, gates, & mystery chips pdf due Feb 9
• Horowitz/Hill logic implementations no link

WED JAN 28
assignment 1: historic computer html due Jan 30

resources 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: Friday, 20-Feb-2004 09:29:21 EST by fred_martin@uml.edu