Design Article
Programming your own microcontroller
Ernest L. Meyer
3/9/2008 12:00 PM EDT
The following article first appeared in the At the Bench column in the March 1989 issue of Embedded Systems Programming magazine.
Last month* we discussed the differences between general-purpose programming languages and hardware description languages (HDLs). This month we'll look at how HDLs can be used to design embedded systems directly.
Rather than using a general-purpose language to program an embedded processor, you can use an HDL to configure a programmable logic device (PLD). A number of special sets of HDLs are specifically designed to configure PLDs.
Originally, PLDs contained fuses and fusemaps generated from the HDL descriptions of the desired functionality. Although fused devices are still used, modern PLDs can also use programming techniques; higher densities, as well as higher speeds, can be obtained.
Indeed, the most sophisticated PLDs available contain over 600 register bits and operate at clock speeds in excess of 70 MHz. Since the register bits can easily be configured in any width and linked with any logical structure, these larger PLDs are a viable and faster alternative to any microcontroller architecture. These PLDs do tend to cost hundreds of dollars, however. Although they can be priced competitively if they can directly replace an ultrahigh-performance 32-bit microcontroller or application-specific processor, they're beyond the budget of most embedded applications.
Smaller PLDs, which cost only a few dollars, offer a viable alternative to small microcontrollers in small- and medium-run quantities. Because no separate PROM is required, one chip can be sufficient for applications that would require at least two chips if a low-cost microcontroller were used.
Though microcontrollers can be economically mask programmed in sufficient volume to offset the price difference, PLDs offer architectural advantages that can make them more attractive anyway. Most obviously, the pins in a PLD can be configured as they're needed, an advantage for functions that involve switches, indicators, and control lines. Less obviously, PLDs are easy to test. In fact, most PLD development systems can automatically generate a test suite for the part. PLDs can also operate much faster than a microcontroller in the same price range.
There are nevertheless a number of strictures on PLD implementation. The prime restriction is that the least expensive PLDs offer only eight register bits; having more than a few dozen bits automatically puts the price of the chip over $10.
Recent innovations in PLD development system technology are moving PLD design back into the software realm. One expert system for PLD selection from Mine Inc. (Colorado Springs, Colo.), PLDesigner, integrates schematic and HDL environments with simulation and a knowledge-based software mechanism that selects the most appropriate PLD. Systems designers can enter the restrictive parameters necessary for the application, such as cost, speed, device count, power consumption, lead time to delivery, and distribution channels. PLDesigner then tests how well the function fits onto each and every possible combination of PLDs and produces a list of suggested implementation configurations.
* Remember, this is a 20-year-old article. -ESD editors. Back



