⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basic-usart-hw-handshaking-project.html

📁 at91sam7x的最新版Ucos-II内核源码.
💻 HTML
字号:
<!DOCTYPE PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>Atmel Corporation - Basic USART Hardware Handshaking</title>
        <link rel="stylesheet" type="text/css" href="css/style.css" />
    </head>
    
    <body>
        <h1>Basic USART Hardware Handshaking 1.4</h1>

        <div id="breadcrumb">
            <a href="../index.html">Main</a> >
            <a href="examples.html">Examples</a> >
            USART Hardware Handshaking
        </div>

        <h2>Purpose</h2>
        <p>
            This example demonstrates the hardware handshaking mode (i.e. RTS/CTS)
            provided by the USART peripherals on AT91 microcontrollers. The practical
            use of hardware handshaking is that it allows to stop transfer on the USART
            without losing any data in the process. This is very useful for applications
            that need to program slow memories for example.
        </p>

        <div class="requirements">
            <h2>Hardware Requirements</h2>
            <p>
                This example can be used on any AT91 evaluation kit, except when they do
                not provide an USART serial port (i.e. on AT91SAM9261-EK, AT91SAM7L-EK and
                AT91SAM7L-STK).
            </p>
        </div>

        <h2>Description</h2>
        <p>
            The provided program uses hardware handshaking mode to regulate the data
            rate of an incoming file transfer. A terminal application, such as
            hyperterminal, is used to send a text file to the device (without any
            protocol such as X-modem). The device will enforce the configured
            bytes per second (bps) rate with its Request To Send (RTS) line.
        </p>
        <p>
            Whenever the data rate meet or exceed the configurable threshold, the device
            stops receiving data on the USART. Since no buffer is provided to the PDC,
            this will set the RTS line, telling the computer to stop sending data. Each
            second, the current data rate and total number of bytes received are
            displayed; the transfer is also restarted.
        </p>
        <p>
            Note that the device may receive slightly less bytes than the actual file
            size, depending on the nature of the file. This does NOT mean that bytes
            have been lost: this is simply an issue with how line breaks are transmitted
            by the terminal. It is therefore better to use binary files, as they most
            often do not contain line breaks. For example, send one of the object files
            generated by the compiler.
        </p>

        <p class="warning">
            The serial cables provided with AT91 evaluation kits CANNOT be used with
            this example, as RTS and CTS are not connected appropriately. Make sure that
            the RS-232 cable is a null-modem cable, with TXD <-> RXD and RTS <-> CTS.
        </p>
       
        <h2>Usage</h2>
        <ol>
            <li>
                Build the program and download it inside the evaluation board. Please
                refer to the <a href="http://www.atmel.com/dyn/resources/prod_documents/doc61.4.pdf">SAM-BA User Guide</a>,
                the <a href="http://www.atmel.com/dyn/resources/prod_documents/doc6310.pdf">GNU-Based Software Development</a>
                application note or to the <a href="http://www.iar.com/p89836/p89836_eng.php">IAR EWARM User Guide</a>,
                depending on your chosen solution.
            </li>
            <li>
                Connect a serial cable to the USART0 port on the evaluation kit. It will
                most often be labeled "RS232 COM port".
            </li>
            <li>
                On the computer, open and configure a terminal application (e.g.
                HyperTerminal on Microsoft Windows) with these settings:
                <ul>
                    <li>115200 bauds</li>
                    <li>8 data bits</li>
                    <li>No parity</li>
                    <li>1 stop bit</li>
                    <li>Hardware flow control (RTS/CTS)</li>
                </ul>
            </li>
            <li>
                Start the application. The following traces shall appear on the terminal:
                <blockquote>
                    <code>
                        -- Basic USART Hardware Handshaking Project 1.4 --<br />
                        Bps:    0; Tot:      0
                    </code>
                </blockquote>
            </li>
            <li>
                Send a file in text format to the device. On HyperTerminal, this is done
                by selecting "Transfer -> Send Text File" (this does not prevent you from
                sending binary files). The transfer will start and the device will update
                the bps and total counts on the terminal.
            </li>
            <li>
                Whenever the transfer is complete, the total number of bytes received
                should match the size of the sent file (unless it is a text file, see
                explanation in description section).
            </li>
        </ol>

        <h6>Atmel Corporation ©2008</h6>
    </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -