ST AN2405 Application note

AN2405

Application note

Migrating from RS232-only applications to

RS232/USB applications using Turbo Plus uPSD

Introduction

Most laptops and recent desktops do not have serial ports however many legacy applications still use RS232. The scope of this application note is to migrate such RS232 applications to RS232/USB applications using Turbo Plus uPSD. Since Turbo Plus uPSD has two UART ports, one of them is used for the USB-to-Serial Bridge connection. The scope is to implement an easy migration with minimal impact on legacy applications.

Product(s) -Obsolete

Product(s) Obsolete

July 2007

Rev 1

1/13

www.st.com

Contents

AN2405

 

 

Contents

1

Migration description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

 

1.1

Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

 

1.2

Loading CDC class drivers for USB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

 

1.3

.INF file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4

1.3.1 Usbser.inf (Windows 2000,XP only) file: . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.4 CDC Firmware Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.5 CDC Class Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.6USB_UART1 Bridge (HW Connection-User setup or Automatic USB Detect) 8

 

1.7 USB-to-Serial Bridge plug-in . . . . . . . . . . . . . .

Product(s). . . . . . . . . . . . . . . . . . . .

. 9

 

 

 

9

 

1.8 Example of easy migration to RS232_USB application: . . . . . . . . . . . . . .

2

Conclusion . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

10

3

References . . . . . . . . . . . .

. .Obsolete. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11

4

Revision history

12

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

 

 

-

 

 

 

Product(s)

 

 

Obsolete

 

 

 

2/13

AN2405

Migration description

 

 

1 Migration description

1.1Architecture

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

USB Migrated PC Application

 

 

 

 

 

 

 

 

 

 

(Legacy Serial Port or Virtual

 

 

 

 

 

 

 

 

 

 

Serial Port over USB)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Legacy PC Application

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UARTdrivers + CDC class

 

 

 

 

 

 

 

 

 

 

device drivers for USB

 

 

 

 

 

 

 

 

 

 

 

 

 

UART drivers

 

 

 

 

 

(usbser.sys, usbser.inf)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UARTT H/W & DB9 Connector

 

 

 

UART H/W & DB9

 

 

 

 

 

 

 

 

 

 

 

 

 

+

 

 

 

Connector

 

 

 

 

 

 

 

 

 

 

 

 

 

USB H/W & USB Type A

 

 

 

 

 

 

 

Easy

 

 

 

 

 

 

 

Product(s)

 

 

 

 

 

 

 

 

 

 

 

RS232

 

 

Migration

Connector

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UART0 H/W & DB9

 

 

 

 

 

 

RS232 or USB

 

 

 

 

 

 

 

 

 

 

 

Connector

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UART0 H/W & DB9

 

 

 

UART0 firmware driver

 

 

 

 

 

 

 

 

 

 

 

 

 

Connector

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

+

 

 

 

 

 

 

 

Obsolete CDC class driver

 

 

 

Receiving over UART0

 

 

 

 

 

UART0 only

 

 

 

 

 

USB H/W & USB Type B

 

 

 

microcontroller

 

 

 

 

 

Connector

 

 

 

Firmware Application

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UQRT0 firmware driver + USB

 

 

 

Transmitting and

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Product(s)

-

 

 

 

 

 

 

 

MCU -> Turbo Plus uPSD

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UART0 Tx and Rx connected

 

 

 

 

 

 

 

 

 

 

to UART1 Rx and Tx

 

 

 

 

 

 

 

 

 

 

(HW connection-User Setup or

 

 

 

 

 

 

 

 

 

 

Automatic USB Detect)

 

Obsolete

 

 

 

 

 

USB-to-UART1 Bridge Plug-in

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Unchanged Firmware

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Application Transmitting and

 

 

 

 

 

 

 

 

 

 

Receiving over UART0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1.2Loading CDC class drivers for USB

Install the setup application provided with this example and the necessary CDC class drivers will be loaded on your PC. The driver installed will work with Windows 2000 & XP

3/13

ST AN2405 Application note

Migration description

AN2405

 

 

only. The .inf file has to be modified to work with Windows 98/Me. When connected to a device that has CDC class implemented, Windows will see USB as a virtual COM port.

PC Application

Usbser.sys Usbser.inf

CDC Descriptors

Target Device

1.3.INF file

 

 

Product(s)

 

When a USB device is connected, windows checks the .inf file to load the appropriate driver

 

for the device.

Obsolete

 

their own VID & PID.

 

Microsoft does not provide an .inf file with the usbser.sys driver file. The .inf file usbser.inf

 

provided via the setup application allows the user to load the usbser.sys driver file under

 

Windows 2000 and Windows XP. The .inf file has to be modified to work with Windows

 

98/Me.

 

 

Application manufacturers can modify this file and the device descriptors in usb_desc.h for

 

 

-

 

Product(s)

 

To install the drivers from a directory instead of running the provided setup application, copy

 

the usbser.inf file and usbser.sys file to a folder. When the dialog box displaying “Found

 

New Hardware Wizard” opens up, choose Install from a specific location and point to the

 

folder where the usbser.inf file is copied.

Note:

Do not copy the .inf file into the windows\inf folder manually.

1.3.1

Usbser.inf (Windows 2000,XP only) file:

 

[Version]

 

 

DriverVer=08/03/2004,5.1.2600.2180

 

Signature=$CHICAGO$

 

 

Class=Ports

 

 

ClassGUID={4d36e978-e325-11ce-bfc1-08002be10318}

ObsoleteProvider=%String0%

 

; Port Class Install [ClassInstall] AddReg=USBClassInstall

[USBClassInstall]

HKR,,,,%Enumerator% HKR,,Icon,,"-23"

4/13

Loading...
+ 9 hidden pages