NIOS2 essay--jpeg Picture of the UART transmission display

Source: Internet
Author: User

1. System Overview

This design uses NIOS2 32-bit processor, through the SPI interface to the SD/TF card in the JPEG image data read into memory, SD/TF card file system for the FAT32,NIOS2 software implementation of the JPEG image through the UART serial port sent to the host computer display, the system diagram is as follows:

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/8F/A9/wKiom1jnqIqQ3_fnAAAVKUViYLs255.png "title=" Uart_ Arch.png "alt=" Wkiom1jnqiqq3_fnaaavkuviyls255.png "/>


2. Introduction of UART

The UART (Universal asynchronous Receiver/transmitter) is an asynchronous transceiver that works by transmitting each character of the transmitted data one after the other.

The UART is in the logic 1 state at idle time, and its members have the following meanings:

    • Starting bit: A signal of logic "0" is emitted to indicate the beginning of the transmission character.

    • Data bit: Immediately after the start bit. The number of data bits is typically 8, which makes up one character. The ASCII code is usually used, starting from the lowest bit and positioning by the clock.

    • Parity bit: When the data bit is added to this bit, the number of digits in the 1 should be even (even parity) or odd (parity).

    • Stop bit: The end flag for a character data, which can be a 1-bit, 1.5-bit, 2-bit high level. Since the data is timed on the transmission line, and each device has its own clock, it is likely that there is a small difference between the two devices in the communication. Therefore, a high-level time of more than 1 bits is required, providing the opportunity for the computer to calibrate clock synchronization.


3. Build Qsys System

Here the main is to add the UART component, as shown in:

650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M02/8F/A9/wKiom1jnrMPzj9L2AACDBB2PwPY808.jpg "title=" Uart_ Qsys_set.jpg "alt=" Wkiom1jnrmpzj9l2aacdbb2pwpy808.jpg "/>

650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M01/8F/A9/wKiom1jnqzqj_AYHAAEnNguCXSE408.jpg "title=" Uart_ Qsys.jpg "width=" "height=" 426 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:750px;height:426px; "alt=" Wkiom1jnqzqj_ayhaaenngucxse408.jpg "/>


4. Drive Software Design
Driver code, which is responsible for reading the JPEG image in SD to memory and sending it to the host computer via UART.

unsigned char desk[54171];int main (void) {int i; file* FP;FP = fopen ("/dev/uart_0", "w"), while (1) {for (i=0;i<54171;i++) {if (fp!=null) {fprintf (FP, "%c", Desk[i]);}} Fclose (FP); return 0;}


5. Final results

After compiling and running the software, open the host computer demo software, set the serial port baud rate is 115200, open the serial port, the picture is displayed correctly.

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/8F/A9/wKiom1jnroaxumgEAAQgTRDa4UM901.png "title=" Uart_ Demo.png "width=" 720 "height=" 373 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:720px;height:373px; "alt=" Wkiom1jnroaxumgeaaqgtrda4um901.png "/>

This article is from the "Shugenyin blog" blog, make sure to keep this source http://shugenyin.blog.51cto.com/4259554/1914015

NIOS2 essay--jpeg Picture of the UART transmission display

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.