How to use PIC18 with MCP USB Chip to do HID?


Results 1 to 9 of 9

Threaded View

  1. #6


    Did you find this post helpful? Yes | No

    Default Re: How to use PIC18 with MCP USB Chip to do HID?

    Am I missing anything?
    Simple answer, yes.

    The MCP2200 is a preprogrammed PIC, which appears to the world as a USB to Serial convertor. Ading a mouse descriptor and the necesary software to service the descriptor is essentially impossible (no flames please). You would be much better of starting with a 18F14K50, modifying a HID sample.

    The data sheet gives details of how to change it's PID (among other things). From the data sheet -

    The configuration utility provided by Microchip allows the user to configure the MCP2200 to custom defaults. The configuration utility (shown in Figure 2-1) connects
    to the device’s HID interface, where all of the configurable features can be set.
    Name:  Untitled.jpg
Views: 2952
Size:  93.9 KB

    .I don't want to use the onboard USB as it doesn't have a vendor id
    Incorrect. The VID and PID are changed in the descriptor file which will be part of the compiled project.

    eg The portion of gen_desc.bas which defines the VID (among other things), in this case 04D8 hex.
    Code:
    DeviceDescriptor
    	retlw	(EndDeviceDescriptor-DeviceDescriptor)/2	; Size of this descriptor in bytes
    	retlw	USB_DESCRIPTOR_DEVICE	; DEVICE descriptor type
    	retlw	0x10		; USB Spec Release Number in BCD format - 1.10 (low byte)
    	retlw	0x01		; (high byte)
    	retlw	0x00		; Class Code
    	retlw	0x00		; Subclass code
    	retlw	0x00		; Protocol code
    	retlw	USB_EP0_BUFF_SIZE	; Max packet size for EP0
    	retlw	0xD8		; Vendor ID - 0x04D8 is Microchip Vendor ID (low byte)
    	retlw	0x04		; (high byte)
    	retlw	0x0C		; Product ID: PICDEM FS USB (DEMO Mode) (low byte)
    	retlw	0x00		; (high byte)
    	retlw	0x00		; Device release number in BCD format (low byte)
    	retlw	0x00		; (high byte)
    	retlw	0x01		; Manufacturer string index
    	retlw	0x02		; Product string index
    	retlw	0x00		; Device serial number string index
    	retlw	NUM_CONFIGURATIONS	; Number of possible configurations
    EndDeviceDescriptor
    I don't understand your references to mice?
    Last edited by towlerg; - 15th June 2016 at 13:56.
    George

Similar Threads

  1. Olimex PIC-MCP-USB
    By Tawcafts in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st March 2012, 17:54
  2. PIC18 connect to USB thumb drive
    By Pic2008 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th April 2011, 18:15
  3. Usb hid
    By yatyas72 in forum USB
    Replies: 5
    Last Post: - 3rd December 2010, 15:45
  4. PIC18 USB Programmer
    By r0nd0m in forum Off Topic
    Replies: 1
    Last Post: - 23rd February 2009, 15:59
  5. PIC18 USB simple example needed
    By harryweb in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 29th September 2005, 22:20

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts