Chapter 5 is finally available-FPGA-based c2mif software design and VGA Application

Source: Internet
Author: User
Chapter 5 is finally available-FPGA-based c2mif software design and VGA application I. Overview of the MIF File

For a long time, do you want to talk about the design and application of the MIF file? Bingo cannot decide on his own. I have written so many, and I am a little tired.

Finally, I bit my teeth and wrote it, because no one has ever written it, so I want to write it. If I don't take the ordinary path, I will open up this road, let the design and application of the MIF file application software in FPGA be frozen from now on. At the same time, I hope that you will not be so depressed.

The Application of MIF files in FPGA is mainly used in Ram and Rom to store the model, waveform data, signal sampling, data sequence, and so on. It can be seen as an array in C language, used to store data. Bingo was also very depressed in the past. When I was a keyboard, I also manually wrote the music-level MIF file in the Quartus II memory initialation file. Eyes have been spent; I have used waveform generators and have the support of Kangxin guagle, which is very convenient; for VGA character image display, the font data is huge, Bingo finally passed the C language, according to the format of MIF, the software was designed.

Due to the embarrassment of data volume in the project, the C language conversion was designed.Program. Bingo designed c2mif file conversion in C language in that yearCodeThe blog address is as follows:

Http://www.cnblogs.com/crazybingo/archive/2010/08/02/1790151.html

In this chapter, Bingo describes the description of the MIF file, the design of the MIF software, and the application of the MIF file in detail.

II. Introduction to MIF conversion software 1. Kangxin guagle Software

: Http://www.chinaaet.com/lib/detail.aspx? Id = 86667

This is the MIF conversion software for waveform data generators designed by Kangxin Corporation in Hangzhou. This software is mainly used in the generation of waveform data. It can generate the MIF files of waveforms such as sine wave, square wave, triangle wave, and jagged wave. The length and width can be adjusted by GUI, this software is easy to generate, and can eliminate MATLAB orC LanguageThis is complicated.

For software adjustment and output of the MIF interface, this software is easy to use, lightweight and convenient.

2. Foreign mifgen Software

This software was designed by a foreign cool man and is also a software for generating waveform data. I personally think it is not as easy to use as the guagle of Kangxin in China. Therefore, I did not give a detailed introduction.

:

3. c2mif software for bingo

(1)C2mif BingoPurpose of writing this software

In FPGA design, there is no official software for editing and converting the MIF file (qii manual input is not counted ). This is a lot of inconvenience. Bingo used VC to write the conversion software in that year, which is inconvenient to convert in the DOS window. After a long time of struggle, I tried to find myself better than myself. I finally paid close attention to VB recently. I wanted to change the underlying C language conversion program I designed in that year. I didn't expect it to be sold now. I got it all day and the software came out of this prototype, shanzhai version of the GUI platform, 152 K, compressed only 35 K mini software debut, VB is a good thing. O (∩) O Haha ~

Bingo version c2mif rev 1.0 MIF conversion software, officially released today. This software is compiled by bingo, with respect to copyright and Chinese people. It does not require serial numbers, registration, and cracking. It is permanently free to use and can be freely transmitted, we hope to bring convenience to people in the industry. O (∩) O Haha ~

The prototype of this software has been released, and bingo has been engaged in hardware, so the software thinking is weak and there will be bugs. If the author finds a software bug, or has more perfect suggestions, solutions, welcome to contact Bingo: hanbinhdu@foxmail.com, the software will continue to repair, update, so that you are more satisfied.

(2)C2mifInformation

**************************************** ************************

* Thanks for using c2mif.

* Copyright (c) 2011-endless crazybingo

* If you have any suggestions or bugs, contact me.

* The following is the editor information:

* Author: Han Bin

* Network Name: crazy bingo

* Blog: http://home.cnblogs.com/crazybingo/

* Http://blog.chinaaet.com/

* Weibo: http://weibo.com/crazybingo

* Email: hanbinhdu@foxmail.com

* All Rights Reserved: hangdian radio enthusiasts Association

* Software Version: rev 1.0

* Original date: 2011-08-05

* Modification date: 2011-xx-xx

**************************************** ************************

(3)C2mifHelp Information

**************************************** ************************

1. extract the data source to be converted

(1) Microsoft Visual C ++, Matlab, or other software to generate data, and copy the data directly into the c2mif editing window.

(2) the combination of the model extraction software, using the file opening function of c2mif to read TXT data.

(3) When there is a small amount of data, you can manually enter the c2mif editing window.

**************************************** ************************

Ii. Use of c2mif Software

This software allows the input of data or text in the "hexadecimal" format or "binary" format, and outputs the user-requested number of digits of the MIF file through the selection of software.

However, due to some factors, the software cannot directly convert hexadecimal to binary for related operations, and bingo does not feel necessary.

**************************************** ************************

The text input must follow a fixed format as follows:

(1) The software has passed the recognition conversion and can include the space "" at any position.

(2) The software has passed the recognition conversion and can contain commas (,) at any position.

(3) The software has passed the recognition conversion and can include the comma ";" at any position.

(4) The software has passed the recognition conversion and can include the comma "0x" at any position ".

(5) The software has passed the recognition conversion and can include the comma "{" at any position.

(6) The software has passed the identification conversion and can include the comma "}" at any position.

(7) The software has passed the recognition conversion and can contain carriage return.

