USB on 18F2455 funky problem


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Dec 2006
    Posts
    32

    Question USB on 18F2455 funky problem

    Hi guys,

    Ive got a bit of a strange problem that I cant seem to fathom out.

    Ive got an 18F2455 using the USB and on the breadboard it works fine, plug in a USB to the project and I can read and write the settings etc. but earlier today, I transferred the project onto an etched PCB (checked the PCB for any shorts etc all checked out fine) now here's the problem, it all works as it should BUT whenever I hook it upto the USB windowz comes up with the error saying something like 'theres a problem with the USB divice (sorry cant remember exactly but you'll probably know lol!)

    I tried rewiring the USB port, changing the wire I used, even tried ultra short wires and nothing!
    I tested the lines with my meter, and sticking one probe onto each pin individually on the USB port and the other on the actual pins of the pic chip and theres no breaks on either track so im at a complete loss!! (GND obviously to the GND line and shows continuity)

    Im not using the 5V from the USB, as im using 24v PSU split down to 5V for the logic side etc, but I am obviously using the GND so that the PC and the project are grounded, and the D- D+ are correctly connected too.

    So does anyone have any suggestions? I can add a schematic if needed, but everything else is working fine.

    Many thanks,

    Mark

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default Re: USB on 18F2455 funky problem

    Do you have a capacitor on VUSB? 0.22uF or greater?
    And is the regulator turned on in the configs?
    DT

  3. #3
    Join Date
    Dec 2006
    Posts
    32

    Default Re: USB on 18F2455 funky problem

    Hi Darrel,

    Yeah ive got a cap on the VUSB, same on both the breadboard and the project.
    regulator? youve got me there!

    Here is my config settings from my project, and I think it was from a thread about USB that I think maybe you had written (but dont quote me on that lol!)
    It all works fine when its sat on the breadbaord, just not when its on my PCB.

    Code:
    '****************************************************************
    ' Config settings
    '****************************************************************
    
    asm
    __CONFIG    _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L  
                            ;              ;                      ; USB clock source comes from the 96 MHz PLL divided by 2
                            ;              ; [OSC1/OSC2 Src: /1][96 MHz PLL Src: /2]
                            ; No prescale (4 MHz oscillator input drives PLL directly)
    
    
    __CONFIG    _CONFIG1H, _FOSC_XTPLL_XT_1H & _FCMEM_OFF_1H & _IESO_OFF_1H 
                            ;                  ;               ; Oscillator Switchover mode disabled
                            ;                  ; Fail-Safe Clock Monitor disabled
                            ; XT oscillator, PLL enabled, XT used by USB
                            
    __CONFIG    _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L  & _BORV_2_2L  & _VREGEN_ON_2L   
    __CONFIG    _CONFIG2H, _WDT_OFF_2H 
    __CONFIG    _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_ON_3H 
    __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L 
    endasm
    DEFINE OSC 48
    clear
    Hope that helps.

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default Re: USB on 18F2455 funky problem

    The _VREGEN_ON_2L turns on the regulator, so you're ok there.

    Does your PCB have a 4mhz crystal? That's what the configs are set for.

    Are you running USBSERVICE often enough? ~1-2mS.
    DT

  5. #5
    Join Date
    Dec 2006
    Posts
    32

    Default Re: USB on 18F2455 funky problem

    yeah im using a 4mhz xtal as theyre what I had handy at the time lol.
    Im using your USB ints for controlling the USB and its set to 10ms interval on both the USB_POLLIN and USB_POLLOUT

    Edit: USB interupts are running on TMR1

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default Re: USB on 18F2455 funky problem

    Quote Originally Posted by Mark J View Post
    Edit: USB interupts are running on TMR1
    That should not be the case. They should run off of the USB interrupts.
    DT

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