HID USB on 18F87J50


Closed Thread
Results 1 to 40 of 57

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Posts
    755

    Default Re: HID USB on 18F87J50

    Yes, I tried that and DT_HID. But nothing happen if cable is plugged or unplugged.
    For now, CDC will be good starting point.
    I would be very grateful if you could send me CDC example with fuse configuration.
    Thank you very much.

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default Re: HID USB on 18F87J50

    Well, now I am starting to wonder if I ever had it working on CDC. I had a cdc labeled program for it, but what I had does not work. I had a fairly quick time with the 47J53 in CDC as well as HID, but for the 67J50, I can't seem to get either to work, and I have spent a fair amount of time at it.

    These were the configs I used for other programs for the 67J50, which pretty much matches Microchip's HID bootloader software.

    Code:
    'DEFINE LOADER_USED 1
    'DEFINE RESET_ORG 1000h ' For Microchip USB Bootloader
    #config
        CONFIG PLLDIV = 5       ;for 20 mhz chip
        CONFIG XINST = OFF
        CONFIG STVREN = ON    ;stack overflow reset
        CONFIG WDTEN = OFF    
        CONFIG CP0 = OFF    
        CONFIG IESO = OFF    
        CONFIG FCMEN = OFF    
        CONFIG CCP2MX = DEFAULT    
        CONFIG WDTPS = 32768 
        CONFIG CPUDIV = OSC1  ;DIVIDE BY 1 MODE
        CONFIG FOSC = HSPLL
        CONFIG MSSPMSK = MSK5   
    #endconfig
    
    DEFINE OSC 48
    clear
    OSCTUNE.6 = 1  ' Enable PLL for 18F87J50 family
    I will try a few more things, but I wanted to give you a heads up.

  3. #3
    Join Date
    Sep 2009
    Posts
    755

    Default Re: HID USB on 18F87J50

    I try cdc from pbp/usb18 and add config, but still nothing...
    I use 8MHz crystal, so PPLDIV is 2 is that correct?
    What are the chances that the USB module on 3 PIC are broken?

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default Re: HID USB on 18F87J50

    Not very high. But (speaking for myself), the chances of the problem being behind the keyboard is pretty high! Just not sure what I could be missing here, doing it two different ways hid, and cdc, and with a USB bootloader, and without. So I am running out of things I can think of to try....

    Yes, divide by two would be correct for a 8 mhz.

  5. #5
    Join Date
    Sep 2009
    Posts
    755

    Angry Re: HID USB on 18F87J50

    I check hardware and recheck, and everything seems ok.
    Here is code for cdc from pbp/usb18:
    Code:
        asm
        CONFIG PLLDIV = 2       ;for 8 mhz chip
        CONFIG XINST = OFF
        CONFIG STVREN = ON    ;stack overflow reset
        CONFIG WDTEN = OFF    
        CONFIG CP0 = OFF    
        CONFIG IESO = OFF    
        CONFIG FCMEN = OFF    
        CONFIG CCP2MX = DEFAULT    
        CONFIG WDTPS = 32768 
        CONFIG CPUDIV = OSC1  ;DIVIDE BY 1 MODE
        CONFIG FOSC = HSPLL
        CONFIG MSSPMSK = MSK5  
        endasm
        Include    "cdc_desc.bas"    ' Include the HID descriptors
    
    Define  OSC     48
    
    buffer    Var    Byte[16]
    cnt    Var    Byte
    
    
        OSCTUNE.6 = 1        ' Enable PLL for 18F87J50 family
        Pause 10
    
        USBInit            ' Get USB going
    
    ' Wait for USB input
    idleloop:
        USBService        ' Must service USB regularly
        cnt = 16        ' Specify input buffer size
        USBIn 3, buffer, cnt, idleloop
    
    ' Message received
        buffer[0] = "H"
        buffer[1] = "e"
        buffer[2] = "l"
        buffer[3] = "l"
        buffer[4] = "o"
        buffer[5] = " "
        buffer[6] = "W"
        buffer[7] = "o"
        buffer[8] = "r"
        buffer[9] = "l"
        buffer[10] = "d"
        buffer[11] = 13
        buffer[12] = 10
        buffer[13] = 0
    
    outloop:
        USBService        ' Must service USB regularly
        USBOut 3, buffer, 14, outloop
    
        Goto idleloop        ' Wait for next buffer
    I spend another day on it, and nothig, rely, nothin on usb...
    I really don't know what to do.

Members who have read this thread : 0

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

Posting Permissions

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