Electronic Design

  
Reprints     Printer-Friendly    Email this Article    RSS        Font Size     What's This?


[Design Application]
Consider A Microcontroller When You Need A Compact Bootstrap PROM
Even if your processor board has no room for EPROMs, you can still load programs into RAM via an I/O port with the help of an 18-pin microcontroller.

Tom Napier  |   ED Online ID #1362  |   April 3, 2000


I used to think that 8- and 16-bit microprocessor chips were pretty intelligent, but that was before I started using single-chip microcontrollers. These devices, with their on-chip EPROM, really are smart. They power up already knowing what to do—unlike their more powerful brothers, which just sit there and go "Duh!" until they get hooked up to some program memory.

Without external RAM and PROM, a microprocessor chip is so much wasted silicon. Consequently, a product using an embedded processor usually has the system code and the application program stored in one or more large PROMs. Development is accomplished with a PROM emulator or a similar device.

Almost all applications require some RAM, so it's tempting to put only RAM chips on the board—particularly since they still have a speed advantage over PROMs. Program development is easier because the code is easily changed. Yet in the final product, the system and application code has to come from somewhere. This source doesn't have to be connected via a wide data or address bus, though, or even be particularly fast. It could be a single slow, cheap EPROM hooked up via an 8-bit port. If you don't mind an appreciable startup delay, the code could come from a disk drive, over a serial link from some other equipment, or even be stored in a serial EEPROM, which takes up almost no board space.

Unfortunately, an all-RAM board has no way to load the system code and get the processor out of the "Duh!" mode. At the very least, a bootstrap loader is necessary. That means finding space for two whopping big PROM chips in a 16-bit system.

I recently redesigned a board that had its system code stored in the processor, a 17C43. This was to be replaced with an 80C86, but there was no room on the board for one PROM, much less two. Luckily, there was an I/O board in the system. It had room for a PROM and a 16-bit address generator. In theory, then, code could be copied to RAM via the 8-bit I/O port.

Enter The Smart Loader
If you could somehow pre-load the RAM with a hundred bytes of code, no on-board PROM would be needed merely to load the system code. Fortunately, there is a device that contains enough PROM space for a bootstrap loader and has enough smarts to load it into RAM. It even fits in an 18-pin package. Two accessory chips are necessary, but the space penalty isn't great. Although there was no space on my board for even one PROM, it is possible to squeeze in three smaller chips.

The smart chip is a PIC16C54 microcontroller from Microchip Technology Inc., Chandler, Ariz. One accessory chip is a quad two-input multiplexer—e.g., a 74HC157. This gives the PIC access to the RAM control signals. The other chip is an 8-bit buffer, such as a 74HC541. This lets the 8-bit port of the PIC drive both halves of the board's 16-bit bus.

Here's how things work. One PIC port bit sends a reset to the main processor. This disconnects it from the data/address bus, allowing the PIC to drive the lower eight bus bits. The buffer chip bridges the two halves of the 16-bit bus. As a result, the same input appears on its high half. The PIC's byte output is then available to both the high-byte and low-byte memory chips. The PIC generates separate write-enable signals for each RAM chip.

In a typical small-system configuration, the data/address bus already has two 8-bit latch chips on it to capture the current RAM address (Fig. 1). In principle, the PIC could load these chips with any 16-bit address, but this would require either an extra port bit or a decoder chip. I compromised by wiring the high-latch chip's output-enable pin to the reset line. This lets the resistors pull address bits 9 through 15 high as long as the PIC is in control. Any other active address bits and the M/—IO selector bit also are pulled high. The address decoder thus activates the highest page of memory.

The PIC loads eight address bits into the lower address latch, limiting the bootstrap code to less than 512 bytes. This code is normally used only to transfer a few thousand bytes to RAM from a PROM or a serial port, so this should be ample space. Even a minimal disk controller could be included.

In theory, it's possible to set any high address with pull-up and pull-down resistors. But because the 80C86's startup address is FFFF0H, it's convenient to put the bootstrap code on the same 256-word page. Once the main processor is running, it can relocate code as required—for example, to use the interrupt vectors on page 0.

Both the write enable and the Address Latch Enable (ALE) pulses from the main processor pass through the multiplexer chip in normal operation. They are replaced by signals from the PIC's 4-bit port when the PIC is in control.


<-- prev. page     [1] 2     next page -->

Reprints   Printer-Friendly  Email this Article  RSS    Font Size   What's This?


  • A New Design Inflection Point
  • Forecasting Industry Growth For 2009 And Beyond
  • EDA Retools To Exploit Multicore Architectures
  • Design And Verification Move Up In Abstraction
  • EDA Retools To Exploit Multicore Architectures
  • A New Design Inflection Point
  • Design And Verification Move Up In Abstraction
  • Challenges Lurk For 22-nm Physical Implementation
    1) Transportation Guidelines For Lithium Batteries Get Updated
    (1494 views today)
    2) Build A Smart Battery Charger Using A Single-Transistor Circuit
    (266 views today)
    3) 1-A Switching Regulators Operate With 96% Efficiency To Replace Linear Regulators
    (211 views today)
    4) WHITE PAPER: Liquid-Level Monitoring Using a Pressure Sensor
    (210 views today)
    5) Tame Switching Supply Noise While Maintaining Efficiency
    (111 views today)
    ALL TOP 20



    Reader Comments

    Rating Only

    Rating Only -July 09, 2007   (Article Rating: )

    POST YOUR COMMENTS HERE
    Name:

    Email:
    Your Comments:

    Enter the text from the image below


    Please refresh the page if you have trouble reading this text.

    Search Electronic Design
         
      
     
    Web Seminar
    Sponsored By:
    Title: Read Pacing: A Performance Enhancing Feature of PCI Express Gen 2 Switch Devices
    Speakers: 
    Date: 07/01/08
    Register: 

    Electronic Design Europe Electronic Design China EEPN Power Electronics Auto Electronics Microwaves & RF
    Mobile Dev & Design Schematics Find Power Products Military Electronics EE Events Related Resources