dl11
Home Up

DL11.EXE

dl11.exe is a utility program for downloading and configuring the 68HC11 series of microcontrollers. This document will describe how to use the features of the program.

Click the following link to download the file: dl11.exe

System Requirements: Windows 95/98/NT/2000/XP

Size: 53kb

Type: Command line program

dl11 supports several options via the command line. The options, which can be viewed using no arguments to the program, consist of:

 

dl11: version Nov 29 2001 22:36:13
Copyright (c)1999-2001 Kevin Ross
www.kevinro.com

dl11: [options][-i <filename>]
        where
        -c n    n specifies COM port (1 is default)
        -i <filename> Download file as S19 file
        -v <filename> Verify S19 file against memory
        -T Enter terminal mode after download
        -E enable expanded memory bus
        -B Bulk erase EEPROM
        -h Help message
        -p Probe CPU info
        -m <e1|e2> Set chip type
        -C <n> Config register value
        -e <start>:<stop> EEPROM address range (default f800:ffff)
        -r <start>:<stop> <filename> Dump memory to S19 file
        Memory ranges are specified in hex pairs. i.e. 0xf000:0xffff

Normal operation on COM1 is as follows:
dl11 -c 1 -i myprog.s19    

Basics of how the program works

The HC11 series of parts have a special set of internal instructions called Bootstrap mode. In Bootstrap mode, the chip accepts a program coming in on the serial port. This program is stored starting at address $00, and usually extends to address $FF. Once the program has been downloaded, the CPU jumps to address $00 and starts executing code.

dl11 works by sending the CPU a special program called a talker file. The talker file is a small utility program that accepts commands to read and write memory. It can read and write either RAM or EEPROM. This small program occupies the first 256 bytes of RAM. It needs pretty much all 256 bytes, so you shouldn't plan on using this memory while downloading code. The talker program communicates with your PC at 9600 baud.

Once dl11 finishes programming your board, you can reset your chip, and it should start running the code you downloaded (assuming you set the reset vectors correctly). The talker program only needs the RAM during download. On reset, the talker program is erased from memory.

dl11 is a 'command line' program, meaning it runs in a text window. It requires Windows 95 or higher to function. Windows 95/98/NT/2000/XP should work just fine. You also need an available serial port.

The Command Line Switches

Each of the options and arguments are documented next. A couple of general notes:

bulletTo specify a filename with spaces in the name, you should put the name in double quotes. For example, dl11 -i "This Long Filename Has Spaces.s19"
bulletMemory ranges are specified in hexidecimal, and have the format 0xFFF0:0xFFFF, which are the start and end addresses of the range seperated by a colon.
bulletAll numeric values are in hexidecimal.

 

-c <n> Specifies which serial port on your PC is connected to the target 6811 board. Usually, this is a 1 or a 2. If nothing is specified, it assumes COM1:
-i <filename> Specifies the input file. The input file should be a Motorola S19 object record file. Most assemblers and compilers for the HC11 will output S19 format files.
-v <filename> Compares the contents of the input file with the current contents of the target CPU's memory. If differences are found, then the program tells you which segments are different.
-T Enter terminal mode when completed. This program has a simple terminal mode that accepts keyboard input and sends it out the serial port. It also recieves characters over the serial port, and prints them to the display. The port can only be opened at 9600 baud.

To exit terminal mode, press function key F2. To get help, press function key F1. If you downloaded an S19 file, and would liek to do it again, press F3, which will reload the S19 file from disk and send it to the HC11.

