LPCware Archive Content

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPCware Archive Content

Discussions

Sort by:
Description This example implements a HID class device with mouse report descriptors. Mouse movement reports are sent to the host by the device when buttons or the joystick is pressed on the development board.   On the Embedded Artists LPCXpresso Rev A or B Baseboard this example will move the host PC's mouse cursor when the joystick is operated. Pressing the joystick down will create a mouse left click. Compiler build configurations The software that makes up this example is designed to run on many different development boards. Therefore the compiler must be configured to build an image that is targeted to the development board you are using. This section explains how to set these build configurations for each of the supported compilers.   LPCXpresso IDE Configure projects   right click on the BSP project in the project explorer window   click Build Configurations->Set Active->(see configuration in table below)   repeat these steps with the CDL, nxpUSBlib, and Example_MouseDevice Configure MCU   right click on the Example_MouseDevice project in the project explorer window   click Properties->C/C++ Build->MCU settings->(see configuration in table below) Configure the indexer    click Window->Preferences->C/C++->Indexer->Use active build configuration BSP CDL nxpUSBlib Example_MouseDevice MCU LPC1850  / Hitex LPC18xx_HITEX LPC18xx LPC18xx_Device LPC18xx LPC1850 LPC4330  / Xplorer LPC4330_Xplorer LPC18xx LPC18xx_Device LPC18xx LPC4330 LPC4350  / Element14 LPC1435_ELEMENT14 LPC18xx LPC18xx_Device LPC18xx LPC4350 LPC11U14 / LPCXpresso LPC11Uxx_LPCXpressoRevB LPC11Uxx LPC11Uxx_Device LPC11Uxx LPC11U14 LPC11U14 / MCB1000 LPC11u14_MCB1000 LPC11Uxx LPC11Uxx_Device LPC11Uxx LPC11U14 LPC1768  / MCB1700 LPC1768_MCB1700 LPC17xx LPC17xx_Device LPC17xx LPC1768 LPC1768  / LPCXpresso LPC17xx_LPCXpressoRevB LPC17xx LPC17xx_Device LPC17xx LPC1768 NOTE: The LPC18xx CDL is used with boards that hold LPC43xx parts. This is done because the LPC43xx CDL is currently experimental. The LPC18xx USB library is used because both parts share the same controller.   Keil uVision 4 IDE Configure a Batch Build     click on Project->Batch Build...   expand the BSP project to display a list of project targets   select the project target by checking the appropriate checkbox (see target list in table below)   repeat these steps with the CDL, nxpUSBlib_Device, and Example_MouseDevice BSP CDL nxpUSBlib_Device Example_MouseDevice LPC1850  / Hitex HITEX1800 LPC18xx LPC18xx_Device HITEX1800 LPC1768  / MCB1700 MCB1700 LPC17xx LPC17xx_Device MCB1700 LPC11U14 / MCB1000 MCB1000 LPC11Uxx LPC11Uxx_Device MCB1000   Board connections and configurations   LPC18xx_HITEX (LPC1850 Hitex Evaluation Board)  older A2 design schematic ./BSP/schematics/HITEX_SCM_LPC1850EVA-A2-2.pdf   Connect the JTAG to the 20 pin receptacle marked X4 JTAG Connect the type-B end of a USB cable to the receptacle marked X2. Plug the type-A end of this cable into a PC LPC18xx_HITEX (LPC1850 Hitex Evaluation Board)  newer A4 design schematic ./BSP/schematics/HITEX_Final_LPC1850EVA-A3.pdf   LPC4330_Xplorer (NGX Xplorer Evaluation Board with LPC4330) Connect the JTAG to the 10 pin receptacle marked J2 Connect the micro-b end of a USB cable to the receptacle marked USB0. Plug the type-A end of this cable into a PC   LPC1435_ELEMENT14 (Element 14 gaming board with LPC4350) Connect the JTAG to the 10 pin receptacle marked J6 Connect one end of a type-A to type-A USB cable to the receptacle marked USB0. Plug the other end of this cable into a PC   LPC11u14_MCB1000 (Keil MCB1000 development board) schematic: ./BSP/schematics/mcb1000-schematics.pdf   Jumpers:   J4 = 2-3      (UCON - PIO0_6 pulls D+ high)   J2 = 1-2          (VDD  - core power)   J5 not installed  (ISP  - ISP via COMM)   J6 not installed  (RST  - ISP via COMM) Connect the JTAG debugger to the 10 pin Cortex Debug connector labeled J3 Connect the type-B end of a USB cable to the type-B recepticle and the type-A end of the cable to the USB receptacle on a PC Once the USB cable is connected to the board the following LEDs should be illuminated:     Power     All 8 LEDs in PIO2   LPC1768_MCB1700 (Keil MCB1700 development board) schematic: ./BSP/schematics/mcb1700-schematics.pdf   Jumpers:   E/U    = 1-2  (Ethernet/USB)   UMODE  = 1-2  (USB Device Mode)   D-     = Device   D+     = Device   VBUS   = 1-2   VDDIO  = 1-2   VDDREG = 1-2   Connect the JTAG debugger to the 20 pin JTAG or 10 pin Cortex Debug connector. Connect the type-B end of a USB cable to the type-B recepticle labeled 'Device' and the type-A end of the cable to the USB receptacle on a PC. Once the USB cable is connected to the board the following LEDs should be illuminated:     Power     100MHz     USC (LED indicates a USB soft connect from P2.9)    LPC11Uxx_LPCXpressoRevB (LPCXpresso LPC11Uxx on the LPCXpresso Rev B base board) schematic: ./BSP/schematics/lpcxpresso.lpc11u14.schematic.pdf   Running this example on the LPCXpresso LPC11U14 can be done one of two ways:   1. LPCXpresso LPC11U14 stand-alone       Connect the type-B end of a USB cable to the mini receptacle on the LPCXpresso board labeled J8 and the type-A end to the USB receptacle on a PC   2. LPCXpresso LPC11U14 plugged into the LPCXpresso base board Rev B       Plug the LPCXpresso LPC11U14 board into the connector labeled J4 on a LPCXpresso base board Rev B       Configure the base board according to the user's guide from Embedded Artists       Connect the mini type-B end of a USB cable to the receptacle on the base board labeled X1 and the type-A end to the USB receptacle on a PC       Once the USB cable is connected to the board the following LEDs should be illuminated:           LED25  (vbus)          LED26  (3.3v rail)         For both configurations the JTAG debugger is connected to the mini USB receptacle labeled J3 on the LPCXpresso LPC11U14 board   LPC17xx_LPCXpressoRevB (LPCXpresso LPC17xx on the LPCXpresso Rev B base board) schematic: ./BSP/schematics/LPCXpressoLPC1769revB.pdf   Running this example on the LPCXpresso LPC1769 can be done one of two ways:   1. LPCXpresso LPC1769 stand-alone. Solder a type-B USB receptacle onto the board and wire it up. See included schematics for details. Connect the type-B end of a USB cable to the receptacle on the LPCXpresso board and the type-A end to the USB receptacle on a PC   2. LPCXpresso LPC1769 plugged into the LPCXpresso base board Rev B. Plug the LPCXpresso LPC1769 board into the connector labeled J4 on a LPCXpresso base board Rev B. Configure the base board according to the users guide from Embedded Artists. Connect the mini type-B end of a USB cable to the receptacle on the base board labeled X1 and the type-A end to the USB receptacle on a PC.    Once the USB cable is connected to the board the following LEDs should be illuminated:       LED25  (vbus)       LED26  (3.3v rail)         For both configurations the JTAG debugger is connected to the mini USB receptacle labeled J3 on the LPCXpresso LPC1769 board.   PC configuration Use a PC running Windows XP, Vista or 7 Connect the type-A end of the USB cable that is connected to the board into one of the USB receptacles on the PC Build and debug the example LPCXpresso IDE In the project explorer window of the IDE right click on the Example_MouseDevice project and select Debug As->C/C++ MCU Application In the main window of the IDE click Run->Resume to start running the application   Keil uVision 4 IDE In the Batch Build window, select the project targets as described in Compiler Build Configurations and then click Build In the main window of the IDE click Debug->Start/Stop Debug Session click Debug->Run   How this example runs and what to look for When the example is run and the board is connected to a PC with a USB cable it will enumerate on the PC as a HID Mouse device. You should see the device appear in the "Device Manager" under "Mice". If you right click on HID  Device->Properties a window will appear called "HID Mouse Device Properties". If you select the "Details" tab you will see a "Properties" drop down, click on it and select "Hardware Ids". You should see the below entries for Vendor Id and Product Id.   HID\VID_1FC9&PID_2041&REV_0001 HID\VID_1FC9&PID_2041   This information should match the data in the "Device Descriptor Structure" in the "Descriptors.c" file in the Example_MouseDevice project directory.   Press the joystick to move the mouse cursor on the PC desktop and push the buttons to cause mouse buttons to click.
View full article
Introduction The IOH application examples provide a great and easy way to get started with I/O Handler. All provided IOH examples come with project files for LPCXpresso, Keil MDK and IAR EWARM. This page will give an overview on how to start exploring these examples. 1. Download the full IOH kit The first step is to download the full IOH kit. This kit contains: The IOH libraries. For every library one application note describing the library and the example application(s). One or more application example projects Download the full IOH kit attached Unzip the archive to e.g. C:/nxp/ 2. Open the project in the IDE The second step is opening the projects into the IDE. LPCXpresso: 1. Choose 'File'->'Import'. Then select 'General'->'Existing Projects into Workspace' 2. Select 'Select archive file' and click 'Browse'. Select the file 'lpcxpresso_nxp_lpcxpresso_11u37h.zip' which is in the unzipped folder       (e.g. C:/nxp/nxp_lpcxpresso_lpc11u37h_ioh/lpcxpresso_nxp_lpcxpresso_11u37h.zip) 3. Import all project into the workspace by clicking 'Finish'. Note: You may also choose to only import a selected number of projects. In that case, always                     make sure you import at least three project:      'lpc_chip_11uxx_lib', 'nxp_lpcxpresso_11u37h_board_lib' and the example project of interest. Keil MDK: In Keil, open the multi-project workspace located at: nxp_lpcxpresso_lpc11u37h_ioh\applications\lpc11xx\keil_uvision_projects\nxp_lpcxpresso_11u37h\nxp_lpcxpresso_11u37h_ioh_examples.uvmpw IAR EWARM: In IAR, open the multi-project workspace located at: nxp_lpcxpresso_lpc11u37h_ioh\applications\lpc11xx\iar_ewarm_projects\nxp_lpcxpresso_11u37h\nxp_lpcxpresso_11u37h_ioh_examples.eww 3. Building the project After successfullt importing the project into the IDE, the project can be build. LPCXpresso: Select the example project of interest and click the 'Build' icon. The chip and board project will be automatically be compiled. Keil MDK: 1. Right-click on the example of interest in the project explorer and select 'Choose as Active Project'. 2. Click 'Project'->'Batch Build...'. Select atleast the 'lib_lpc_chip_11uxx', 'lib_lpc_board_nxp_lpcxpresso_11u37h' and the project of interest. 3. Click 'Build'. IAR EWARM: 1. In the project explorer, select the project of interest from the drop-down list to make that project the active project. 2. Click 'Project'->'Batch build...' and then click 'Edit'. Select atleast the 'lib_lpc_chip_11uxx', 'lib_lpc_board_nxp_lpcxpresso_11u37h' and the project of interest as 'Configurations to build'. When done, press 'OK'. 3. Click 'Make'. Important: IAR EWARM may require an update and a patch. If this condition is not met, compilation (linking) will result in an 'internal error' message from the IAR linker. Please make sure you're running 6.70.1.5794 or higher and that you have installed the 'EWARM linker patch 6.70.2-5901'. Please check your IAR mypages for any available updates. 4. Flashing the binary into the board LPCXpresso: 1. Connect a USB cable to J6 of the LPC11U37H board. J6 is the Link-2 USB connector, which allows LPCXPresso to access the LPC11U37H target for programming and debugging. 2. Click the 'Debug' icon to launch a debug session. 3. click the 'Resume' icon to start code execution. Keil MDK: 1. Either: Configure the Link2 as CMSIS DAP/J-Link (click here for more details) and connect a USB cable to J6 of the LPC11U37H board. J6 is the Link-2 USB connector. Connect a supported external debugger to P1 2. Click the 'Load' icon in Keil to download the compiled binary into the board. 3. After download has finished, hit the reset button to run the example. IAR EWARM: 1. Either: Configure the Link2 as CMSIS DAP/J-Link (click here for more details) and connect a USB cable to J6 of the LPC11U37H board. J6 is the Link-2 USB connector. Connect a supported external debugger to P1 2. Click the 'Download and Debug' icon in IAR to download the compiled binary into the board and to start a debug session. 3. After download has finished, click the 'Go' icon to start code execution.
View full article