09_KHIN AYE MU

  • View
    145

  • Download
    6

Embed Size (px)

Text of 09_KHIN AYE MU

DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA (J0605162)

KHIN AYE MU

DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA

TITLE OF RESEARCH DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA) NAME KHIN AYE MU (J0605162) YEAR 2009

Project No: JAN 09/BEHE/11

KHIN AYE MU (J0605162)

Project No: JAN 09/BEHE/11

SCHOOL OF SCIENCE AND TECHNOLOGY SIM UNIVERSITY

2009

DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA (J0605162)

KHIN AYE MU

DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA

KHIN AYE MU

(J0605162)

Project No: JAN 09/BEHE/11

School of Science and TechnologyENG 499 CAPSTONE PROJECT COURSE

A THESIS SUBMITTED TO SIM UNIVERSITY IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE BACHELOR DEGREE OF ELECTRONICS ENGINEERING2009

DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA (J0605162)

KHIN AYE MU

ABSTRACT

This purpose of this project is to develop and implement a general purpose VLSI (Very Large Scale Integration) Test Module based on a FPGA (Field Programmable Gate Array) system to model a digital voltmeter which is enable to measure both DC and AC voltage signal. This is achieved by using the Xilinx Spartan 3A FPGA toolkit which has a fully embedded system (ADC, LCD module, etc). All the work is done by VHDL programming. Architect, programming logic, simulation and hardware of this system is included in the following chapters.

DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA (J0605162)

KHIN AYE MU

ACKNOWLEDGMENTS

Firstly, I would like to express my sincere and heartfelt appreciation to my project supervisor, Mr Mak Lin Seng for his exceptional guidance, invaluable advice and wholehearted support in matters of practical and theoretical nature throughout the project. His expert experience in design and programming parts of FPGA and VHDL Design, valuable comments and suggestions have been very helpful in solving problems of the project.

I am gratefully appreciative of UniSIM capstone project instructors for providing me the opportunity to study in the exciting and challenging areas of Design a Single Channel Digital Voltmeter using FPGA.

I am indebted to my employer, Advanced Micro Devices (AMD) for allowing me to further study towards Bachelor Degree. I am also grateful to my superiors Mr Benjamin Ng, Mr Medrick for allowing me to take time off from work during the course of my project work as well as my normal academic years.

Finally, my special thanks to my parents, husband and upcoming baby for their love, inspiration and constant moral support throughout my academic years.

DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA (J0605162)

KHIN AYE MU

LISTS OF FIGURES Figure 1.1: Xilinx Spartan 3A Starter Kit ........................................................................... 2 Figure 1.2: Digital voltmeter (Left) and Analog voltmeter (Right) .................................... 3 Figure 2.1: The architect of digital voltmeter ..................................................................... 4 Figure 3.1: Structure of an FPGA ..................................................................................... 10 Figure 3.2: The Spartan-3A Development System Board Photo ...................................... 12 Figure 3.4: The timing diagram of Spartan 3A ADC gain setting .................................... 15 Figure 3.5: Analog-to-Digital Conversion Interface ......................................................... 15 Figure 3.6: The connection between LCD and FPGA ...................................................... 17 Figure 3.7: The character location in DD RAM ............................................................... 18 Figure 3.8: The waveform for LCD 4-bit data interfaces operation ................................ 19 Figure 4.1: Major Activities in FPGA Design .................................................................. 20 Figure 4.2: ModelSim Interface ........................................................................................ 22 Figure 4.3: Precision RTL Interface ................................................................................. 23 Figure 4.4: FPGA Design Flow Overview in ISE ............................................................ 25 Figure 4.5: ISE Implementation Interface ........................................................................ 26 Figure 5.1: Flow chart of Amplifiers Gain Setting .......................................................... 28 Figure 5.2: Waveform of Amplifiers Gain Setting .......................................................... 29 Figure 5.3: Flow chart of Analog to Digital Signal Capture ............................................ 30 Figure 5.4: Detailed SPI Timing to ADC ......................................................................... 31 Figure 5.5: Flow chart of BCD Conversion ...................................................................... 32 Figure 5.6: Different Magnitude of Sinusoidal Wave ...................................................... 34

DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA (J0605162)

KHIN AYE MU

Figure 5.7: Spartan-3A Hardware Setting for Sine Wave ................................................ 36 Figure 5.8: Software Implementation of RMS Function .................................................. 37 Figure 6.1: The simulated waveform of amplifier gain setting ........................................ 38 Figure 6.2: The simulated waveform of ADC data capture .............................................. 39 Figure 6.3: Waveform of getting ADC data ..................................................................... 40 Figure 6.4: Waveform of computing VIN ........................................................................ 40 Figure 6.5: Waveform of getting BCD data format .......................................................... 41 Figure 6.6: Overall waveform ........................................................................................... 41 Figure 7.1: DC Voltage Measurement Setup .................................................................... 42 Figure 7.2: Sine Wave Signal Measurement Setup .......................................................... 43

DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA (J0605162)

KHIN AYE MU

LIST OF TABLES

Table 2.1: Technical Specification of Single Channel Digital Voltmeter .......................... 7 Table 3.1: Programmable Gain Settings for Pre-Amplifier .............................................. 16 Table 3.2: Table for LCD displaying ................................................................................ 18 Table 5.1: Binary to BCD Conversion .............................................................................. 33 Table 7.1: DC Voltage Measurement ............................................................................... 42 Table 7.2: RMS Sine Wave Voltage Measurement .......................................................... 43

DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA (J0605162)

KHIN AYE MU

TABLE OF CONTENTSPage

ABSTRACT ............................................................................................... i ACKNOWLEDGEMENT....................................................................... ii LISTS OF FIGURES .............................................................................. iii LIST OF TABLES .................................................................................. iv Chapter 1 Introduction ................................................................................1 Chapter 2 Voltmeter Architect....................................................................4 2.1 Functional Block of designed digital voltmeter ................................4 2.2 Designed digital voltmeters operation ..............................................6 2.3 Technical Specification of the Single Channel Digital Voltmeter .....7 Chapter 3 Spartan-3A Development System ..............................................9 3.1 VLSI and FPGA Technology Introduction ........................................9 3.2 The Spartan-3A Development System............................................. 11 3.2.1 Analog Capture Circuit .................................................................13 3.2.2 Character LCD Screen ..................................................................16 Chapter 4 FPGA Implementation .............................................................19 4.1 Simulation Tool: ModelSim.............................................................21 4.2 Synthesis Tool: Precision RTL ........................................................22 4.3 Implementation: ISE ........................................................................24 4.4 Role of HDL ....................................................................................26 Chapter 5 Programming Logic .................................................................27

DESIGN A SINGLE CHANNEL DIGITAL VOLTMETER USING FPGA (J0605162)

KHIN AYE MU

5.1 Amplifiers Gain Setting ..................................................................27 5.2 Analog-to-Digital signal capture......................................................29 5.3 Binary to BCD decoding .................................................................31 5.4 RMS Voltage Calculation for Sinusoidal Wave ...............................33 5.4.1 Magnitude of a Sine Wave ............................................................33 5.4.2 Implementation of RMS Function in Spartan-3A Board..............35 Chapter 6 Simulation ................................................................................38 Chapter 7 Hardware Realiza