-E Enables the Expanded memory bus on the HC11. The Expanded memory bus is only used on larger boards which support external memory or memory mapped devices. If you are using a board with external memory, like a BotBoard 2 or another board such as a Tech Arts or New Micros board, you may need to use the switch to enable writes to RAM.
-B Bulk Erase cuases the EEPROM to be bulk erases just before programming. In general, it can be faster to bulk erase before loading code since each byte doesn't need to be erased.
-h Prints out the command line help.
-p Probe CPU. Prints out some of the more important registers to help determine what type of part you have, and where its resources are located.
-m Sets the chip type. Each chip has its own particular memory map and resources available. The -m switch allows you to asseign a default type of HC11 for your programming.
-C Sets the Config register. This register controls many aspects of how the part operates, such as the location of the EEPROM in the memory map, and other key values.
-e <range> Sets the range of addresses for the onchip EEPROM memory. Setting this value indicates to the program where the memory resides in the memory map. EEPROM is treated specially. Writes to bytes inside this area result in the programming of the EEPROM.

 

-r <range> <filename> Read the contents of a memory range and save it to a file. The range of memory is written to <filename> in S19 format.

 

Sample Sessions

The following sample sessions should give you the jist of how the program works.

Simple download of a program

Assuming you have a BotBoard Plus attached to COM1 of your PC, then a simple sample session looks like the following.

< Set your board to LOAD mode using the switch>

<Press the RESET button>

D:\src\nl11>dl11 -i memtest.s19 
dl11: version Nov 29 2001 22:36:13
Copyright (c)1999-2001 Kevin Ross
www.kevinro.com

Reading D:\src\nl11\memtest.s19: OK!
Download Talker to COM1: >S>W>R>OK!
f800:fd23 (EEPROM): ..........................................
fffe:ffff (EEPROM): .
Download completed. OK!    

The first three lines are the version and signon banner. The program then informs us that it is reading in the input file "d:\src\nl11\memtest.s19" which is the full path to the input file. The download of the talker is then reported. The talker downloads at 1200 baud, so it might take a few seconds. The >S means the initial sync byte of $FF is sent. >W means the talker program itself has been written. The >R means the talker is being read back to verify its validity. The >OK! means it verified.

Next comes each section of the S19 file. Memory ranges are written in chunks. This program has two chunks: F800-FD23 which is EEPROM, and FFFE-FFFF which is also EEPROM. Your particular S19 file may be different.

Download Completed means life is good, and you can run your program by selecting run mode on your target board and resetting.

Download and Debug

The following shows a common use for dl11.exe, namely downloading code and using the serial port for debugging the output. dl11.exe features a very simple 9600 baud terminal mode that you can use to do the download/debug cycle many times. In the following example, dl11 performs the download, but because of the -T switch, it enters terminal mode.

D:\src\nl11>dl11 -i memtest.s19 -T
dl11: version Nov 29 2001 22:36:13
Copyright (c)1999-2001 Kevin Ross
www.kevinro.com

Reading D:\src\nl11\memtest.s19: OK!
Download Talker to COM1: >S>W>R>OK!
f800:fd23 (EEPROM): ..........................................
fffe:ffff (EEPROM): .
Download completed. OK!

F1 prints this help
F2 exits terminal mode
F3 Download 'D:\src\nl11\memtest.s19' again
Entering Terminal Mode now
>    

Notice the '>' character that printed out. This is normal. It is the 'talker' program prompt character, and will usually appear. At this point, dl11 is running as a simple terminal program. As you can see, there are 3 function keys available. F1 will print a help message. F2 exits the program, and F3 causes the download to start again. In this example, I reached over, switched the BotBoard Plus into run mode, and pressed the reset button on my target board.

Calling BlockProtection
Calling Fill on the entire array
Read to call WriteBlock
Calling ReadBlock
sermem_StartWrite
................................
sermem_StartRead
................................
Test complete
    

All of that output was from the memtest.s19 program. At this point, I made a change to my HC11 code, and recompiled memtest.s19. I now want to reload it. I have reached over and set the BotBoard Plus to LOAD mode, and pressed the reset button. On my PC's keyboard, I just pressed function key F3 to restart the download.

