CMP EMBEDDED.COM

Login | Register     Welcome Guest  
HOME DESIGN PRODUCTS COLUMNS E-LEARNING CONFERENCES CODE FORUMS/BLOGS NEWSLETTERS CONTACT FEATURES RSS RSS

Programming your own microcontroller
When this article was written 20 years ago, the FPGA was only five years old and not widely used yet. Here's an early how-to article on PLD design that stands the test of time.



Embedded.com

In the state-machine descriptions of the traffic-light changes, for example, the order in which the light changes are described is unimportant; all the commands in each state are executed simultaneously. Likewise, all the truth-table lines and Boolean equations are evaluated concurrently. The compiler will alert the erring programmer who assigns more than one change to one signal under the same conditions. It will also automatically combine multiple Boolean equations into single AND/OR equations and optimize the combinatorial networks for the specified device architecture.

Pin names are used to define signal descriptions into and out of the PLD. These constitute one signal type. The aforementioned vector descriptions can also be used to describe signals. The compiler will alert the programmer when a pin name is assigned as a state label or component name. It will also detect erroneous assignment of pins, such as the use of an input as an output.

Writing an HDL description isn't all that different from using a general-purpose programming language. The fact that the compiler generates a fusemap for the interconnection of logic elements, rather than microcode for a processor, is hidden from the programmer.

When to try out a PLD
If an application looks like it requires only a few pages of code, then a PLD can be a low-cost solution. Ideally, such an application should have less than eight states and require specific control lines for switches and indicators. PLDs are also efficient where speed is important, as the functions are evaluated logically rather than by a sequence of macroinstructions.

PLDs are useful at the other end of the design spectrum, where high performance and functional complexity are more important aspects of the design than cost.

If PLD design is a new thought to the embedded systems programmer, then it's one that should be explored. Hardware designers can provide some assistance in this area, though to date only about 20% of all hardware designers have ever used a PLD (according to Data I/O surveys). PLD vendors offer instructional courses, but they're usually aimed at hardware designers rather than software developers. Accordingly, most PLD vendors emphasize schematic rather than HDL design.

HDLs are usually very simple, however, with less than a hundred commands and directives. I've found HDLs easier to learn than any other language. The only real issues are device selection and pin assignment, which are currently addressed only by Minc Inc.

Next month: how software models can be used instead of in-circuit emulators for code development.

Ernest Meyer is an independent technical writer and former editor of VLSI Systems Design.
1 | 2 | 3 | 4

Rate this article: Low High
Current rating
  • .
Embedded.com Career Center
Looking for a new job?
SEARCH JOBS

Browse all jobs

SPONSOR
RECENT JOB POSTINGS





 :