MSU ECE 4743 - COMPUTER AIDED DESIGN OF DIGITAL SYSTEMS

Unformatted text preview:

EE 4743/6743COMPUTER AIDED DESIGN OF DIGITAL SYSTEMSLAB9: PULSE WIDTH MODULATIONDIGITAL / ANALOG CONVERSION PULSE WIDTH MODULATIONIMPLEMENTATION GRADE C: IMPLEMENT A PWM SIGNAL GENERATORGRADE B: LOAD THE ON-BOARD FLASH MEMORY WITH THE DESIGNGRADE A: CREATE A FADER USING THE PWM CIRCUITLAB DATA PAGE NAME: GRADE C: IMPLEMENT A PWM SIGNAL GENERATORGRADE B: LOAD THE ON-BOARD FLASH MEMORY WITH THE DESIGNGRADE A: USE TWO PRNG MODULES TO ENCRYPT AND DECRYPT A SERIAL STREAM OF DATAWORK LOG PAGE NAME: EE 4743/6743 COMPUTER AIDED DESIGN OF DIGITAL SYSTEMS LAB9: PULSE WIDTH MODULATION Learnin odulation (PWM) for analog control g Objectives: This experiment introduces pulse width m• nal interfacing Digital to Analog Conversion – For exter• PWM – For minimal analog conversion This lab assumes that you have purchased a Basys development board. You will need to fill out the lab DATA SHEET located at the end of this lab assignment during the performance of the lab. There is NO PRELAB for this assignment. DIGITAL / ANALOG CONVERSION A digital circuit sometimes needs to interface to the outside world. Usually the outside world is analog. So we must be able to convert from one to the other. In a digital circuit, the values of 1 and 0 represent two different voltages. We can say there is a halfway voltage where if our input is above the halfway voltage, is it a 1. If it is below the halfway voltage, then it is a 0. If we want to convert from an analog to a digital circuit, then there are more divisions than just a single halfway voltage. When the input voltage is within a certain range, then it is assigned a digital value of multiple bits. See Figure 1 below for an example of how this conversion is done. Analog Conversion Digital To convert a digital signal req uires a more sophisticated circuit. However, sometimes using smart digital design techniques, this can be performed using purely digital circuitry. uires simple circuitry, but to convert an analog signal reqVMAX VMIN VHALF 0 1 VMAX VMIN V2 FIGURE 1: DIGITAL VS. ANALOG VOLTAGE REPRESENTATIONS V1 00 11 V3 10 01 PULSE WIDTH MODULATION The output of a digital signal is either a 1 or a 0 – represented as a high and low voltage. If we have a digital clock, it constantly changes from a 1 to a 0 and back to a 1 after a set amount of time. The time from one rising edge to the next is called the clock period. Within each clock period, some of the time the voltage will be high, sometimes it will be low. The ratio of time that it is high vs. low is called the pulse width. For example, a clock which is high half the period and low half the period has a pulse width of 0.5 or 50%. ECE 4743/6743 Lab8: Pulse Width Modulation If we placed a DC multimeter on this clock output, it would read a voltage that is not at the high or low voltage. This is because it is trying to read the DC voltage. Since our signal is constantly changing voltages, the DC multimeter will find what the average voltage is. The average will be based on the high and low voltages, but also on the pulse width. For example, if our clock has a pulse width of 50%, then the DC multimeter will read a voltage exactly halfway between the high and low voltages. If the pulse width is 75%, then our clock is high 75% of the 2 clock period. This will produce a DC voltage which is more toward the high voltage. By varying the pulse width of our digital signal, also known as pulse width modulation (PWM), we can produce an analog DC voltage. However, the frequency of the signal must be high enough to produce this averaging effect. This technique can be applied to circuits that require a DC voltage such as lights or DC motors. A DC motor spins at a rate proportional to the DC voltage applied to it. So using PWM, we can digitally vary the speed of rotation without using a dedicated digital‐to‐analog converter. This technique can also be applied to LED light like on the Basys circuit board. IMPLEMENTATION The objective of this lab is to implement an LED fader. This will make the LEDs on the Basys board have a variable brightness. GRADE C: IMPLEMENT A PWM SIGNAL GENERATOR For this part of the lab, you must implement a pulse‐width modulated signal. The modulating frequency for the signal will be 3.125MHz (period of 320ns), and can have a variable pulse width in steps of 20ns. In other words, the system clock will be 50MHz, and the modulating frequency will be 16X that. To build this circuit you will need to use a 16‐bit rotating shift register. The PWM signal will be one bit of the parallel output. As we clock the register at 50MHz, we should see a 3.125MHz output. We will want to manually adjust the PWM signal, so set the upper 8‐bits of the parallel input to all 0’s, and connect the lower 8‐bits of the parallel input to the eight switches on the Pegasus board. Then connect the load input to button(1). Connect the clear input to button(0). Select one bit of the parallel output and connect it to one of the LEDs. Compile and download your design. Set all switches into the upper position and press button(1). The LED should turn on. Set switch(7) to the lower position and press button(1). There should be a slightly change in brightness, but perhaps not enough to notice depending on the ambient lighting in the room. Set switch(6) to the lower position and press button(1). Continue this with each switch and see the change in brightness. Demonstrate this to your TA. Note: This circuit wi % PWM signal. ll not produce the maximum brightness possible since it can only generate a 50GRADE B: LOAD THE ON‐BOARD FLASH MEMORY WITH THE DESIGN The next part of the lab will be to program the on‐board Flash chip with the code from the previous part. One of the processes under “Generate Programming File” is “Generate PROM, ACE, or JTAG File”. Execute that process. Create a Xilinx Serial PROM file in the MCS format. The specific flash chip on the Basys board is the xcf01s chip. Once you have specific the flash chip, you must add the bit file to the datastream. Once the program says it has successfully formatted the file, exit the program. Execute the process “Configure Device”. There are two devices that appear in the datastream – the FPGA and the Flash


View Full Document

MSU ECE 4743 - COMPUTER AIDED DESIGN OF DIGITAL SYSTEMS

Download COMPUTER AIDED DESIGN OF DIGITAL SYSTEMS
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view COMPUTER AIDED DESIGN OF DIGITAL SYSTEMS and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view COMPUTER AIDED DESIGN OF DIGITAL SYSTEMS 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?