Reading D:\src\nl11\memtest.s19: OK!
Download Talker to COM1: >S>W>R>OK!
f800-fd23 (EEPROM): ..........................................
fffe-ffff (EEPROM): .
Download completed. OK!

F1 prints this help
F2 exits terminal mode
F3 Download 'D:\src\nl11\memtest.s19' again
Entering Terminal Mode now
>    

Note that I can stay in this mode of repeating downloads over and over. Don't forget to reset your target board first, or the program will exit due to a communication error.

Verifying the contents of memory

Another useful example is when you have an S19 file and a target board. You would like to verify that the contents of the memory on the target board contains the contents of the S19 file. You can use the -v command. Note that this only compares the contents of the S19 file against memory. It says nothing about memory locations not found in the S19 file.

D:\src\nl11>dl11 -v memtest.s19
dl11: version Nov 29 2001 22:36:13
Copyright (c)1999-2001 Kevin Ross
www.kevinro.com

Reading Verify File D:\src\nl11\memtest.s19: OK!
Download Talker to COM1: >S>W>R>OK!
Verify Segment 0xF800:0xFD23 -> Verified
Verify Segment 0xFFFE:0xFFFF -> Verified  

Reading the contents of memory

Lets assume what you really want to do is save the contents of memory away to a file. dl11 can do that for you. It saves the file in S19 format, so if needed, you could reload it later.

D:\src\nl11>dl11 -r 0xf800:0xf8ff savememory.s19
dl11: version Nov 29 2001 22:36:13
Copyright (c)1999-2001 Kevin Ross
www.kevinro.com

Download Talker to COM1: >S>W>R>OK!
Reading memory from MCU: >I>R>OK!
Writing to file 'D:\src\nl11\savememory.s19': OK!


D:\src\nl11>type savememory.s19
S113F8008E00FF18CE00DF7EFA3BBDFD1C83000195
S113F810DD004FF610088A00CA38F71008FC1009FA
S113F8208A00CA38F71009CC0050F71028394FF66F
S113F83010088400C4DFF71008394FF610088A0056
S113F840CA20F7100839BDFD1CF7102A4FF61029FD
S113F8508400C4801A83000027037EF8607EF84C7D
S113F8604FF6102A39BDF82ECC0006BDFD14BDF8A4
S113F87046BDF83A39BDF82ECC0004BDFD14BDF8E0
S113F88046BDF83A39BDF82ECC0001BDFD14BDF8D3
S113F89046BDFD1C0505BDFD14BDF846BDF83A394D
S113F8A0BDFD1CDD02BDF865BDF82ECC0002BDFD1A
S113F8B014BDF846CE0100DC02028FBDFD14BDF874
S113F8C046CC00FF9402D403BDFD14BDF84639189C
S113F8D0EC021A83000026037EF91E18EC048F4FF5
S113F8E0E600BDFD14BDF84618EC04C3000118ED94
S113F8F00418EC0283000118ED02CC0001D302DDF0    

Doing Lots of Stuff

In the next example, I am going to download memtest.s19 again. I am also going to do some extra steps. I am doing a BULK erase of EEPROM. This speeds up the reprogramming of the flash when you are updating to an entirely new program. I have set the memory map to be for an 811E2 part. I have also decided to save the existing memory range 0xf800:0xffff into a file called memout.s19 using the -r command. This reads the memory before doing the bulk erase or reprogramming. You can use the -r command by itself.

d:\src\nl11>dl11 -i memtest.s19 -B -m e2 -r 0xf800:0xffff memout.s19
dl11: version Nov 29 2001 22:36:13
Copyright (c)1999-2001 Kevin Ross
www.kevinro.com

Reading D:\src\nl11\memtest.s19: OK!
Download Talker to COM1: >S>W>R>OK!
Reading memory from MCU: >I>R>OK!
Writing to file 'D:\src\nl11\memout.s19': OK!
f800:fd23 (EEPROM): ..........................................
fffe:ffff (EEPROM): .
Download completed. OK!