Getting Started: Running the “Host –
HID – Keyboard” demo
To run this project, you will need one of the
following sets of hardware:
PIC24FJ256GB110
Plug-In-Module (PIM) (MA240014)
Explorer
16 (DM240001)
USB
PICtail™ Plus Daughter Card (AC164131)
This
section describes how to set up the various configurations of hardware to run
this demo.
Configuration 1: PIC24FJ256GB110 PIM + Explorer 16
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 jumpers
JP2 and JP3. 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.
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
Host – HID – Keyboard” 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® help available through the help menu of
MPLAB (Help->Topics…->MPLAB IDE).
When
the device is programmed correctly with the HID host keyboard application the
LCD screen on the Explorer 16 should read “Device Detached” if there is no
device attached to the USB port. At this
point plug in a USB keyboard, bar code scanner that supports HID keyboard
emulation, or magnetic card reader that supports HID keyboard emulation. Type a key on the keyboard. This character should be printed on the LCD
screen. Pressing the “ESC” key will
clear the screen and return the cursor to the first position.
Note: when bootloading
this application using the HID bootloader, please
make sure that the “Allow Configuration Word Programming” box is checked. This is required to be able to program the
interrupt vectors on PIC24 products. As
this demo requires interrupts it will not work without this feature enabled.
Composite and compound device are not currently supported. These devices may not enumerate or operate correctly. Keyboards with built in USB hubs are likely compound device. Many multimedia keyboards are composite devices.
The Microchip name and logo, the Microchip logo,
MPLAB, and PIC are registered trademarks of Microchip Technology Incorporated
in the
PICDEM is a trademark of
Microchip Technology Incorporated in the
Microsoft, Windows, and
Windows Vista are either registered trademarks or trademarks of Microsoft
Corporation in the