Free Print Subscription Printer-friendly version Email to a Friend

PLD code creates PWM generators

( 01 Oct 2002 )
Clive Bolton, Bolton Engineering Inc, Melrose, MA, USA

The PLD (programmable-logic-device) code in Listing 1 creates arbitrary-resolution, pulse-width-modulated (PWM) generators. PWM generators are useful as low-bandwidth D/A converters in hardware of microprocessor-based systems. When you pass it through a simple RC lowpass filter, a PWM waveform becomes a voltage that’s approximately equal to the PWM duty cycle times the supply voltage. In practical systems, the driving hardware is imperfect, so the minimum value is never zero, and the maximum value never equals the positive-voltage rail.

The software module in Listing 1 automatically generates the required hardware from two compile-time parameters: PWM_WIDTH and AVALUE. PWM_WIDTH sets the number of possible steps in the PWM comparison. For example, 6 bits yields 26, or 64, steps. AVALUE sets the value at which the PWM initializes upon power-up or reset (set to one-half scale in the example in Listing 1).

The module has two major sections: a holding register, which stores the PWM value, and a counter, which generates the PWM waveform. You can update the holding register independently of the PWM counter. The holding register’s value automatically strobes into the PWM counter when the counter overflows. The module takes the CLOCK, ACLR, ENABLE, WRITE, and DATA[PWM_WIDTH-1..0] inputs. CLOCK is the master system clock; all signals other than ACLR must be synchronous with the clock’s rising edge. ACLR initializes the hardware to the power-up state and loads AVALUE into the holding register. When ENABLE=0, the PWM output becomes 0 (off); when ENABLE=1, the PWM generator produces the PWM waveform at the Q output. Asserting WRITE for one clock cycle strobes the data presented on DATA[PWM_WIDTH-1..0] into the holding register. The PLD code uses Altera’s (www.altera.com) AHDL high-level design language; you can directly compile the code into any of Altera’s PLDs. Using an EP1K10TC100-3 PLD, a design with parameters set to the default values in Listing 1 operates as fast as 139 MHz. Although we wrote the code for Altera’s devices, you can readily translate the design structure and flow into VHDL or Verilog.

 
Free Print Subscription Printer-friendly version Email to a Friend
 
Article Rating 
Average Rate: No rating yet
 
Poor Quite Good Good Very Good Excellent
 
Related Content 
 
 
KNOWLEDGE CENTER
Panasonic Key Devices Guide 2008 :
 
Fairchild Semiconductor :
 
Texas Instruments: DaVinci™ Technology
 
Texas Instruments: Safe Bet Series
 
 
 
Highest Rated  
Feedback Loop  

ADS BY GOOGLE 
 
 
 
ADVERTISEMENT
Press Release 
 
TECHNOLOGY NEWS
 
RESOURCE CENTER

 
 
PRODUCT NEWS
 
FEATURED SPONSORS
 
 
DESIGN CENTERS
 
ADVERTISEMENT
     
Reference Designs 
   
     
 
 
 



RSS
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

POLL
What type of environmental regulation do you think will be most beneficial for the tech industry?
Proper recycling and disposal
Push for power efficiency and energy conservation
Chemical/lead regulation
View results


     
Power Technology E-newsletter 
Dual-input, Single-output Power Supply Selector Switch Reduces System Size while Improving Integrity EDNA, February 08
Analog Devices completes sale of CPU voltage and PC thermal monitoring business to ON SemiconductorEDNA, January 08
Fairchild’s Green FPS Power Switches Increase Efficiency, Reduce EMI in Power Supply Designs EDNA, December 07
 
Test and Measurement E-newsletter 
Agilent Technologies and Anite Announce Strategic Partnership to Deliver 3GPP LTE Test Solutions for Wireless R&D EDNA, November 07
WiMAX Technology Leaders Aeroflex and Sequans Partner to Speed Product Development and Deployment of WiMAX Test EDNA, October 07
Tektronix’ IMS Solution Proves Successful in Industry Forum Tests EDNA, September 07
 
     
 
KNOWLEDGE CENTER
 
Panasonic Key Devices Guide 2008:
 
Fairchild Semiconductor :
 
Texas Instruments: DaVinci™ Technology
 
Texas Instruments: Safe Bet Series
 
 
INDUSTRY LINKS
 
Photonics Association (Singapore)
Singapore Industrial Automation Association (SIAA)
Taiwan Semiconductor Industry Association (TSIA)
 
 
 
 
 
 
OUR SPONSORS
 












Texas Instruments: New Technical Video360 Podcast Demostrates Advantages of DaVinci™ Technology

 
 
ADS BY GOOGLE