(8) You can enter ",", ";", space, carriage return, "0x", "{", "}", and other characters at any position to improve data readability, the software automatically performs selective extraction. Except for the preceding seven characters, all characters other than valid data must be deleted manually. The software cannot be so intelligent, therefore, the "/*" "*/" and "const char hzk [] [24] =" generated by some die extraction software must be manually deleted. If you have extracted a lot of content, we recommend that you use Notepad ++ to adjust the structure. notepad ++ has the column operation function (CTRL + vertical selection of the mouse ).

(4)C2mifRelated downloads

**************************************** ************************

C2mif V1.0
Copyright (c) 2011-endless crazybingo
All Rights Reserved: hangdian radio enthusiasts Association

**************************************** ************************
Because MIF files are often used in FPGA, especially in liquid crystal or data processing, there is no software for converting such files. Bingo has compiled this software based on general requirements and hopes to be useful to you.

**************************************** ************************

Download the c2mif V1.0 Software

Http://www.chinaaet.com/lib/detail.aspx? Id = 86810

**************************************** ************************
About pc2lcd2002 Software
Http://www.chinaaet.com/lib/detail.aspx? Id = 86669

**************************************** ************************
For instructions on how to convert and use the c2mif software, visit the following website:
Http://blog.chinaaet.com/detail/21782.html
Http://www.cnblogs.com/crazybingo/archive/2011/08/10/2134185.html

**************************************** ************************
For more information about VB, see the following website:
Http://www.chinaaet.com/lib/detail.aspx? Id = 86805

**************************************** ************************
For more information about VB serial port Routine learning, see the following website:
Http://www.chinaaet.com/lib/detail.aspx? Id = 86806

**************************************** ************************
You can only help the same person. Thank you!

!

Iii. Steps for using the MIF Software

In this section, Bingo uses the pctolcd2002 and c2mif software for coordination to extract various fonts or image fonts and convert them to the corresponding MIF files.

Pctolcd2002 is an excellent model extraction software. It can edit fonts and images of different fonts and formats and output the language of C51 or A51, it can also be saved as a hexadecimal model of various formats for easy configuration.

Pctolcd2002: http://www.chinaaet.com/lib/detail.aspx? Id = 86669

1. pctolcd2002 model extraction

(1) first, select the character mode (default)

(2) create a model option to adapt to various formats, as shown below:

In the preceding section, the description of c2mif software data format is as follows: You can enter ",", "at any location ",","; ", space, carriage return," 0x "," {","} "and other characters improve data readability. The software automatically extracts the data. Therefore, it is flexible and the software will automatically process it.

Only for the option settings of pc2lcd2002 software, the most simple format of the corresponding output, of course, as long as it complies with the data format, do not tangle here.

(3) set the dot matrix 16*16 and enter the content of the model to be extracted, as follows:

(4) The interface displayed by the software is as follows:

(5) generate a model as follows:

(6) Save the model and open it with notepad ++. Delete unnecessary comments.

The c2mif software can only recognize ",", ";", spaces, carriage return, "0x", "{", "}", and therefore delete the comments and file headers. In the following two figures, you only need to delete the comments on the first line and on the right of the model. Other characters :",","; ", space, press enter," 0x "," {","} ", the software will automatically identify and process, you can set it at will; therefore, the format, this software is also suitable for other die extraction software, as long as you change the format slightly.

2. Use c2mif

Here we want to get a 16-bit MIF file. The setting steps are as follows:

(1) Open the software, click "open", and select the TXT file generated and modified

(2) The software has already selected the hexadecimal format by default. Select 4-bit hexadecimal data in the drop-down box and click "c2mif one-key conversion", as shown below:

(3) Search for crazybingo. MIF on the desktop and use Notepad ++ to open the following:

(4) You can apply the MIF file directly in Quartus II. The following is the crazybingo. MIF file generated by using Quartus II.

Iv. Project instances

Use the introduction in section 3 to generate a variety of characters. The characters in the Chinese character form are as follows.

The VGA display driver is described in the previous section. In this chapter, FPGA + VGA can also be used as Notepad. You can modify the content displayed by VGA as long as you modify the MIF file. The generation of MIF should be quite simple.

This section focuses on the display of the words "Radio lovers Association". The ASCII code is similar and is not cumbersome.

For code download, see

The project is relatively large, and it was written more than a year ago. The format is not very rigorous, and it is not written in accordance with the format of the previous chapter of Bingo. Please forgive me. The project was modified from the project of the logical analyzer, which mainly implemented the content display and timer functions at a resolution of 1024*768. For the VGA driver code module, see the previous chapter.Hsu_time_disp.v, Read this file to be able to well apply files such as MIF. VGA display driver is actually one thing.

1. Generate MIF

Three methods are used to extract the 64*64 "Radio fans Association" fonts and generate the MIF file. For more information, see the preceding section.

2. Create a project

Customizes the project according to the vga_panel_design module in the previous chapter. .

3. Modify vga_display.v

(1) Rom call and Region Positioning

As shown above, the <y_pos <256 region is located in the area where the content is displayed. For example, wireless_rom is located at x_pos []. it is equivalent to doubling the coordinates with the second position of the X axis address.

(3) character display

Careful readers should find that we use"Row-by-rowTo extract the model. This is to facilitate the Code:

A) since each column is a separate data, the data output can only be changed according to the Y axis coordinate, which is convenient for software design.

B) Each Rom address corresponds to the x-axis address, which facilitates offset.

Note: For example, y_pos [6] instead of y_pos [] is equivalent to doubling the coordinates with the change of the second position of the Y axis address.

4. Project

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.