如何使用MAXQ串行驱动程序开发应用-How to Use

[09-13 17:04:22]   来源:http://www.88dzw.com  控制技术   阅读:8871

文章摘要:Click on the RTS text in the BlackBox GUI. This event signals the EV kit to stop transmitting the characters. Notice that the printing in the BlackBox stops. Click again on the RTS text to enable the MAXQ to send characters, and see that the test string continues to update.Signaling the PC to Stop S

如何使用MAXQ串行驱动程序开发应用-How to Use,标签:计算机控制技术,工厂电气控制技术,http://www.88dzw.com
Click on the RTS text in the BlackBox GUI. This event signals the EV kit to stop transmitting the characters. Notice that the printing in the BlackBox stops. Click again on the RTS text to enable the MAXQ to send characters, and see that the test string continues to update.

Signaling the PC to Stop Sending the Characters

Press the SW4 switch on the MAXQ EV kit. This signals the PC (BlackBox application) to stop sending the characters. The CTS text on the GUI should turn from green to black. Enter some characters in the BlackBox application and see that the characters are not echoed back. Press the SW4 switch again which turns the CTS signal back to green. The characters that were typed before should echo back.

Figure 2. The BlackBox sample application to run on your PC.
Figure 2. The BlackBox sample application to run on your PC.

Application Overview

The file sample_serial.c contains the application's main routine and interrupt service routines (ISR) for servicing the serial interrupts and external interrupts. The firmware does the following:
  1. serial_init() initializes the serial driver.
  2. serial_setparameters() configures the serial driver for 115200/8/1/N. You can configure these parameters according to your application needs.
  3. Configures the external interrupts 10 (Int10 is connected to RTS line) and 11 (SW6 #3 is ON).
  4. Enables the interrupts for module 1 (external interrupts) and module 2 (UART).
  5. Enables global interrupts.
  6. Reads and writes from/to the serial port in a loop through serial_read() and serial_write().
  7. The interrupt service routine handles RTS/CTS control flow. (Pressing the SW4 button asserts or deasserts the RTS line from the EV kit; the RTS line from the PC stops/restarts the serial transmission.)

Limitations and Development Issues

  1. The MAXQ serial driver does not support flow control (software/hardware). It is the responsibility of the application to implement the flow control. The sample application provided in this application note describes the hardware (RTS/CTS) flow control.
  2. The MAXQ serial driver provided is compiled for MAXQ2000 and 16MHz crystal configurations. Changing the crystal frequency will alter the driver's baud rate computation.
  3. The MAXQ serial-driver internal transmit-and-receive buffers' sizes are fixed at compile time as 256 bytes.

Conclusion

The MAXQ compiler provided by IAR and Rowley Associates and the libraries provided by Maxim allow applications written in C to access the power and functionality of MAXQ devices. The MAXQ serial will enable users to deploy applications that use the MAXQ UART.

IAR Embedded Workbench is a registered trademark of IAR Systems AB.
Java is a trademark of Sun Microsystems, Inc.
MAXQ is a registered trademark of Maxim Integrated Products, Inc.
<-- END: DB HTML -->

上一页  [1] [2] [3] 


Tag:控制技术计算机控制技术,工厂电气控制技术控制技术