2 Axes USB HID Descriptor problem


+ Reply to Thread
Results 1 to 3 of 3
  1. #1

    Question 2 Axes USB HID Descriptor problem

    Hi everyone,

    This is the first time I make usb project with pics but and i read a lot about configuring the Descriptor file.

    I just need x and y axes coming from to POTs feeding AN0 and AN1

    Windows can recognize my device as joystick but not showing the axes.

    I am using PIC18F2550 and there is no extra things the PIC should do

    can any one help me in configuring the Descriptor file, my project is in the attachment

    Thank you in advancemyproject.zip

  2. #2

    Default Re: 2 Axes USB HID Descriptor problem

    I could go a head one step and everything seems to be well but only on the simulation program, but on realty the two values are always zero and they are not changing while the analog signals change and I also tried to post constant values to find out where the problem is but it think it is from the descriptor file.

    I think my Descriptor is still have something wrong so would anyone help me to find what's wrong in my descriptor?

    Thank you

    Code:
    ReportDescriptor1
        ; USAGE_PAGE (Generic Desktop)
        retlw	0x05		
        retlw	0x01
        ;retlw	0xFF
    
        ; USAGE (Joystick)
        retlw	0x09
        retlw	0x05
    
        ; collection(application)
        retlw	0xA1
        retlw	0x01
        
        ;usage (Pointer)
        ;retlw 0x09      
        ;retlw 0x01
            
        ;usage (Phiscal)
        ;retlw 0xA1      
        ;retlw 0x00  
        
       
    
        ; *** INPUT REPORT ***
    
        ; usage(X)
        retlw	0x09
        retlw	0x33
        
        ;usage(Y)
        retlw	0x19
        retlw	0x34
        
      
    
        retlw	0x15 	; logical minimum (-128)
        retlw	0x80    ;
        
        retlw	0x25 	; logical maximum (127)
        retlw	0x7F
        
        
        retlw	0x75 	; Report Size (8)
        retlw	0x08    ;
        
        retlw	0x95 	; Report count(2)
        retlw	0x02   ;
        
    
        ; Input (Data, Variable, Absolute)
        retlw	0x81
        retlw	0x02
    
        retlw   0xC0       	   ; end collection
      
    
    EndReportDescriptor1
    Last edited by TronicBrain; - 6th March 2014 at 12:47.

  3. #3
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257

    Default Re: 2 Axes USB HID Descriptor problem

    TronicBrain did you sort this out yet?

    I dug through some of my old examples and found this - not sure if it works but it might get ou in the right direction. I haven't played with pics in a long time so bit rusty.

    Code:
    ReportDescriptor1
        RETLW 0x05  
        RETLW 0x01                      ; USAGE_PAGE (Generic Desktop)
        RETLW 0x09  
        RETLW 0x04                      ; USAGE (Joystick)
        RETLW 0xa1  
        RETLW 0x01                      ; COLLECTION (Application)
        RETLW 0x09  
        RETLW 0x01                      ;   USAGE (Pointer)
        RETLW 0xa1  
        RETLW 0x00                      ;   COLLECTION (Physical)
        RETLW 0x95  
        RETLW 0x02                      ;     REPORT_COUNT (2)
        RETLW 0x75  
        RETLW 0x08                      ;     REPORT_SIZE (8)
        RETLW 0x15  
        RETLW 0x00                      ;     LOGICAL_MINIMUM (0)
        RETLW 0x26  
        RETLW 0xff  
        RETLW 0x00              	    ;     LOGICAL_MAXIMUM (255)
        RETLW 0x35  
        RETLW 0x00                      ;     PHYSICAL_MINIMUM (0)
        RETLW 0x46  
        RETLW 0xff  
        RETLW 0x00                      ;     PHYSICAL_MAXIMUM (255)
        RETLW 0x09  
        RETLW 0x30                      ;     USAGE (X)
        RETLW 0x09  
        RETLW 0x31                      ;     USAGE (Y)
        RETLW 0x81  
        RETLW 0x02                      ;     INPUT (Data Var Abs)
        RETLW 0xc0                            ;     END_COLLECTION
        RETLW 0xc0                            ; END_COLLECTION
    EndReportDescriptor1

Similar Threads

  1. USB hid maker help please.
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd April 2013, 14:49
  2. HID USB on 18F87J50
    By pedja089 in forum USB
    Replies: 56
    Last Post: - 25th August 2011, 09:24
  3. USB HID Problem
    By Gitchie in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th January 2011, 15:15
  4. Usb hid
    By yatyas72 in forum USB
    Replies: 5
    Last Post: - 3rd December 2010, 15:45
  5. Making your own HID descriptor file
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th April 2005, 12:35

Posting Permissions

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