|
|
This
driver provides external access to the data values exposed in the PSoC Express
project Interface Register Map. The
driver creates a register based slave interface using a USB connection to a PC. A PC application relies on a software driver
(USBSER.SYS under Windows) that emulates an RS-232 serial port on the USB interface. PSoC Express will create an installable .INF
for Windows support. The generated .INF
file is located in the <projectname>\<projectname>\lib
folder.
The
USB UART will appear as a virtual Com port identified in the Device Manger’s
Hardware list under Ports (Com & LPT).
Connecting to the USB UART
using Hyper Terminal: To connect to the USB UART virtual Com port
using Hyper Terminal (or similar terminal emulation application) the following
property must be configured. In the
ASCII Setup screen under the Settings tab in the Properties dialog, “Echo typed
characters locally” must be selected.
This
driver supports the “hot” plug and “hot” unplug. There is two ways:
1.
User must close the HyperTerminal after the “hot” disconnect
USB cable from device. The USB cable must be connected before the starting of
HyperTerminal.
2.
User must disconnect the USB cable from device after
the HyperTerminal closing. The USB cable must be connected before the starting
of HyperTerminal. This way is the most correct.
Protocol Description: The USB-UART data
transfer protocol is text based, using spaces as the token separators and the carriage
return (ASCII code 0x0D) or linefeed character (ASCII code 0x0A) to terminate
token strings.
All
data (command parameters and returned data) is formatted as 2-character
hexadecimal values (ie. 00 – FF). The command parser is case insensitive. Hexadecimal characters ‘a’ through ‘f’ are
treated identically to the characters ‘A’ through ‘F’.
Access to the Interface Register Map is controlled by
a register address or offset pointer.
The register address pointer is set by any Write command sent to the
PSoC. Subsequent Read commands will read
data from the register offset set by the most recent Write command.
Command Description: The USB-UART driver provides three
commands for accessing the Register Map data on the PSoC. The following table lists the commands. Command syntax uses the following rules: 1) Command
tokens are shown in UPPER CASE and are entered verbatim. 2) Values show in < > are required
entries. 3) Values shown in [brackets]
are optional. 4) Ellipsis (…) indicate a variable number of entries.
One-Time Read:
RD <count>
Continuous Read:
CRD <count>
One-Time Write:
WR <register_address> [byte_1] … [byte_n]
One-Time Read: requests the PSoC to return a set of byte values starting at the current
register address (set by the most recent write (WR) command). The count parameter specifies the number of bytes
to read. The PSoC returns the requested
data as a string of space separated 2-character hexadecimal values terminated
by a linefeed character.
Continuous Read: requests the PSoC to continuously return a set of byte values starting
at the current register address (set by the most recent write (WR) command). The count parameter specifies the number of
bytes to read. The requested data will
be continuously returned in the format described for the RD command above. Command inputs are ignored during the data
stream. Sending a linefeed character
will terminate the data stream and allow a new command input to be processed.
One-Time Write: sets the current value of the register address, and optionally writes a
number of bytes to the PSoC memory map starting at the specified register
address. The register_address
parameter is a 2-character hexadecimal code.
Following the register_address parameter is an
optional set of space separated 2-character hexadecimal values (byte_1 through byte_n) to be written to the PSoC memory map starting at
the specified register_address. 1 to 8 bytes can be written by a single
command.
Hardware Interface: The PSoC USB pins are configured to connect to the
PC’s USB bus.
Software Interface: NA
User Configurable
Properties
·
Vendor ID: This value is the USB
vendor ID that will be embedded in the device.
The value must be entered as a decimal number.
·
Product ID: This value is the USB product ID that will be embedded
in the device. The value must be entered
as a decimal number.
·
Vendor String: This value is the USB vendor string that will be
embedded in the device. An underscore
character (‘_’) will be replaced by a space in the vendor string.
·
Product String: This value is the USB product string that will be
embedded in the device. An underscore character (‘_’) will be replaced by a space
in the product string.
·
Serial Number
String: This value is the USB serial number string that will
be embedded in the device. The value must be entered as a decimal number.
·
Device Power: This value is the USB device power source.
·
Max Power: This value is the USB max power to embed in the
device, in mA.
If the device is self-powered this parameter is ignored.
·
USB Speed: Full Speed