AN102| Application Note

AN102 PDF

AN102| Application Note


Maxim > App Notes > MICROCONTROLLERS Keywords: DS87C520, DS87C530, 29F010, bootstrap loader, bootloader, Intel hex file format, high-speed microcontroller, Dallas Semiconductor, flash memory

Apr 23, 2001

APPLICATION NOTE 102

Using the High-Speed Microcontroller as a Bootstrap Loader
Abstract: This application note highlights the use of the Dallas Semiconductor High-Speed Microcontroller as a bootstrap loader. Example shows a DS87C520 or DS87C530 in conjunction with a 29F010 flash memory in a bootloader configuration.

Overview
Some members of the High-Speed Microcontroller Family incorporate internal EPROM or ROM for program storage. Some applications, however, require in-system reprogrammablility of program memory. Such a system can be easily implemented using the Dallas Semiconductor High-Speed Microcontroller with internal program memory to reload an external nonvolatile memory such as Flash memory or NV RAM. Using the internal program memory as a bootloader allows a lower cost solution than could be obtained by using a device with internal NV RAM program memory or a costly boot-block Flash memory. The most common bootloader configuration incorporates two elements: a microcontroller programmed with the bootstrap loader, or bootloader, and an external memory device such as an NV RAM or Flash memory to hold the user application software. When the system resets following a power-on or external reset, it will begin executing instructions out of the microcontroller's internal program memory. The bootloader code inside the microcontr
oller begins by checking for a "loader/no-loader"; stimulus such as a logic low on a specific port pin, serial port character, etc. This allows the system to decide if it should load a new user program or if execution should begin using the existing user program. If the stimulus is not received, indicating that no load is desired, the device will disable internal program memory via the ROMSIZE feature and begin execution from external memory. If the stimulus is present, the device will execute the bootloader routine and begin reprogramming the external memory. This application note will provide examples of how a designer can use an external Flash or NV RAM to add insystem reprogrammability to a High-Speed Microcontroller based design. General hardware and software design guidelines are presented. Software examples to support the techniques described herein are available in electronic format from Dallas Semiconductor via our anonymous FTP site (Internet) or BBS.

Invoking the Bootloader
There are several ways to invoke the loader. The simplest is to dedicate a general purpose I/O pin to be sampled as part of the reset routine contained inside the High-Speed Microcontroller. The examples in this application note utilize P1.7, INT5, because it is least likely to interfere with existing 8051 code designs. Following a reset, the device will begin executing code from internal EPROM. The internal program will perform a quick test of the pin to determine if the loader should be invoked. Because this pin defaults to a high state after reset, it is recommended that a low condition on this pin be used as the signal to invoke the loader. Using an interrupt pin also allows the device to invoke the loader at times other than reset via the interrupt service routine. The method used to assert a logic low can be as simple as a dedicated switch, or a more complicated connection via the RS-232 cable from the host that pulls the pin low when connected. An alternate method involves using the serial port to inv
oke the bootstrap loader. Upon reset, the device can continuously poll the serial port for a character. If a character is not received in a specified period of time, the program will exit the loader and begin execution from the external memory. This approach has the advantage of not requiring a general purpose port pin. Its primary disadvantage is that the device will experience a fixed delay every time it is reset before running the user application.


AN102 Application Note maxim Download PDF

Add this permalink to your bookmarks for future download of AN102 ApplicationNote

Permalink: http://application.emcelettronica.com/maxim/AN102

PDF AN102 APPLICATION NOTE