|
by Jamie
Pollock
Start ı Problem
Solving ı EEPROM Programming ı Some
Assemblyı ı Interfacing the LCD ı Sources
and PDF
PROBLEM SOLVING
A couple of obstacles are created with
a simple program like this, but if the RAM can be mine, then so can
the world! First, the bootstrap fills the RAM from the address $0000
up. This seems like a good idea until one realizes that the vector
table for bootstrap mode points to the block $00C4 to $00FD, right
in the beginning of the 1-KB on-chip RAM ($0000 to $03E8).
Second, the EEPROM is only 512 bytes.
Because I plan to store my program in EEPROM and have the controller
execute my code at power-up, I need to have a block of 512 bytes of
RAM available in one chunk. I also need to use interrupts so a patch
will be created.
" width="254" height="117">
Now,
Getting Connected to the
Internet Can Earn You Cash.
Win
your share of $26,500 CASH
plus great Development Tool Prizes!
Deadline May 1, 2000
More information
The first attempt to resolve the interrupt
address conflict was to use a free program from Motorola called PCBUG11.
This is a great tool for working with the ı6811. If the controller
doesnıt have external RAM, then the software uses up all available
RAM.
My solution is to write a small bootloader
that imitates the original bootstrap code but places the program at
$0100 then times out and jumps to $0100 to execute my code (see Listing
1).
The 6811F1 has 1 KB of RAM. If I start
my code at $0100, there are 744 bytes available in one block. This
gives me 512 bytes with 256 bytes for the stack. There is unused RAM
below $00C4 that I will use for variables. Now Iım ready to download
and execute my assembled ıS19 file from RAM. A simple BASIC program
will communicate with the controller. The terminal program must do
several different tasks. First, it must establish communications and
send the first piece of codeıthe bootloader.
The controller accepts the code in binary
sequential format. The ıS19 file must first be translated to remove
the header, address, and the checksum. I have modified the Motorola
application note AN 1260 for making this change to the bootloader
and to the project ıS19 files.
Bootload.bas is the final PC terminal
program. It sends the bootloader code then prompts the user for the
name of the ıS19 file to be sent. Bootload.bas processes the
ıS19 files and places the raw code into an array. The array is then
dumped to the controller, echoing the response to the PC screen for
verification. When the code finishes sending the Bootload.bas
program, it becomes a terminal emulator for debugging.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ıCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |