| Notice that a 4K-byte
increment (not 2K-bytes) takes place between 7000H and 8000H. Easy to Configure
The partition function may seem a little confusing to the
newcomer, but the FREE software provided by Dallas Semiconductor provides a very simple
way to set the memory partitions. Configuring the partition is as simple as typing
PA 0800 on the command line. Here are a few screen captures of the programming
software in action:

Notice above that the simple command PA
0800 on the first line has set the partition address to 0800H. The second
line shows the command ST that requests the STATUS to be
displayed.
The status display includes the selected Com
port, baud rate, version of microcontroller inside the DS5000 encapsulated DIP package,
the Range, Partition Address, Code space and Data space.
Programming the DS5000
If you want to download the
programming/configuration software for the DS5000 from our web site click HERE.
Perhaps the simplest way to show you just how
easy it is to program and configure the DS5000 with Kit.exe is to show actual screen
captures during a session. Below I'll show you from start to finish how to:
 |
Select the Com port and establish
communications with the DS5000.
|
 |
Retrieve the status from the DS5000.
|
 |
Set the Partition (Configure Program/Data
memory).
|
 |
Load your assembled .HEX or .OBJ
code file into the DS5000 (Program the DS5000).
|
 |
Verify that your program has been loaded.
|
Step 1:
After you have downloaded and unzipped the
file including Kit.exe from our web site, locate this file and invoke it
(start the program) by clicking on the file named kit.exe. This
will start the programming software. You should be presented with a screen similar
to the following:

In the above example we have established
communications with the DS5000 by selecting Com 1. If you need to use a different
Com port simply enter it at the command line followed by the Enter key.
kit> com 2 ; Select
Com port 2
kit> com 3 ; Select Com port 3 etc..
The next step is to view the device
configuration. The device configuration or STATUS will show you the
selected Com port, baud rate, version of microcontroller inside the DS5000 encapsulated
DIP package, the Range, Partition Address, Code space and Data space. The command to
view the device configuration is ST. At the command line simply
type ST followed by the Enter key as shown below.
kit> st ; Show the
device configuration (STATUS).
Note: If you have
constructed your own programmer for the DS5000, make sure you place the RUN/PROGRAM
switch in the PROGRAM position. In program mode (Serial load
configuration) pin #9 RST is taken to a logic (1) through a 1K resistor. Pin #29
PSEN is taken to a logic (0) using an NPN transistor. If you're using our 8051
Development System, simply slide the mode switch to the PGM position.
Step 2:
In this step we will set the internal memory
partition to define the starting address of internal Data RAM and set the boundary for our
Program memory. Refer to the section The DS5000 Partition in the
previous section of this article if you're unclear about what this does.

Notice in the above example that I have
changed the partition to 4000H. Also notice just below this I have verified that my
selection is in effect by using the ST command to check the STATUS.
The status now shows that I have configured the Program/Data memory in 50-50
blocks. I now have 16K-bytes Program and 16K-bytes Data memory.
This particular demonstration is really
impressive when you consider the OLD way. Imagine using an older
version of the 8051 family that implemented external Program/Data memory... You
certainly wouldn't make this kind of a change in your hardware in this miniscule amount of
time. We have just partitioned the Program/Data memory, completely
changing the entire memory configuration for our design with a few simple keystrokes.
Compare this to adding different EPROM and
external Data RAM chips to an existing older 8051 design. Pretty simple by
comparison, don't you think..?
Note: Notice that the ST
command returns the active baud rate. The default baud rate is set to 9600 when you
first start kit.exe. If you need to alter the baud rate here's how.
At the command line where you see: kit>
type SP 2400 or SP 1200. Whatever baud rate you
need to use can be selected. For example:
kit> sp 2400
Effectively changes the baud rate to 2400.
Hint: The kit software
allows you to view a help screen for each available command. To find out the
available baud rates and functions for other commands, simply enter ? at
the command line followed by the Enter key. Here's a sample:

Notice in the first line; kit>
?
This brings up the list below the ?
command showing the (entire) command set available for use with kit.exe. Some
commands are reserved for other variants of the Dallas Soft Microcontroller
series. For a complete listing of each available command and which of the soft
microcontrollers each command applies to, download the document file named Kit.doc.
Click HERE to download the file. This DOC
file is in Microsoft Word format.
To bring up the help screen for each
individual command, simply enter help followed by the command you want to
know more about.
For example:
kit> help sp <cr>
Will show the help screen for the SP
(SPEED) command that's used to set the baud rate.
Step 3:
Loading and verifying your assembled .HEX or
.OBJ firmware file (Programming the DS5000).

The above example shows the following:
 |
We have selected Com 1.
|
 |
We have cleared Program Memory by filling
it with 00's
|
 |
We loaded the file named binary.obj.
|
 |
