USB Host Powering

Discussion in 'Programmer's Corner' started by chrisw1990, Apr 14, 2012.

  1. chrisw1990

    Thread Starter Active Member

    Oct 22, 2011
    ok.. iv got my hardware here..
    5V supply is fine, think i may have confused myself when designing the usb bits though...
    VBUSON and VUSB..
    i tied VUSB to the enable of my 5V psu.. and VUSB to the 5V power line..
    iv been looking at Section 27. USB On-The-Go (OTG)
    and DM320004 User Guide Page 24.
    and im none the wiser, but i think i should have put VBUSON to a mosfet switch thing like the DM320004, and VUSB to 5V as on the dev kit, but i dont know? nor do i know how to correct this..
    cant quite put thumb on what exactly is wrong.. help:(
    and does someone understand what this does?
    Code ( (Unknown Language)):
    1. //#define USE_SELF_POWER_SENSE_IO
    2. #define tris_self_power     TRISAbits.TRISA2    // Input
    3. #define self_power          1
    5. //#define USE_USB_BUS_SENSE_IO
    6. #define tris_usb_bus_sense  TRISBbits.TRISB5    // Input
    7. #define USB_BUS_SENSE       1