USB on 18F27J53. Closer but still struggling with this.


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Mar 2005
    Location
    Cocoa, Florida
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Re: USB on 18F27J53. Closer but still struggling with this.

    Tried 4MHz again with same results: Everything else OK but no USB.

    Schematic ~ PIC is wired: 4M on OSC; VUSB cap to gnd; USB on D+, D-; R/C on MCLR.
    Plus LCD (forget which pins) which works great.
    Oh, plus debug on pin13, works too.

    Tried with and without VB GUI running.
    Code is untouched from EasyHID Wizard (because there is sign of a helpful 'Put something here'), although I have changed OSC speed:

    ' ************************************************** **********
    ' * Auto generated EasyHID file. PBP 2.60 and above *
    ' ************************************************** **********

    ' include the HID descriptor
    include "DESCUSBProject.bas"

    DEFINE OSC 4
    DEFINE LOADER_USED 1

    USBBufferSizeMax con 8 ' maximum buffer size
    USBBufferSizeTX con 8 ' input
    USBBufferSizeRX con 8 ' output

    ' the USB buffer...
    USBBuffer Var Byte[USBBufferSizeMax]
    USBBufferCount Var Byte

    ' ************************************************** **********
    ' * main program loop - remember, you must keep the USB *
    ' * connection alive with a call to USBService every couple *
    ' * of milliseconds or so... *
    ' ************************************************** **********
    usbinit ' initialise USB...
    ProgramStart:
    gosub DoUSBIn
    gosub DoUSBOut
    goto ProgramStart

    ' ************************************************** **********
    ' * receive data from the USB bus *
    ' ************************************************** **********
    DoUSBIn:
    USBBufferCount = USBBufferSizeRX ' RX buffer size
    USBService ' keep connection alive
    USBIn 1, USBBuffer, USBBufferCount, DoUSBIn ' read data, if available
    return

    ' ************************************************** **********
    ' * wait for USB interface to attach *
    ' ************************************************** **********
    DoUSBOut:
    USBBufferCount = USBBufferSizeTX ' TX buffer size
    USBService ' keep connection alive
    USBOut 1, USBBuffer, USBBufferCount, DoUSBOut ' if bus available, transmit data
    return

    Windows responds: 'No driver files required or have been loaded for this device'
    Last edited by kenif; - 10th August 2011 at 06:51.

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