![]() |
USB Component
Version 6.3
MDK-Professional Middleware for USB Device and Host
|
This example application shows how to connect USB to serial RS232 adapter with Prolific PL2303 UART-to-USB bridge chip to a development board. It is a simple demonstration on how to send data from the USB Host via the USB to serial RS232 adapter to an attached serial terminal. Here, the USB Host sends "Test!" to the USB to serial RS232 adapter and stores all incoming messages from the device in the variable receive_buf
. This example is using the Custom Class because the PL2303 is not USB CDC ACM compliant.
The following picture shows an exemplary connection of the development board and an PL2303 based Device. The PL2303 Device is connected to a PC via RS232 to check incoming messages.
Create a new project in MDK. In this example, we are using the MCBSTM32F400 board with the STM32F407IGHx device. In the Manage Run-Time Environment window, select the following components:
Click the Resolve button and then OK.
Before continuing to add the required source code, you need to add a template file called USBH_PL2303.c:
Finally, your Project should look like this:
Before building the project, you need to edit these configuration files:
Before building and downloading the project to the target, make sure that the correct debugger is set in the Options for Target dialog (ALT + F7). You may then build and download the example project to the evaluation board using the µVision commands:
After these steps, the project should start executing on your evaluation kit. In case of errors, refer to the Evaluation Board User's Guide for configuration information.
receive_buf
buffer called by the ->Receive
function.