We verified the file binary.obj on disk
against the file in Program Memory.
|
Kit.exe responded with No Verification
errors. Our program is now ready to RUN. Exit the
kit program by entering Q at the command line followed by the Enter key.
If you're using our Development System, just flip the mode switch to the RUN
position.
Implementing a simple binary counter to verify
operation of the DS5000. The following simple code segment will let you verify that
your program load has been sucessful. Attach 8 LED's to port P1.0-P1.7. Load
and Run the program. The LED's should count in binary up until all 8 LED's are lit,
then recycle and start over again from 0.
Note: This file was assembled
using the Metalink cross assembler that's included with the Dallas programming software
found HERE. If
you would like to download the assembled .HEX file, click HERE. Hint:
Right click on the .HEX file and select save as. The file name is
binary.hex and is the exact program you see listed below in .HEX format.
$mod51
org 0
ok1: mov a,#0ffh
start1: mov r4,#10h
mov r5,#10h
start4: mov r3,#10h
start3: djnz r3,start3
djnz r4,start4
djnz r5,start4
mov p1,a
dec a
sjmp start1
end

Older 8051 Designs
The DS5000 series microcontroller offers the
8051 developer an exceptionally powerful and efficient development platform for 8051
applications development. Older designs based on the Intel 8051 architecture
required using external EPROM, RAM and interface components such as the 74HCT573
three-state latch to make the program/data memory structure functional.
While these older methods were quite
functional and (at the time), very efficient, they left a lot to be desired when it became
necessary to have more I/O capabilities. The implementation of external program and
data memory required the use of valuable I/O pins on ports 0 and 2 thereby limiting the
average 8051 design to a mere 12 I/O lines available for use in the end application.
EPROM Based 8051 Variants
In an effort to make more I/O available for
the developer the 87C51 was introduced. With all of the program memory located
inside the 87C51 package the developer was able to take advantage of all 32 I/O pins.
Not requiring program memory to reside in external EPROM, the 87C51 offered a big
enhancement over older 8051 designs based on external EPROM. For applications that
didn't require Data RAM, this was most often the preferred platform.
Program Development
Using the 87C51 or other EPROM based
(windowed) variants requires that you erase and then re-program the device during the
firmware debug cycles. This often requires that you have several 87C51 devices on
hand during your initial development.
Even with the large time requirements often
associated with developing applications using the 87C51 EPROM based family, it's still in
big demand and will no doubt continue to be used for many years to come. While the
87C51 offers increased I/O availability, it still requires committing valuable I/O to
handle external Data RAM along with the time requirements for erase/burn cycles.
Typically there was always some sort of trade-off when you chose between different devices
within of the 8051 family. The 87C51 eliminates the need for external program
memory, yet it doesn't provide for easy access to Data RAM. Moreover, the erase/burn
cycles are time consuming and can become a real handicap for developers racing against the
clock to get new designs to market.
The cost of several 87C51 microcontrollers,
the device programmer and ultraviolet chip eraser are often a big factor, especially for
beginners and students just entering the world of embedded design.
Developing Applications for Old Style
8051 Platforms
A real bonus in using the DS5000 as an 8051
development platform is the ability to develop applications that target older style 8051
applications. By adjusting the internal partition of the DS5000 you can develop
applications for 8051 systems that will use external Program EPROM and external Data RAM.
Some applications don't require the power or additional I/O of an 87C51 or the
DS5000 for the end application. In this case it may be more cost effective to use an
8051 board using external Program/Data memory.
At first it may seem that I would never
suggest using the older external memory configurations, however, in all fairness, there
are still 8051 applications that have simple requirements and don't justify the cost of a
more expensive microcontroller.
The extreme flexibility of the DS5000 memory
structure allows you to use the DS5000 to develop applications targeted for the 87C51 as
well as the 8051 designs using external Program/Data memory.
Benefits:
You no longer need to burn/erase EPROM's
when developing code for 8051 systems using external Program/Data memory.
You can burn your completed code into a
(new) 87C51 instead of using the 87C51 for development thereby saving time & money.
You can change memory configurations on the
fly without hardware changes to accommodate various design requirements.
You can build your own development system
using the DS5000 for a fraction of the cost of comparable systems.
The list could be quite long here, but I think
you get the message. The money and time you'll save will be enough justification to
explore using the DS5000 for all of your 8051 applications development.
Along Came FLASH
Newer FLASH based 8051 variants have become
very popular in recent years. The Atmel AT89C205X and New AVR microcontrollers offer
an extremely flexible development platform and are very easy to use. Other
manufacturers are cranking out new FLASH based microcontrollers onto the market at a rate
that makes it hard to keep up with all of the new options. The addition of FLASH
memory into the 8051 architecture eliminated the need to erase EPROM program memory during
the development cycles and is very popular today. Still, with most FLASH based
microcontrollers the Data RAM is normally incorporated through the use of onboard EEPROM
memory. Onboard EEPROM Data storage has definite advantages in that it is easy to
use, requires no external components and doesn't gobble up any valuable I/O resources to
implement. However, EEPROM memory is often not suitable for applications
requiring large volumes of read/write cycles. EEPROM memory is limited by a number
of read/write cycles and will wear out beyond this fixed limitation.
Applications for data acquisition requiring
intensive manipulation of data stored in EEPROM can quickly rule out the use of EEPROM as
an option for data storage in many applications.
|