![]()
Programming Flash memory using parallel loaders and CPLDs
Posted: 03 Feb 2006 By Theresa Vu, Altera Corp.
Embedded Systems Programming
Flash memory has been the answer to many an engineer's wishes. Since they were introduced in 1988, these electrically erasable, programmable, read-only memories have delivered high-density nonvolatile storage that's relatively affordable and straightforward to program and erase. Flash memory devices are now widely used in a variety of applications to store configuration, program, or memory data.
Although flash memory can be straightforward to program, a new method of programming makes it easier and offers cost and time savings. In this article I'll describe this method and compare it with the traditional methods for programming flash memory.
More flash in the forecast
Before flash memory was available, embedded systems
designers typically used EPROMs or EEPROMs for nonvolatile digital storage. Both device types
were adequate but less than ideal because of their awkward programming and
erasure requirements.1
In contrast, flash memory can be electrically erased (in blocks or in sectors, depending on the specific device) considerably faster than an EPROM or EEPROM can be erased. This block-based erasure method allows a flash chip to share the erase circuits within a block, reducing die size and lowering manufacturing cost. The other advantage of block-based erasing is that more than one copy or version of the contents can be stored in the same chip, providing a fail-safe mechanism for updating the memory. A master version can be stored in a sector of the device that never gets erased and can be accessed if any errors occur during programming or erasure of the other sectors.
Densities for flash memory devices have increased exponentially since the late 1980s, with vendors now offering as much as 8Gb of storage capacity in a single chip. Demand for flash memory continues to grow rapidly because it offers nonvolatile storage that's well suited to embedded applications in consumer, automotive, computing, and industrial products that are requiring larger and larger storage capacities.
Flash memory is typically used for permanent data storage but designers are also using it to hold configuration data or code. In these latter cases, the flash must be programmed before it's used. Although flash chips are easier and faster to program than their predecessors, project teams are constantly pressured to cut the time spent in the production process. Using traditional methods, memory programming can take a lot of time. As storage densities for flash memory devices increase, programming times also increase, further magnifying this challenge. The traditional programming methods also provide little flexibility for last-minute design changes or programming updates while the product is in the field, both capabilities that are increasingly needed to add features or repair bugs. Programming methods must offer the flexibility to accommodate these updates.
Traditional programming
Three options for programming flash memory devices are
commonly used today. One option, known as in-system programming (
In the second programming option, the engineer pre-programs the flash memory device before installing it onto the PCB, which increases the manufacturing cost because it requires extra programming fixtures. The device, once pre-programmed and mounted, can't be used for other applications as the design evolves. This option also doesn't allow for last-minute changes, enhancements, or bug fixes that may be necessary after the part is inserted onto the PCB.
The third option uses

Other chips, such as an ASIC or a
A faster technique
A parallel flash loader (PFL) combined with a CPLD
offers several benefits over existing flash-programming options. This fourth
option takes advantage of real-time
The PFL method provides a straightforward, cost-effective way to program flash memory devices through the JTAG interface. The PFL uses connections and equipment that are already present and common in the manufacturing process. The programming port is the JTAG test access port (TAP), which is the method consistent with JTAG testing and CPLD programming. The JTAG TAP is found on most PCBs because it only requires four pins to access all of the JTAG-compliant devices on the PCB.
This approach uses a CPLD to bridge the JTAG interface and the flash memory device's parallel address/data interface. Instead of shifting data through all of the pins of a JTAG-compliant device, this method quickly retrieves data from the JTAG scan chain and generates data that is formatted for the target flash memory device. Unlike the JTAG boundary scan chain method, the PFL brings the data through the logic array of the CPLD. The PFL combines a unique connection of the JTAG TAP state machine to the CPLD logic as shown in Figure 2.

The JTAG state machine is controlled by the JTAG signals TCK, TDO,
This method significantly reduces the flash memory device programming time.
Using the example of programming a single vector into a 48-pin common flash
interface (

In addition to its drastically shorter programming times, the PFL can send configuration or initialization data to the flash memory device for other FGPAs, ASSPs, microprocessors, or ASICs in the system. The remaining logic in the CPLD could then be used to implement functions to execute configuration signals to these devices.
Existing implementations
Off-the-shelf intellectual property (IP) cores are pre-engineered blocks of
logic created for specific functions. Existing IP is commonly used in
In one prepackaged solution, the design software contains the programming
specifications for various

Ease-of-use
A major advantage of the PFL is that it's implemented in programmable logic,
thereby allowing design reuse. For instance, when a designer moves to another
programmable logic device, he can reuse the PFL in the new device. He does not
need to create a new design to implement the same functionality. As data
requirements and flash memory capacities both grow, the PFL approach can still
be used with little to no redesign effort. The PFL can easily be ported into
new designs or the same design for different platforms.
The PFL method doesn't require special programming fixtures since the CPLD uses the JTAG scan chain connections already present on the PCB. This ability to use existing connections can reduce both manufacturing costs and time. Since the PFL uses only a small portion of logic in the CPLD, the remaining logic can be used for other applications, such as I/O expansion, system configuration or power-up sequencing. Finally, the PFL function can fit into a small CPLD, resulting in a low component cost.
The upshot
Although the
About the author
Theresa Vu is a senior product marketing engineer for Altera
Corp. She spent the last six years in the programmable logic industry. She can
be reached at THVU@altera.com.
Endnotes:
1. For a short description of these requirements, see my article "How to
integrate flash device programming and reduce costs," Programmable Logic DesignLine, August 2005, www.pldesignline.com/showArticle.jhtml?articleID=169300319
2. Altera offers the PFL Megafunction in its Quartus II software. Intellitech offers the fast access controller IP.
This article was printed from EE Times -