Getting Started: Running the “Device
– CDC – Serial Emulator” demo
Configuration
1: PICDEM FS USB
Configuration
2: PIC18F87J50 PIM + HPC Explorer
Configuration
4: Low Pin Count Development Kit
Configuration
1: PICDEM FS USB
Configuration
2: PIC18F87J50 PIM
Configuration
4: Low Pin Count Development Kit
To run this project, you will need one of the
following sets of hardware:
PICDEM
FS USB (DM163025)
PIC18F87J50
Plug-In-Module (PIM) (MA180021)
PIC24FJ256GB110
Plug-In-Module (PIM) (MA240014)
Explorer 16 (DM240001)
USB
PICtail™ Plus Daughter Card (AC164131)
Low
Pin Count USB Development Kit with PICKit 2
Debugger/Programmer (DV164126)
or without Debugger/Programmer (DM164127)
This
section describes how to set up the various configurations of hardware to run this
demo.
Configuration 1: PICDEM FS USB
Configuration 2: PIC18F87J50 PIM + HPC Explorer
Configuration 3: PIC24FJ256GB110 PIM + Explorer 16
Configuration 4: Low Pin Count USB Development
Kit
1)
If using the PICDEM FS USB Demo Board, no hardware related configuration or
jumper setting changes should be necessary.
The demo board need only be programmed with appropriate firmware.
1)
Short JP4 on the PIC18F87J50 PIM. This
allows the demo board to be powered through bus power.
2)
Short JP1 such that the “R” and “U” options are shorted.
1)
Before attaching the PIC24FJ256GB110 PIM to the Explorer 16 board, insure that
the processor selector switch (S2) is in the “PIM” position as seen in the
image below.
2)
Short the J7 jumper to the “PIC24” setting
3)
Before connecting the PIC24FJ256GB110 PIM to the Explorer 16 board, remove all
attached cables from both boards.
Connect the PIC24FJ256GB110 PIM to the Explorer 16 board. Be careful when connecting the boards to
insure that no pins are bent or damaged during the process. Also insure that the PIM is not shifted in
any direction and that all of the headers are properly aligned.
4) On the USB PICTail Plus board, short jumper
JP1. Remove all other shorts on the
board.
5) Connect the USB PICTail Plus board to either
of the female PICTail Plus connectors or on the card edge connector (J9) at the
edge of the Explorer 16 board.
1) Short pins 2 and 3 of J14
To
run this project, you will need to load the corresponding firmware into the devices. There are two methods available for loading
the demos: Precompiled demos and source code projects.
Precompiled
Demos are available in the “<Install Directory>\USB – Precompiled Demos”
folders. Each demo should be prefaced
with the hardware platform it is compiled for.
Select the file that matches the hardware that you have and the demo
that you want to run. For more
information about how to load a precompiled project, please see the “Getting
Started – Loading a precompiled demo” guide.
The
source code for this demo is available in the “<Install Directory\USB Device
– CDC – Basic Demo” 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 allows the device to appear like a serial (COM) port to the host. This demo will take data sent over the USB
CDC interface and send it on the UART of the microcontroller.
In
order to run this demo first compile and program the target device. Attach the device to the host with the USB
cable. Also connect the RS232 port of
the demo board to a computer. This
computer and be the same computer as the USB connection or it can be a
different computer. If the host is a PC
and this is the first time you have plugged this device into the computer then
you may be asked for a .inf
file.
Select
the “Install from a list or specific location (Advanced)” option. Point to the “<Install Directory>\USB
Device - CDC – Serial Emulator\inf\win2k_winxp” directory
Once
the device is successfully installed, open up a terminal program, such as hyperterminal.
Select the appropriate COM port for the USB virtual COM port. On most machines this will be COM5 or higher. On the computer where the RS232 cable it
attached, open a second terminal program. Select the hardware COM port associated with
that computer. Please insure that the baud
rate for both terminal windows is the same.
Once
everything is configured correctly, typing a key in one terminal window will
result in the same data to show up in the second terminal window.
Note:
Some terminal programs, like hyperterminal, require
users to click the disconnect button before removing the device from the
computer. Failing to do so may result in
having to close and open the program again in order to reconnect to the device.
The Microchip name and logo, the Microchip logo,
MPLAB, and PIC are registered trademarks of Microchip Technology Incorporated
in the
PICDEM and PICTail are
registered trademarks of Microchip Technology Incorporated in the
Microsoft, Windows, and
Windows Vista are either registered trademarks or trademarks of Microsoft
Corporation in the