Getting Started: Running the “Device – CDC - Serial Emulator" demo

Getting Started: Running the “Device – HID – UART to USB Bridge” demo

Required Hardware: 1

Configuration 1: Low Pin Count Development Kit 1

Configuring the Hardware: 1

Configuration 1: Low Pin Count Development Kit 5

Firmware. 5

Running the Demo. 6

Trademarks: 8

## Required Hardware:

To run this project, you will need one of the following sets of hardware:

### Configuration 1: Low Pin Count USB Development Kit

Low Pin Count USB Development Kit with PICKit 2 Debugger/Programmer (DV164126) or without Debugger/Programmer (DM164127)

## Configuring the Hardware:

This section describes how to set up the various configurations of hardware to run this demo.

Configuration 1: Low Pin Count USB Development Kit

### Configuration 4: Low Pin Count USB Development Kit

1) Short pins 2 and 3 of J14. When connecting the Low Pin Count USB Development Kit board to a PC, a DE9 gender changer is required.

Firmware:

To run this project, you will need to load the corresponding firmware into the devices.

The source code for this demo is available in the “<Install Directory>\USB Device – HID – UART to USB Bridge\Firmware” directory. In this directory you will find all of the user level source and header files as well as project and workspace files for each of the hardware platforms. Find the project (*.mcp) or workspace (*.mcw) file that corresponds to the hardware platform you wish to test. Compile and program the demo code into the hardware platform. For more help on how to compile and program projects, please refer to the MPLAB® IDE help available through the help menu of MPLAB IDE (Help->Topics…->MPLAB IDE).

This demo defaults to using 115200 as the baud rate. In order to change the baud rate of the example, go to the HardwareProfile header file that corresponds to the hardware platform in use. In the RS232 configuration section of this header file is a BAUDRATE definition. Change the value of BAUDRATE and rebuild the project.

Running the Demo:

This demo allows the device to appear like a Human Interface Device (HID) but act as a UART to USB bridge. This demo will take data received over the UART and send it over the USB. Likewise, data received on the USB will be sent over the UART.

Because the HID class uses fixed size reports and in this application a variable size data payload is required, the first byte of each transmission, both from the USB and the UART needs to be size of the data payload. The application then has 63 bytes of data that they are allowed in a single transmission.

Connect the hardware both to the serial port on the computer (or other target device) and the USB port. Launch the “<install directory>\USB Device - HID - UART to USB bridge\UART to USB HID bridge.exe” application.

Click the connect button to start a connection to the device. If the device is successfully connected the “Connect” button will become disabled and the “Send Data” button will become enabled. At this point open up a terminal program and connect to the serial port that the device is attached to at the baud rate specified in the HardwareProfile header described in the previous section.

Typing in the terminal window will result in the decimal value of the ASCII value for that key to be displayed in the PC application. For example if ‘1’ is press then ‘49’ will get printed in the PC application window. This corresponds to the ASCII value 0x31 (or 49 decimal) for the key ‘1’.

Typing in the text box and pressing the ‘Send Data’ button will result in that data being set starting from the USB, through the UART, to the Terminal application.

## Trademarks:

The Microchip name and logo, the Microchip logo, MPLAB, and PIC are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.

PICDEM and PICTail are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.

Microsoft, Windows, and Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.