Using the Dallas Semiconductor DS5000 Series Microcontroller

The DS5000 Single Chip Solution

The DS5000 series microcontroller offers the 8051 developer a single chip solution to the most common tradeoffs normally associated with other options for Program and Data memory.  Combining Program and Data memory in a single package, the DS5000 packs a lot of bang-for-the-buck.

The entire Program/Data memory space is implemented using onboard high speed, nonvolatile static CMOS RAM.   The encapsulated DIP package of the DS5000 contains a lithium energy cell that will maintain the contents of the onboard Program/Data memory in the absence of VCC for a period of up to (10) years and the CMOS RAM is not limited by a fixed number of read/write cycles such as with EEPROM alternatives

The unique ability to alter the amount of RAM to be used as Program or Data memory within the DS5000 offers a flexibility far above that of other 8051 variants.  Due to the entire Program/Data memory structure consisting of CMOS RAM, programming the DS5000 series has also been simplified.   Older methods requiring ultraviolet light to erase EPROM's and the windowed 87C51 versions together with cumbersome device programmers has become a thing of the past.

FREE Programming Software

The FREE programming software offered by Dallas Semiconductor for programming and configuring the DS5000 series microcontrollers is very simple to use and (extremely) convenient.  To start the software just click on the file KIT.exe.  The software works at the DOS command line, or from within the Windows95/98 shell.  Here is a screen capture of kit.exe operating under Windows98.   Notice the procedure for selecting the Com port.

kit2.gif (9290 bytes)

The initial splash screen shows you the current version of the Kit software.  It then informs you that you need to select a Com port to use.  The first line where Kit> appears indicates that the program is waiting for input.

Kit> com 1  <cr> selects Com port 1 as your preferred Com port to use while communicating with the DS5000.  Note: the <cr> indicates a carriage return by pressing the enter key, you don't type <cr> at the command line.

The line kit> dis 00 0f  shows the command to display the internal contents of Program Memory starting at location 00H to location 0FH.  Notice directly below kit> dis 00 0f that we are presented with the actual HEX contents of Program memory. 

Loading an assembled .HEX or .OBJ file is just as simple and will be covered later on in this article.  For now, I just wanted to show you how easy it is to use the DS5000 programming/configuration software.

CMOS RAM Vs EEPROM

CMOS RAM unlike EEPROM is not limited to the number of read/write cycles.  Data intensive applications such as data logging benefit greatly from this single design variable.

EEPROM limitations are no longer a factor and the technical skills required to use the onboard RAM are no more than normally required to use older 8051 designs with external RAM.  In fact, access to the internal (Data RAM) follows the same protocols used to access external Data RAM on older designs.  For example, the following instructions are the same as you would normally use to access external Data RAM, but will access the internal Data RAM of the DS5000:

MOVX  @DPTR,A             ; Load the Data Memory location pointed to by the
; contents of the DPTR register with the contents
; of the Accumulator.
MOVX  A,@R1 ; Load the Accumulator with the contents of Data
; Memory addressed by the 8-bit contents of R1.
The DS5000 Partition

Perhaps one of the most desirable features of the DS5000 series lies in the ability to adjust the Partition between Program/Data memory.   The DS5000-32-16 has 32K bytes of onboard Program/Data memory.  The 32 signifies 32K onboard memory, the 16 is the maximum oscillator frequency at which the device will operate.  By adjusting the Partition between Program/Data memory you can change the total amount of memory that will be available for Program and Data memory.

The MCON Register

The MCON register has been added to the architecture and is used to define the total size (range) of memory in the Embedded RAM and the partitioning of the Program/Data space.  The bits which perform this function are the Range bit (RA) and the partition Address bits (PA3-0).  The range bit is programmed via the Serial Bootstrap Loader and cannot be accessed by the application program. 

The Partition Address is used to select the (starting address) of Data Memory in Embedded RAM.  Program space lies below the Partition address.

For example:

Your assembled .hex or .obj file is only 1.5K-bytes in size and you want to use the remaining memory for Data storage.  You set the partition address to 0800H.   Data Memory will now start at 0800H.  Everything below 0800H is reserved for Program Memory.  Each block of memory is divided into 2K blocks until you reach the range of 7000H.

Here is an example of different Program/Data memory configurations.

PA3 PA2 PA1 PA0 PARTITION ADDRESS PROGRAM/DATA MEMORY SIZE
0 0 0 0 0000H 0K PROGRAM-32K DATA
0 0 0 1 0800H 2K PROGRAM-30K DATA
0 0 1 0 1000H 4K PROGRAM-28K DATA
0 0 1 1 1800H 6K PROGRAM-26K DATA
0 1 0 0 2000H 8K PROGRAM-24K DATA
0 1 0 1 2800H 10K PROGRAM-22K DATA
0 1 1 0 3000H 12K PROGRAM-20K DATA
0 1 1 1 3800H 14K PROGRAM-18K DATA
1 0 0 0 4000H 16K PROGRAM-16K DATA
1 0 0 1 4800H 18K PROGRAM-14K DATA
1 0 1 0 5000H 20K PROGRAM-12K DATA
1 0 1 1 5800H 22K PROGRAM-10K DATA
1 1 0 0 6000H 24K PROGRAM-8K DATA
1 1 0 1 6800H 26K PROGRAM-6K DATA
1 1 1 0 7000H 28K PROGRAM-4K DATA
1 1 1 1 8000H 32K PROGRAM-0K DATA
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:

kit1.gif (7594 bytes)

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:

bullet

Select the Com port and establish communications with the DS5000.

bullet

Retrieve the status from the DS5000.

bullet

Set the Partition (Configure Program/Data memory).

bullet

Load your assembled .HEX  or .OBJ code file into the DS5000 (Program the DS5000).

bullet

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.

kit4.gif (7561 bytes)

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:

kit5.gif (14481 bytes)

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).

kit7.gif (9508 bytes)

The above example shows the following:

bullet

We have selected Com 1.

bullet

We have cleared Program Memory by filling it with 00's

bullet

We loaded the file named binary.obj.

bullet

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 HEREHint: 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:

  1. You no longer need to burn/erase EPROM's when developing code for 8051 systems using external Program/Data memory.

  2. You can burn your completed code into a (new) 87C51 instead of using the 87C51 for development thereby saving time & money.

  3. You can change memory configurations on the fly without hardware changes to accommodate various design requirements.

  4. 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.